Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 public ConvexData(CustomGeometry custom)
 {
     Runtime.Validate(typeof(ConvexData));
 }
Ejemplo n.º 3
0
 public GImpactMeshData(CustomGeometry custom)
 {
     Runtime.Validate(typeof(GImpactMeshData));
 }
Ejemplo n.º 4
0
 public TriangleMeshData(CustomGeometry custom)
 {
     Runtime.Validate(typeof(TriangleMeshData));
 }