public void InitPrebuiltProcess(CurvedPolygonsNet curvedPolygonsNet, TessellationOutput output, CPNSubset subSet, short[] loqs, InterpolationSchemaMap map = null) { this.tessellationOutput = output; CPNGuideEvaluator.CPNGuide_loqs = loqs; this.curvedPolygonsNet = curvedPolygonsNet; this.subSet = subSet; this.map = map; }
public TessellationOutput InitProcess(CurvedPolygonsNet curvedPolygonsNet, short[] loqs, InterpolationSchemaMap map = null) { tessellationOutput = new TessellationOutput(); CPNGuideEvaluator.CPNGuide_loqs = loqs; this.curvedPolygonsNet = curvedPolygonsNet; this.subSet = null; this.map = map; return(tessellationOutput); }
public void RecomputeShape(LoDs lods, int index, CPNSubset cpnSubset = null) { CurvedPolyMeshItem[] items = tessellationModels[lods]; if (items != null) { if (index < items.Length && items[index].WasGenerated()) { short[] loqs = lods.availableLoqs[index].values; items[index].UpdateTessellationItem(loqs, cpnSubset); } } }
public void Execute() { CurvedPolygonsNet cpnet = asset.GetCPN(); CurvedPolyVariants cpnVariants = new CurvedPolyVariants(); cpnVariants.SetCPN(cpnet); short[] loqs = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; CPNTessellationProcess tessellationProcess = ProcessesKeeper.GetTessellationProcess(); TessellationOutput output = tessellationProcess.InitProcess(cpnet, loqs); //Debug.Log("cpnet.GetGeometriesCount() " + cpnet.GetGeometriesCount()); tessellationProcess.BuildProfile(); int[] builtTrianglesCount = output.GetBuiltTrianglesSize(); int builtVerticesCount = output.GetBuiltVerticesSize(); uvs_ = new Vector2[builtVerticesCount]; vertices_ = new Vector3[builtVerticesCount]; normals_ = new Vector3[builtVerticesCount]; indices_ = new int[builtTrianglesCount.Length][]; for (int i = 0; i < builtTrianglesCount.Length; i++) { indices_[i] = new int[builtTrianglesCount[i] * 3]; } OutputMesh mesh = null; mesh = new OutputMesh(vertices_, uvs_, normals_, indices_); tessellationProcess.WriteMesh(mesh); //here int id = cpnVariants.GetFreeTessellationRecordId(); cpnVariants.SetRecord(id, new OutputMesh(vertices_, uvs_, normals_, indices_), output); //this.outMesh = cpnVariants.GetMeshOutput(id).GetNewCloneVariant(); CPNSubset subsSet = new CPNSubset(); TessellationOutput output2 = tessellationProcess.InitProcess(cpnet, loqs, subsSet); this.mesh2 = new OutputMesh(outMesh.GetVertices(), outMesh.GetUVs(), outMesh.GetNormals(), outMesh.GetTriangles()); tessellationProcess.WriteMesh(mesh2); }
public void UpdateTessellationItem(short[] loqs, CPNSubset subset = null) { curvedPolyVariants.UpdateTessellationVariant(id, loqs, subset); WriteMesh(storedMesh, curvedPolyVariants.GetMeshOutput(id) /*,useUnityNormals*/); }
public void RecomputeShape(CPNSubset subset = null) { curvedPoly.RecomputeShape(this.lods, this.itemIndex, subset); }
public void RecomputeShape(LoDs lods, int lodsIndex, CPNSubset subset) { meshItemDB.RecomputeShape(lods, lodsIndex, subset); }