void Reload() { if (geom != null && !geom.IsDeleted) { geom.Remove(); } if (Node == null || Node.IsDeleted) { return; } geom = Node.CreateComponent <CustomGeometry>(); geom.BeginGeometry(0, PrimitiveType.LineList); var material = new Material(); material.SetTechnique(0, CoreAssets.Techniques.NoTextureUnlitVCol, MaterialQuality.Medium, 1); geom.SetMaterial(material); var halfSize = Size / 2; for (int i = -halfSize; i <= halfSize; i++) { //x geom.DefineVertex(new Vector3(i, 0, -halfSize) * Scale); geom.DefineColor(Color); geom.DefineVertex(new Vector3(i, 0, halfSize) * Scale); geom.DefineColor(Color); //z geom.DefineVertex(new Vector3(-halfSize, 0, i) * Scale); geom.DefineColor(Color); geom.DefineVertex(new Vector3(halfSize, 0, i) * Scale); geom.DefineColor(Color); } geom.Commit(); }
public ConvexData(CustomGeometry custom) { Runtime.Validate(typeof(ConvexData)); }
public GImpactMeshData(CustomGeometry custom) { Runtime.Validate(typeof(GImpactMeshData)); }
public TriangleMeshData(CustomGeometry custom) { Runtime.Validate(typeof(TriangleMeshData)); }