Tinman  1.0
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
Car Class Reference

#include <car.h>

Inheritance diagram for Car:
Inheritance graph
[legend]
Collaboration diagram for Car:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< Carshared
 

Public Member Functions

 Car (std::string nick)
 
virtual ~Car ()
 
void realize (Scene::shared scene, std::string name, std::string material, Ogre::Vector3 position, int scale)
 
void realize (Physics::shared physics, Scene::shared scene, Sound::shared sound, std::string name, btVector3 position, std::string material, int checkpoints, Ice::Byte id)
 
void realize (Physics::shared physics, Sound::shared sound, std::string name, btVector3 position, Ice::Byte id)
 
void exec (Tinman::Action action)
 
void accelerate ()
 
void use_nitro ()
 
void stop_accelerating ()
 
void brake ()
 
void stop_braking ()
 
void turn (Direction direction)
 
void turn_right ()
 
void turn_left ()
 
void stop_turning ()
 
void update (float delta)
 
void synchronize (Tinman::CarInfo last_update)
 
int get_nitro ()
 
int get_lap ()
 
btVector3 get_position ()
 
btVector3 get_velocity ()
 
btQuaternion get_orientation ()
 
btVector3 get_direction (int factor=1)
 
btScalar get_speed ()
 
Section get_current_section ()
 
void set_position (btVector3 position)
 
void set_race_segment_info (Section segment)
 
void reset (int checkpoints, btVector3 position)
 
void collide_with_car ()
 
void animation (float delta)
 
bool is_colliding ()
 
bool is_stuck ()
 
void invert_direction ()
 

Public Attributes

CarController::shared controller_
 
int race_position_
 
Ice::Byte id_
 
int lap_
 
Ogre::SceneNode * chassis_node_
 
btRigidBody * chassis_body_
 
Section current_segment_
 
bool colliding_
 
bool stuck_
 

Private Member Functions

void init_graphic_bodies (Scene::shared scene, std::string name, std::string, Ogre::Vector3 position=Ogre::Vector3(0, 0, 0), int scale=1)
 
void init_physic_bodies (Physics::shared physics, btVector3 position)
 
void init_raycast_car (Physics::shared physics)
 
void add_graphic_wheel (Scene::shared scene, std::string parent, std::string name, int scale=1)
 
void add_physic_wheel (bool is_front, btVector3 connection_point, int wheel_index)
 
void add_nick_billboard (Scene::shared scene)
 
void add_wheels ()
 
void configure_wheels ()
 
void turn_wheels (Direction direction)
 
void control_speed ()
 
void reset_position ()
 
void apply_update (bool delete_update)
 
void update_lap ()
 
bool not_moving ()
 
bool is_on_meta ()
 
bool has_done_a_lap ()
 
void add_lap ()
 

Private Attributes

Sound::shared sound_
 
Physics::shared physics_
 
std::map< Tinman::Action, std::function< void()> > action_hooks
 
const btQuaternion initial_rotation_ = btQuaternion(btVector3(0, 1, 0), btScalar(80))
 
btVector3 initial_position_
 
unsigned int sections_covered_
 
bool accelerating_
 
Tinman::CarInfo last_update_
 
std::string nick_
 
ObjectTextDisplaynickname_display_
 
float invert_direction_
 
float not_moving_
 
float colliding_time_
 
bool can_collide_
 
const float invert_direction_delay_ = 0.48f
 
const int not_moving_delay_ = 0.48f
 
const int colliding_delay_ = 0.48f
 
std::priority_queue< Tinman::CarInfo, std::vector< Tinman::CarInfo >, lower_thansync_buffer_
 
std::vector< std::pair< int, bool > > checkpoints_
 
btCompoundShape * compound_
 
btAlignedObjectArray< btCollisionShape * > collision_shapes_
 
btRaycastVehicle::btVehicleTuning tuning_
 
btVehicleRaycaster * vehicle_raycaster_
 
btRaycastVehicle * vehicle_
 
btCollisionShape * wheel_shape_
 
Ogre::Entity * chassis_entity_
 
std::vector< Ogre::SceneNode * > wheels_nodes_
 
std::vector< Ogre::Entity * > wheels_entities_
 
btVector3 last_position_
 
btVector3 last_velocity_
 
btQuaternion last_orientation_
 

Member Typedef Documentation

typedef std::shared_ptr<Car> Car::shared

Constructor & Destructor Documentation

Car::Car ( std::string  nick)
Car::~Car ( )
virtual

Member Function Documentation

void Car::accelerate ( )
void Car::add_graphic_wheel ( Scene::shared  scene,
std::string  parent,
std::string  name,
int  scale = 1 
)
private
void Car::add_lap ( )
private
void Car::add_nick_billboard ( Scene::shared  scene)
private
void Car::add_physic_wheel ( bool  is_front,
btVector3  connection_point,
int  wheel_index 
)
private
void Car::add_wheels ( )
private
void Car::animation ( float  delta)
void Car::apply_update ( bool  delete_update)
private
void Car::brake ( )
void Car::collide_with_car ( )
void Car::configure_wheels ( )
private
void Car::control_speed ( )
private
void Car::exec ( Tinman::Action  action)
Section Car::get_current_section ( )
btVector3 Car::get_direction ( int  factor = 1)
int Car::get_lap ( )
int Car::get_nitro ( )
btQuaternion Car::get_orientation ( )
btVector3 Car::get_position ( )
btScalar Car::get_speed ( )
btVector3 Car::get_velocity ( )
bool Car::has_done_a_lap ( )
private
void Car::init_graphic_bodies ( Scene::shared  scene,
std::string  name,
std::string  material,
Ogre::Vector3  position = Ogre::Vector3(0,0,0),
int  scale = 1 
)
private
void Car::init_physic_bodies ( Physics::shared  physics,
btVector3  position 
)
private
void Car::init_raycast_car ( Physics::shared  physics)
private
void Car::invert_direction ( )
bool Car::is_colliding ( )
bool Car::is_on_meta ( )
private
bool Car::is_stuck ( )
bool Car::not_moving ( )
private
void Car::realize ( Scene::shared  scene,
std::string  name,
std::string  material,
Ogre::Vector3  position,
int  scale 
)
void Car::realize ( Physics::shared  physics,
Scene::shared  scene,
Sound::shared  sound,
std::string  name,
btVector3  position,
std::string  material,
int  checkpoints,
Ice::Byte  id 
)
void Car::realize ( Physics::shared  physics,
Sound::shared  sound,
std::string  name,
btVector3  position,
Ice::Byte  id 
)
void Car::reset ( int  checkpoints,
btVector3  position 
)
void Car::reset_position ( )
private
void Car::set_position ( btVector3  position)
void Car::set_race_segment_info ( Section  segment)
void Car::stop_accelerating ( )
void Car::stop_braking ( )
void Car::stop_turning ( )
void Car::synchronize ( Tinman::CarInfo  last_update)
void Car::turn ( Direction  direction)
void Car::turn_left ( )
void Car::turn_right ( )
void Car::turn_wheels ( Direction  direction)
private
void Car::update ( float  delta)
void Car::update_lap ( )
private
void Car::use_nitro ( )

Member Data Documentation

bool Car::accelerating_
private
std::map<Tinman::Action, std::function<void()> > Car::action_hooks
private
bool Car::can_collide_
private
btRigidBody* Car::chassis_body_
Ogre::Entity* Car::chassis_entity_
private
Ogre::SceneNode* Car::chassis_node_
std::vector<std::pair<int, bool> > Car::checkpoints_
private
bool Car::colliding_
const int Car::colliding_delay_ = 0.48f
private
float Car::colliding_time_
private
btAlignedObjectArray<btCollisionShape*> Car::collision_shapes_
private
btCompoundShape* Car::compound_
private
CarController::shared Car::controller_
Section Car::current_segment_
Ice::Byte Car::id_
btVector3 Car::initial_position_
private
const btQuaternion Car::initial_rotation_ = btQuaternion(btVector3(0, 1, 0), btScalar(80))
private
float Car::invert_direction_
private
const float Car::invert_direction_delay_ = 0.48f
private
int Car::lap_
btQuaternion Car::last_orientation_
private
btVector3 Car::last_position_
private
Tinman::CarInfo Car::last_update_
private
btVector3 Car::last_velocity_
private
std::string Car::nick_
private
ObjectTextDisplay* Car::nickname_display_
private
float Car::not_moving_
private
const int Car::not_moving_delay_ = 0.48f
private
Physics::shared Car::physics_
private
int Car::race_position_
unsigned int Car::sections_covered_
private
Sound::shared Car::sound_
private
bool Car::stuck_
std::priority_queue<Tinman::CarInfo, std::vector<Tinman::CarInfo>, lower_than> Car::sync_buffer_
private
btRaycastVehicle::btVehicleTuning Car::tuning_
private
btRaycastVehicle* Car::vehicle_
private
btVehicleRaycaster* Car::vehicle_raycaster_
private
btCollisionShape* Car::wheel_shape_
private
std::vector<Ogre::Entity*> Car::wheels_entities_
private
std::vector<Ogre::SceneNode*> Car::wheels_nodes_
private

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