BEPUphysics.CollisionShapes.TerrainShape.GetTriangle C# (CSharp) Méthode

GetTriangle() public méthode

Gets a world space triangle in the terrain at the given indices (as if it were a mesh).
public GetTriangle ( TriangleMeshConvexContactManifold &indices, AffineTransform &transform, Vector3 &a, Vector3 &b, Vector3 &c ) : void
indices TriangleMeshConvexContactManifold Indices of the triangle.
transform BEPUutilities.AffineTransform Transform to apply to the triangle vertices.
a Vector3 First vertex of the triangle.
b Vector3 Second vertex of the triangle.
c Vector3 Third vertex of the triangle.
Résultat void
        public void GetTriangle(ref TriangleMeshConvexContactManifold.TriangleIndices indices, ref AffineTransform transform, out Vector3 a, out Vector3 b, out Vector3 c)
        {
            //Reverse the encoded index:
            //index = i + width * j
            int width = heights.GetLength(0);
            int columnA = indices.A / width;
            int rowA = indices.A - columnA * width;
            int columnB = indices.B / width;
            int rowB = indices.B - columnB * width;
            int columnC = indices.C / width;
            int rowC = indices.C - columnC * width;
            GetPosition(rowA, columnA, ref transform, out a);
            GetPosition(rowB, columnB, ref transform, out b);
            GetPosition(rowC, columnC, ref transform, out c);
        }

Same methods

TerrainShape::GetTriangle ( int index, AffineTransform &transform, Vector3 &a, Vector3 &b, Vector3 &c ) : void