Ejemplo n.º 1
0
        //in main thread
        //generate voxels
        public void CollectUsingComputeShader()
        {
            float maxSlopeCos = Mathf.Cos((float)((double)template.maxSlope * Math.PI / 180.0));

            for (int i = 0; i < templates.Count; i++)
            {
                MeshColliderInfo curInfo     = templates[i];
                Vector3          offsetedPos = template.realOffsetedPosition;

                CSRasterization3DResult result = PathFinder.scene.Rasterize3D(
                    curInfo.verts,
                    curInfo.tris,
                    curInfo.bounds,
                    curInfo.matrix,
                    template.lengthX_extra,
                    template.lengthZ_extra,
                    offsetedPos.x,
                    offsetedPos.z,
                    template.voxelSize,
                    maxSlopeCos);

                if (result != null)
                {
                    templatesAfterComputeShader.Add(new RData(curInfo, result));
                }
            }
        }
Ejemplo n.º 2
0
 public RData(MeshColliderInfo info, CSRasterization3DResult result)
 {
     this.info   = info;
     this.result = result;
 }