예제 #1
0
파일: WirePlane.cs 프로젝트: sweep3r/urho
        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();
        }
예제 #2
0
파일: ConvexData.cs 프로젝트: sami1971/urho
 public ConvexData(CustomGeometry custom)
 {
     Runtime.Validate(typeof(ConvexData));
 }
예제 #3
0
 public GImpactMeshData(CustomGeometry custom)
 {
     Runtime.Validate(typeof(GImpactMeshData));
 }
예제 #4
0
 public TriangleMeshData(CustomGeometry custom)
 {
     Runtime.Validate(typeof(TriangleMeshData));
 }