SuperTuxKart
|
This class is used to enable a shadow for a kart. More...
#include <shadow.hpp>
Public Member Functions | |
Shadow (Material *shadow_mat, const AbstractKart &kart) | |
void | update (bool enabled) |
Updates the simulated shadow. | |
Private Attributes | |
std::shared_ptr< SP::SPDynamicDrawCall > | m_dy_dc |
The dynamic draw call of the shadow. | |
irr::scene::IMeshSceneNode * | m_node |
bool | m_shadow_enabled |
If a kart is flying, the shadow is disabled (since it is stuck to the kart, i.e. | |
const AbstractKart & | m_kart |
A read-only kart object for accessing suspension length. | |
This class is used to enable a shadow for a kart.
For now it uses a simple texture to simulate the shadow, real time shadows might be added later.
void Shadow::update | ( | bool | enabled | ) |
Updates the simulated shadow.
It takes the 4 suspension lengths of vehicle from ground to position the shadow quad exactly on the ground. It also disables the shadow if requested (e.g. if the kart is in the air).
enabled | If the shadow should be shown or not. |
|
private |
If a kart is flying, the shadow is disabled (since it is stuck to the kart, i.e.
the shadow would be flying, too).