public OutputMesh GetNewCloneVariant() { OutputMesh oMesh = new OutputMesh(); oMesh.vertices = new Vector3[this.vertices.Length]; System.Buffer.BlockCopy(this.vertices, 0, oMesh.vertices, 0, this.vertices.Length); oMesh.normals = new Vector3[this.normals.Length]; System.Buffer.BlockCopy(this.normals, 0, oMesh.normals, 0, this.normals.Length); oMesh.tangents = new Vector3[this.tangents.Length]; System.Buffer.BlockCopy(this.tangents, 0, oMesh.tangents, 0, this.tangents.Length); oMesh.uvs = new Vector2[this.uvs.Length]; System.Buffer.BlockCopy(this.uvs, 0, oMesh.uvs, 0, this.uvs.Length); oMesh.indices = indices; return(oMesh); }
public void UpdateTessellationVariant(int id, short[] loqs, CPNSubset cpnSubset = null) { if (id < 0 || id > records.Length || !records[id].used) { return; } CPNTessellationProcess tessellationProcess = ProcessesKeeper.GetTessellationProcess(); OutputMesh mesh = GetMeshOutput(id); if (mesh != null) { tessellationProcess.InitPrebuiltProcess(this.curvedPolygonsNet, GetTessellationOutput(id), cpnSubset, loqs); tessellationProcess.WriteMesh(mesh); } }
public void GenerateTessellationVariant(int id, short[] loqs) { if (id < 0 || id > records.Length || !records[id].used) { return; } CPNTessellationProcess tessellationProcess = ProcessesKeeper.GetTessellationProcess(); TessellationOutput tesellationOutput = tessellationProcess.InitProcess( this.curvedPolygonsNet, loqs); tessellationProcess.BuildProfile(); int[] builtTrianglesCount = tesellationOutput.GetBuiltTrianglesSize(); int builtVerticesCount = tesellationOutput.GetBuiltVerticesSize(); OutputMesh outputMesh = new OutputMesh(); outputMesh.Build(builtVerticesCount, builtTrianglesCount); SetRecord(id, outputMesh, tesellationOutput); }
public void SetRecord(int id, OutputMesh mesh, TessellationOutput tessellationOutput) { records[id].outputMesh = mesh; records[id].tessellationOutput = tessellationOutput; }