19#ifndef HEADER_TERRAIN_INFO_HPP
20#define HEADER_TERRAIN_INFO_HPP
22#include "utils/vec3.hpp"
53 virtual void update(
const btMatrix3x3 &rotation,
const Vec3 &from);
59 virtual void update(
const btMatrix3x3 &rotation)
Definition: material.hpp:48
This class stores information about the triangle that's under an object, i.e.: the normal,...
Definition: terrain_info.hpp:32
Vec3 m_normal
Normal of the triangle under the object.
Definition: terrain_info.hpp:35
virtual void update(const btMatrix3x3 &rotation)
Simple wrapper with no offset.
Definition: terrain_info.hpp:59
const Material * m_material
Material of the triangle under the object.
Definition: terrain_info.hpp:37
Vec3 m_origin_ray
DEBUG only: origin of raycast.
Definition: terrain_info.hpp:44
const Vec3 & getNormal() const
Returns the normal of the terrain the kart is on.
Definition: terrain_info.hpp:75
virtual void update(const btMatrix3x3 &rotation, const Vec3 &from)
Update the terrain information based on the latest position.
Definition: terrain_info.cpp:74
TerrainInfo()
Constructor to initialise terrain data.
Definition: terrain_info.cpp:32
const Material * getMaterial() const
Returns the current material the kart is on.
Definition: terrain_info.hpp:68
float getTerrainPitch(float heading) const
Returns the pitch of the terrain depending on the heading.
Definition: terrain_info.cpp:129
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 somet...
Definition: terrain_info.cpp:118
Vec3 m_hit_point
The point that was hit.
Definition: terrain_info.hpp:41
float getHoT() const
Returns the height of the terrain.
Definition: terrain_info.hpp:65
const btVector3 & getHitPoint() const
Returns the hit point of the raycast.
Definition: terrain_info.hpp:81
const Material * getLastMaterial() const
Returns the previous material the kart was one (which might be the same as getMaterial() ).
Definition: terrain_info.hpp:72
const Material * m_last_material
The previous material a kart was on.
Definition: terrain_info.hpp:39
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35