public CombineImage2i(IImage2i imageA, IImage2i imageB, Operations operation) { ImageA = imageA; ImageB = imageB; Operation = operation; RangeZ = ImageA.RangeZ + ImageB.RangeZ; }
public SampledData2i Sample(IImage2i image, Vector2i offset) { offset = offset + offset; int x0y0 = image.Sample(offset); int x0y1 = image.Sample(new Vector2i(offset.x, offset.y + 1)); int x1y0 = image.Sample(new Vector2i(offset.x + 1, offset.y)); int x1y1 = image.Sample(new Vector2i(offset.x + 1, offset.y + 1)); return(new SampledData2i(x0y0, x0y1, x1y0, x1y1)); }
public SceneContext( IGroupSelector groupSelector, ITerrainGenerator2i terrainGenerator, IMeshUpdater meshUpdater, Vector3 cameraPosition, IReadOnlyList <Plane> cameraPlanes, IReadOnlyPooledList <Vector3> cameraFrustumCorners, Matrix4x4 cameraLocalToWorldMatrix, Matrix4x4 parentContainerWorldToLocalMatrix, IReadOnlySet <Vector2i> existingGroups, Vector2i cellInGroupCount, IImage2i image, Rect2i invalidatedArea_imageSpace, IImageSampler2i imageSampler, Func <GameObject> gameObjectFactory, ProfilerFactoryDelegate profilerFactory, LoggerFactoryDelegate loggerFactory) { GroupSelector = groupSelector; TerrainGenerator = terrainGenerator; MeshUpdater = meshUpdater; CameraPosition = cameraPosition; CameraPlanes = cameraPlanes; CameraFrustumCorners = cameraFrustumCorners; CameraLocalToWorldMatrix = cameraLocalToWorldMatrix; ParentContainerWorldToLocalMatrix = parentContainerWorldToLocalMatrix; ExistingGroups = existingGroups; CellInGroupCount = cellInGroupCount; Image = image; ImageSampler = imageSampler; GameObjectFactory = gameObjectFactory; ProfilerFactory = profilerFactory; LoggerFactory = loggerFactory; RangeZ = image.RangeZ; GroupBounds = new Bounds(new Vector3(CellInGroupCount.x / 2.0f, CellInGroupCount.y / 2.0f, RangeZ.Center), new Vector3(CellInGroupCount.x, CellInGroupCount.y, RangeZ.Size)); InvalidatedArea_worldSpace = ImageSampler .ImageToWorld(invalidatedArea_imageSpace) .RoundToContain(); (Image as IInitializableImage)?.StartUsing(); }
public int SampleX1Y1(IImage2i image, Vector2i pos) { return(image.Sample(new Vector2i(pos.x * 2 + 1, pos.y * 2 + 1))); }
public int SampleX0Y0(IImage2i image, Vector2i pos) { return(image.Sample(new Vector2i(pos.x * 2 + 0, pos.y * 2 + 0))); }
public int SampleX1Y1(IImage2i image, Vector2i pos) { return(image.Sample(new Vector2i(pos.x + 2, pos.y + 2))); }