本文整理汇总了C#中Geometry.FixVertex方法的典型用法代码示例。如果您正苦于以下问题:C# Geometry.FixVertex方法的具体用法?C# Geometry.FixVertex怎么用?C# Geometry.FixVertex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geometry
的用法示例。
在下文中一共展示了Geometry.FixVertex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetLevel
//.........这里部分代码省略.........
case 9:
earth.GetComponent<MeshFilter>().mesh = sphere2;
SetTexture(7);
source = 42;
manPos = 775;
break;
case 11:
earth.GetComponent<MeshFilter>().mesh = hemisphere;
SetTexture(7);
source = 1331;
manPos = 475;
break;
case 12:
earth.GetComponent<MeshFilter>().mesh = skull;
SetTexture(8);
source = 5794;
manPos = 781;
break;
case 10:
earth.GetComponent<MeshFilter>().mesh = dragon;
SetTexture(6);
source = 7561;
manPos = 7284;
break;
}
roadBase.SetActive(level == 5);
hemiCap.SetActive(level == 11);
skullBase.SetActive(level == 12);
fire.gameObject.SetActive(level == 10);
// Adjust settings
if (useDefaultSettings) {
Settings.tFactor = tFactor;
Settings.defaultSource = new List<int>();
Settings.defaultSource.Add(source);
Settings.initialManPos = manPos;
inputT.text = Settings.tFactor.ToString();
} else {
Settings.defaultSource = new List<int>();
foreach (Vertex sourceVertex in hg.s) {
Settings.defaultSource.Add(sourceVertex.index);
}
Settings.initialManPos = man.coord.triangle.index;
}
// Set collider to detect mouse hit
earth.GetComponent<MeshCollider>().sharedMesh = earth.GetComponent<MeshFilter>().mesh;
// Build geometry data
g = new Geometry(earth.GetComponent<MeshFilter>().mesh);
if (level == 6) {
// Fix certain broken triangles for the triceratops
g.FixVertex(758);
g.FixVertex(295);
g.FixVertex(395);
g.FixVertex(2449);
}
// Start heat method
hg = new HeatGeodesics(g, Settings.useCholesky, Settings.useAccurateMultisource);
hg.Initialize();
List<Vertex> sources = new List<Vertex>();
foreach (int ind in Settings.defaultSource) {
sources.Add(g.vertices[ind]);
lastClickedVertex = g.vertices[ind];
}
hg.CalculateGeodesics(sources);
// Spawn the little man
if (man.isActiveAndEnabled) {
man.GetReady(g, hg, g.faces[Settings.initialManPos]);
}
// Put the mark at the source vertices
if (useDefaultSettings) {
foreach (GameObject oldPin in pins) {
Destroy(oldPin);
}
pins.Clear();
foreach (int ind in Settings.defaultSource) {
GameObject newPin = Instantiate(pin);
pins.Add(newPin);
newPin.transform.position = g.vertices[ind].p;
newPin.transform.rotation = Quaternion.LookRotation(g.vertices[ind].CalculateNormalTri());
}
}
// Update counter
triangleCounter.text = "Triangle Count = " + g.faces.Count;
if (visualState != 0) {
if (useDefaultSettings) {
VisualizeGradient(visualState == 2);
} else {
UpdateVisualGradient();
}
}
}