ReactPhysics3D  v0.10.2
C++ Physics engine library
Loading...
Searching...
No Matches
reactphysics3d::HeightField Class Reference

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.
 
HeightFieldoperator= (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 AABBgetBounds () 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.
 

Detailed Description

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.

Member Function Documentation

◆ getBounds()

RP3D_FORCE_INLINE const AABB & reactphysics3d::HeightField::getBounds ( ) const

Return the minimum bounds of the height-field in the x,y,z direction.

Returns
The three mimimum bounds of the height-field in the x,y,z direction

◆ getIntegerHeightScale()

RP3D_FORCE_INLINE decimal reactphysics3d::HeightField::getIntegerHeightScale ( ) const

 Return the integer height scale

Returns
The integer height scale

◆ getMaxHeight()

RP3D_FORCE_INLINE decimal reactphysics3d::HeightField::getMaxHeight ( ) const

Return the maximum height value of the height-field.

Returns
The maximum height value of the height-field

◆ getMinHeight()

RP3D_FORCE_INLINE decimal reactphysics3d::HeightField::getMinHeight ( ) const

 Return the minimum height value of the height-field

Returns
The mimimum height value of the height-field

◆ getNbColumns()

RP3D_FORCE_INLINE uint32 reactphysics3d::HeightField::getNbColumns ( ) const

Return the number of columns in the height-field (along the local z direction)

Returns
The number of columns of the grid (along z direction)

◆ getNbRows()

RP3D_FORCE_INLINE uint32 reactphysics3d::HeightField::getNbRows ( ) const

Return the number of rows in the height-field (along the local x direction)

Returns
The number of rows of the grid (along x direction)

The documentation for this class was generated from the following files: