ReactPhysics3D
v0.10.2
C++ Physics engine library
|
This class represents a static height field that can be used to represent a terrain. More...
#include <include/reactphysics3d/collision/shapes/HeightFieldShape.h>
Public Member Functions | |
HeightFieldShape (const HeightFieldShape &shape)=delete | |
Deleted copy-constructor. | |
HeightFieldShape & | operator= (const HeightFieldShape &shape)=delete |
Deleted assignment operator. | |
HeightField * | getHeightField () const |
Return a pointer to the internal height-field | |
Vector3 | getVertexAt (uint32 x, uint32 y) const |
Return the vertex (local-coordinates) of the height field at a given (x,y) position. | |
virtual AABB | getLocalBounds () const override |
Return the local bounds of the shape in x, y and z directions. | |
virtual void | computeOverlappingTriangles (const AABB &localAABB, Array< Vector3 > &triangleVertices, Array< Vector3 > &triangleVerticesNormals, Array< uint32 > &shapeIds, MemoryAllocator &allocator) const override |
Use a callback method on all triangles of the concave shape inside a given AABB. | |
virtual std::string | to_string () const override |
Return the string representation of the shape. | |
Public Member Functions inherited from reactphysics3d::ConcaveShape | |
ConcaveShape (CollisionShapeName name, MemoryAllocator &allocator, const Vector3 &scaling) | |
Constructor. | |
virtual | ~ConcaveShape () override=default |
Destructor. | |
ConcaveShape (const ConcaveShape &shape)=delete | |
Deleted copy-constructor. | |
ConcaveShape & | operator= (const ConcaveShape &shape)=delete |
Deleted assignment operator. | |
TriangleRaycastSide | getRaycastTestType () const |
Return the raycast test type (front, back, front-back) | |
void | setRaycastTestType (TriangleRaycastSide testType) |
const Vector3 & | getScale () const |
Return the scale of the shape. | |
virtual void | setScale (const Vector3 &scale) |
Set the scale of the shape. | |
virtual Vector3 | getLocalInertiaTensor (decimal mass) const override |
Return the local inertia tensor of the collision shape. | |
virtual bool | isConvex () const override |
Return true if the collision shape is convex, false if it is concave. | |
virtual bool | isPolyhedron () const override |
Return true if the collision shape is a polyhedron. | |
virtual decimal | getVolume () const override |
Compute and return the volume of the collision shape. | |
Public Member Functions inherited from reactphysics3d::CollisionShape | |
CollisionShape (CollisionShapeName name, CollisionShapeType type, MemoryAllocator &allocator) | |
Constructor. | |
virtual | ~CollisionShape ()=default |
Destructor. | |
CollisionShape (const CollisionShape &shape)=delete | |
Deleted copy-constructor. | |
CollisionShape & | operator= (const CollisionShape &shape)=delete |
Deleted assignment operator. | |
CollisionShapeName | getName () const |
Return the name of the collision shape. | |
CollisionShapeType | getType () const |
Return the type of the collision shape. | |
uint32 | getId () const |
Return the id of the shape. | |
virtual AABB | computeTransformedAABB (const Transform &transform) const |
Compute the transformed AABB of the collision shape given a transform. | |
This class represents a static height field that can be used to represent a terrain.
The height field is made of a grid with rows and columns with a height value at each grid point. Note that the height values are not copied into the shape but are shared instead. The height values can be of type integer, float or double. When creating a HeightFieldShape, you need to specify the minimum and maximum height value of your height field. Note that the HeightFieldShape will be re-centered based on its AABB. It means that for instance, if the minimum height value is -200 and the maximum value is 400, the final minimum height of the field in the simulation will be -300 and the maximum height will be 300.
|
overridevirtual |
Use a callback method on all triangles of the concave shape inside a given AABB.
Implements reactphysics3d::ConcaveShape.
|
overridevirtual |
Return the local bounds of the shape in x, y and z directions.
Implements reactphysics3d::CollisionShape.
|
overridevirtual |
Return the string representation of the shape.
Implements reactphysics3d::CollisionShape.