This class stores information about the triangle that's under an object, i.e.: the normal, a pointer to the material, and the height above th.
More...
#include <terrain_info.hpp>
|
| TerrainInfo () |
| Constructor to initialise terrain data.
|
|
| TerrainInfo (const Vec3 &pos) |
| Constructor to initialise terrain data at a given position.
|
|
bool | getSurfaceInfo (const Vec3 &from, Vec3 *position, const Material **m) |
| Does a raycast upwards from the given position If the raycast indicated that the kart is 'under something' (i.e.
|
|
virtual void | update (const btMatrix3x3 &rotation, const Vec3 &from) |
| Update the terrain information based on the latest position.
|
|
virtual void | update (const Vec3 &from) |
| Update the terrain information based on the latest position.
|
|
virtual void | update (const Vec3 &from, const Vec3 &towards) |
| Update the terrain information based on the latest position.
|
|
virtual void | update (const btMatrix3x3 &rotation) |
| Simple wrapper with no offset.
|
|
float | getHoT () const |
| Returns the height of the terrain.
|
|
const Material * | getMaterial () const |
| Returns the current material the kart is on.
|
|
const Material * | getLastMaterial () const |
| Returns the previous material the kart was one (which might be the same as getMaterial() ).
|
|
const Vec3 & | getNormal () const |
| Returns the normal of the terrain the kart is on.
|
|
float | getTerrainPitch (float heading) const |
| Returns the pitch of the terrain depending on the heading.
|
|
const btVector3 & | getHitPoint () const |
| Returns the hit point of the raycast.
|
|
const Vec3 & | getOrigin () const |
|
|
Vec3 | m_normal |
| Normal of the triangle under the object.
|
|
const Material * | m_material |
| Material of the triangle under the object.
|
|
const Material * | m_last_material |
| The previous material a kart was on.
|
|
Vec3 | m_hit_point |
| The point that was hit.
|
|
Vec3 | m_origin_ray |
| DEBUG only: origin of raycast.
|
|
This class stores information about the triangle that's under an object, i.e.: the normal, a pointer to the material, and the height above th.
◆ TerrainInfo()
TerrainInfo::TerrainInfo |
( |
const Vec3 & |
pos | ) |
|
Constructor to initialise terrain data at a given position.
- Parameters
-
pos | The position to get the data from. |
◆ getHoT()
float TerrainInfo::getHoT |
( |
| ) |
const |
|
inline |
Returns the height of the terrain.
we're currently above
◆ getSurfaceInfo()
bool TerrainInfo::getSurfaceInfo |
( |
const Vec3 & |
from, |
|
|
Vec3 * |
position, |
|
|
const Material ** |
material |
|
) |
| |
Does a raycast upwards from the given position If the raycast indicated that the kart is 'under something' (i.e.
a specially marked terrain), to another raycast up to detect under whic mesh the kart is. This is using the special gfx effect mesh only. This is used e.g. to detect if a kart is under water, and then to get the proper position for water effects. Note that the TerrainInfo objects keeps track of the previous raycast position.
◆ update() [1/3]
void TerrainInfo::update |
( |
const btMatrix3x3 & |
rotation, |
|
|
const Vec3 & |
from |
|
) |
| |
|
virtual |
Update the terrain information based on the latest position.
- Parameters
-
tran | The transform ov the kart |
from | World coordinates from which to start the raycast. |
◆ update() [2/3]
void TerrainInfo::update |
( |
const Vec3 & |
from | ) |
|
|
virtual |
Update the terrain information based on the latest position.
- Parameters
-
Position | from which to start the raycast from. |
◆ update() [3/3]
void TerrainInfo::update |
( |
const Vec3 & |
from, |
|
|
const Vec3 & |
towards |
|
) |
| |
|
virtual |
Update the terrain information based on the latest position.
- Parameters
-
Position | from which to start the rayast from. |
The documentation for this class was generated from the following files: