Пример #1
0
        public IGImpactMeshShapeImp AddGImpactMeshShape(int[] meshTriangles, float3[] meshVertices)
        {
            Vector3[] btMeshVertices = new Vector3[meshVertices.Length];
            for (int i = 0; i < meshVertices.Length; i++)
            {
                btMeshVertices[i].X = meshVertices[i].x;
                btMeshVertices[i].Y = meshVertices[i].y;
                btMeshVertices[i].Z = meshVertices[i].z;
            }
            var btTriangleIndexVertexArray = new TriangleIndexVertexArray(meshTriangles, btMeshVertices);
            var btGimpactMeshShape         = new GImpactMeshShape(btTriangleIndexVertexArray);

            btGimpactMeshShape.UpdateBound();
            BtCollisionShapes.Add(btGimpactMeshShape);
            var retval = new GImpactMeshShapeImp();

            retval.BtGImpactMeshShape     = btGimpactMeshShape;
            btGimpactMeshShape.UserObject = retval;
            return(retval);
        }
 public IGImpactMeshShapeImp AddGImpactMeshShape(int[] meshTriangles, float3[] meshVertices)
 {
     Vector3[] btMeshVertices = new Vector3[meshVertices.Length];
     for (int i = 0; i < meshVertices.Length; i++)
     {
         btMeshVertices[i].X = meshVertices[i].x;
         btMeshVertices[i].Y = meshVertices[i].y;
         btMeshVertices[i].Z = meshVertices[i].z;
     }
     var btTriangleIndexVertexArray = new TriangleIndexVertexArray(meshTriangles, btMeshVertices);
     var btGimpactMeshShape = new GImpactMeshShape(btTriangleIndexVertexArray);
     btGimpactMeshShape.UpdateBound();
     BtCollisionShapes.Add(btGimpactMeshShape);
     var retval = new GImpactMeshShapeImp();
     retval.BtGImpactMeshShape = btGimpactMeshShape;
     btGimpactMeshShape.UserObject = retval;
     return retval;
 }