public BatchCulling([NotNull] Camera camera, [NotNull] WetDecalSystem.MaterialBatch batch) { if (camera == null) { throw new ArgumentNullException("camera"); } if (batch == null) { throw new ArgumentNullException("batch"); } _camera = camera; _batch = batch; _visibleIndices = new int[8]; _distanceThresholds = new[] { camera.nearClipPlane, camera.farClipPlane }; _culling = new CullingGroup { targetCamera = camera }; _culling.SetBoundingDistances(_distanceThresholds); _culling.SetDistanceReferencePoint(camera.transform); _culling.SetBoundingSpheres(batch.BoundingSpheres); _culling.SetBoundingSphereCount(batch.Decals.Count); }
public DecalBatch([NotNull] Camera camera, [NotNull] Mesh box, [NotNull] WetDecalSystem.MaterialBatch batch) { Batch = batch; _box = box; _culling = new BatchCulling( camera, batch ); _instancingPropertyBlock = new MaterialPropertyBlock(); _matrices = new Matrix4x4[16]; }