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/HeightField.h>
Public Types | |
enum class | HeightDataType { HEIGHT_FLOAT_TYPE , HEIGHT_DOUBLE_TYPE , HEIGHT_INT_TYPE } |
Data type for the height data of the height field. | |
Public Member Functions | |
HeightField (const HeightField &heightField)=delete | |
Deleted copy-constructor. | |
HeightField & | operator= (const HeightField &heightField)=delete |
Deleted assignment operator. | |
uint32 | getNbRows () const |
Return the number of rows in the height-field (along the local x direction) | |
uint32 | getNbColumns () const |
Return the number of columns in the height-field (along the local z direction) | |
decimal | getMinHeight () const |
Return the minimum height value of the height-field | |
decimal | getMaxHeight () const |
Return the maximum height value of the height-field. | |
decimal | getIntegerHeightScale () const |
Return the integer height scale | |
Vector3 | getVertexAt (uint32 x, uint32 y) const |
Return the vertex (local-coordinates) of the height-field at a given (x,y) position. | |
decimal | getHeightAt (uint32 x, uint32 y) const |
Return the height value of a given (x,y) point in the height-field (in local-space) | |
HeightDataType | getHeightDataType () const |
Return the type of height value in the height-field. | |
const AABB & | getBounds () const |
Return the minimum bounds of the height-field in the x,y,z direction. | |
std::string | to_string () const |
Return the string representation of the shape. | |
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 copied into the shape. The height values can be of type integer, float or double. Note that the HeightField 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.
RP3D_FORCE_INLINE const AABB & reactphysics3d::HeightField::getBounds | ( | ) | const |
Return the minimum bounds of the height-field in the x,y,z direction.
RP3D_FORCE_INLINE decimal reactphysics3d::HeightField::getIntegerHeightScale | ( | ) | const |
Return the integer height scale
RP3D_FORCE_INLINE decimal reactphysics3d::HeightField::getMaxHeight | ( | ) | const |
Return the maximum height value of the height-field.
RP3D_FORCE_INLINE decimal reactphysics3d::HeightField::getMinHeight | ( | ) | const |
Return the minimum height value of the height-field
RP3D_FORCE_INLINE uint32 reactphysics3d::HeightField::getNbColumns | ( | ) | const |
Return the number of columns in the height-field (along the local z direction)
RP3D_FORCE_INLINE uint32 reactphysics3d::HeightField::getNbRows | ( | ) | const |
Return the number of rows in the height-field (along the local x direction)