C# Class BEPUphysics.CollisionShapes.TerrainShape

The local space data needed by a Terrain collidable. Contains the Heightmap and other information.
Inheritance: BEPUphysics.CollisionShapes.CollisionShape
Exibir arquivo Open project: Indiefreaks/igf Class Usage Examples

Public Methods

Method Description
GetBoundingBox ( AffineTransform &transform, BoundingBox &boundingBox ) : void

Constructs the bounding box of the terrain given a transform.

GetLocalPosition ( int i, int j, Vector3 &v ) : void

Gets the position of a vertex at the given indices in local space.

GetNormal ( int i, int j, AffineTransform &transform, Vector3 &normal ) : void

Gets the world space normal at the given indices.

GetOverlaps ( BoundingBox localSpaceBoundingBox, RawList overlappedTriangles ) : bool

Gets overlapped triangles with the terrain shape with a bounding box in the local space of the shape.

GetOverlaps ( BoundingBox localBoundingBox, RawList overlappedElements ) : bool

Gets overlapped triangles with the terrain shape with a bounding box in the local space of the shape.

GetPosition ( int i, int j, AffineTransform &transform, Vector3 &position ) : void

Gets the world space position of a vertex in the terrain at the given indices.

GetTriangle ( TriangleMeshConvexContactManifold &indices, AffineTransform &transform, Vector3 &a, Vector3 &b, Vector3 &c ) : void

Gets a world space triangle in the terrain at the given indices (as if it were a mesh).

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

Gets a world space triangle in the terrain at the given triangle index.

RayCast ( Ray &ray, float maximumLength, AffineTransform &transform, RayHit &hit ) : bool

Tests a ray against the terrain shape.

RayCast ( Ray &ray, float maximumLength, AffineTransform &transform, TriangleSidedness sidedness, RayHit &hit ) : bool

Tests a ray against the terrain shape.

TerrainShape ( float heights ) : System

Constructs a TerrainShape.

TerrainShape ( float heights, QuadTriangleOrganization triangleOrganization ) : System

Constructs a TerrainShape.

Method Details

GetBoundingBox() public method

Constructs the bounding box of the terrain given a transform.
public GetBoundingBox ( AffineTransform &transform, BoundingBox &boundingBox ) : void
transform BEPUutilities.AffineTransform Transform to apply to the terrain during the bounding box calculation.
boundingBox BoundingBox Bounding box of the terrain shape when transformed.
return void

GetLocalPosition() public method

Gets the position of a vertex at the given indices in local space.
public GetLocalPosition ( int i, int j, Vector3 &v ) : void
i int Index in the first dimension.
j int Index in the second dimension.
v Vector3 Local space position at the given vertice.s
return void

GetNormal() public method

Gets the world space normal at the given indices.
public GetNormal ( int i, int j, AffineTransform &transform, Vector3 &normal ) : void
i int Index in the first dimension.
j int Index in the second dimension.
transform BEPUutilities.AffineTransform Transform to apply to the terrain while computing the normal.
normal Vector3 World space normal at the given indices.
return void

GetOverlaps() public method

Gets overlapped triangles with the terrain shape with a bounding box in the local space of the shape.
public GetOverlaps ( BoundingBox localSpaceBoundingBox, RawList overlappedTriangles ) : bool
localSpaceBoundingBox BoundingBox Bounding box in the local space of the terrain shape.
overlappedTriangles RawList Triangles whose bounding boxes overlap the input bounding box.
return bool

GetOverlaps() public method

Gets overlapped triangles with the terrain shape with a bounding box in the local space of the shape.
public GetOverlaps ( BoundingBox localBoundingBox, RawList overlappedElements ) : bool
localBoundingBox BoundingBox Bounding box in the local space of the terrain shape.
overlappedElements RawList Indices of elements whose bounding boxes overlap the input bounding box.
return bool

GetPosition() public method

Gets the world space position of a vertex in the terrain at the given indices.
public GetPosition ( int i, int j, AffineTransform &transform, Vector3 &position ) : void
i int Index in the first dimension.
j int Index in the second dimension.
transform BEPUutilities.AffineTransform Transform to apply to the vertex.
position Vector3 Transformed position of the vertex at the given indices.
return void

GetTriangle() public method

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.
return void

GetTriangle() public method

Gets a world space triangle in the terrain at the given triangle index.
public GetTriangle ( int index, AffineTransform &transform, Vector3 &a, Vector3 &b, Vector3 &c ) : void
index int Index of the triangle.
transform 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.
return void

RayCast() public method

Tests a ray against the terrain shape.
public RayCast ( Ray &ray, float maximumLength, AffineTransform &transform, RayHit &hit ) : bool
ray Ray Ray to test against the shape.
maximumLength float Maximum length of the ray in units of the ray direction's length.
transform AffineTransform Transform to apply to the terrain shape during the test.
hit RayHit Hit data of the ray cast, if any.
return bool

RayCast() public method

Tests a ray against the terrain shape.
public RayCast ( Ray &ray, float maximumLength, AffineTransform &transform, TriangleSidedness sidedness, RayHit &hit ) : bool
ray Ray Ray to test against the shape.
maximumLength float Maximum length of the ray in units of the ray direction's length.
transform AffineTransform Transform to apply to the terrain shape during the test.
sidedness TriangleSidedness Sidedness of the triangles to use when raycasting.
hit RayHit Hit data of the ray cast, if any.
return bool

TerrainShape() public method

Constructs a TerrainShape.
public TerrainShape ( float heights ) : System
heights float Heights array used for the shape.
return System

TerrainShape() public method

Constructs a TerrainShape.
Thrown if the heights array has less than 2x2 vertices.
public TerrainShape ( float heights, QuadTriangleOrganization triangleOrganization ) : System
heights float Heights array used for the shape.
triangleOrganization QuadTriangleOrganization Triangle organization of each quad.
return System