SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Shadow Class Reference

This class is used to enable a shadow for a kart. More...

#include <shadow.hpp>

Inheritance diagram for Shadow:
Inheritance graph
[legend]

Public Member Functions

 Shadow (Material *shadow_mat, const AbstractKart &kart)
 
void update (bool enabled)
 Updates the simulated shadow.
 

Private Attributes

std::shared_ptr< SP::SPDynamicDrawCallm_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 AbstractKartm_kart
 A read-only kart object for accessing suspension length.
 

Detailed Description

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.

Member Function Documentation

◆ update()

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).

Parameters
enabledIf the shadow should be shown or not.

Member Data Documentation

◆ m_shadow_enabled

bool Shadow::m_shadow_enabled
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).


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