Track::Segment Class Reference

A small, distortable, part of the track with a mesh for graphics, AI navigation, the walls for the physics engine and the floors for the physics engine. More...

#include <Segment.h>

List of all members.

Public Member Functions

 Segment (std::istream &source)
virtual ~Segment ()
const std::string & get_name () const
 Get the human-readable name.
std::size_t get_number_of_connections () const
 Get the number of joins that are used to connect these segments to others.
const SegmentConnectionget_connection (std::size_t index) const
 Get segment connection information.
const SegmentConnectionget_connection (std::size_t index, PieceDistortion piece_distortion) const
 Get where the connection would be if the face was distoreted.
const TrackMesh< DrawableMesh > & get_graphics_mesh () const
 Get the TrackMesh used for the graphics.
const TrackMeshget_ai_mesh () const
 Get the TrackMesh used for the ai's floor navigation.
const TrackMeshget_floor_mesh () const
 Get the TrackMesh used for the floor's physics.
const TrackMeshget_wall_mesh () const
 Get the TrackMesh used for the wall's physics.
btScalar get_length () const
 Get the length of the segment's physics floor mesh in the y direction.
btScalar get_minimum_y () const
 Get the lowest y position of the vertices in the physics floor mesh.
const Textureget_texture () const
 Get the texture to bind before drawing the graphics_mesh.
bool edges_allowed () const
 Return true if the mesh could be used along an edge.

Protected Attributes

Texture texture
TrackMesh< DrawableMeshgraphics_mesh
TrackMesh ai_floor_mesh
TrackMesh physics_wall_mesh
TrackMesh physics_floor_mesh
std::string name
 The human-readable name. Taken from blender scene the segment came from.
std::vector< boost::shared_ptr<
SegmentConnection > > 
connections
 (undistorted) cross section connections information
bool m_edges_allowed
 True if good for edges, false otherwise.


Detailed Description

A small, distortable, part of the track with a mesh for graphics, AI navigation, the walls for the physics engine and the floors for the physics engine.

A Segment knows how it can be connected with other segments to form the track. The mesh is cut off into 'tiles' with any number of planar ends to be connected to matching planar ends.

Definition at line 38 of file Segment.h.


Constructor & Destructor Documentation

Track::Segment::Segment ( std::istream &  source  ) 

Definition at line 17 of file Segment.cpp.

Track::Segment::~Segment (  )  [virtual]

Definition at line 53 of file Segment.cpp.


Member Function Documentation

bool Track::Segment::edges_allowed (  )  const

Return true if the mesh could be used along an edge.

Definition at line 108 of file Segment.cpp.

const TrackMesh & Track::Segment::get_ai_mesh (  )  const

Get the TrackMesh used for the ai's floor navigation.

Definition at line 77 of file Segment.cpp.

const SegmentConnection& Track::Segment::get_connection ( std::size_t  index,
PieceDistortion  piece_distortion 
) const

Get where the connection would be if the face was distoreted.

Similar to get_connection.

Parameters:
piece_distortion The distortion to apply to the connection information.
index The 0-based index of the connection to return the information for.
Returns:
Connectivity information for the distorted piece.

const SegmentConnection & Track::Segment::get_connection ( std::size_t  index  )  const

Get segment connection information.

A segment defines cross sections at the entry and exit points that must be connected to something with a matching cross section to form a valid track layout. This function returns the information one cross section per call.

Parameters:
index The index from 0 to one less than the number returned by get_number_of_connections() of the connectivity information to store.
Returns:
Information required to determine connectivity for the requested index.

Definition at line 67 of file Segment.cpp.

const TrackMesh & Track::Segment::get_floor_mesh (  )  const

Get the TrackMesh used for the floor's physics.

This is the part you can drive on as seen by the physics engine.

Definition at line 82 of file Segment.cpp.

const TrackMesh< DrawableMesh > & Track::Segment::get_graphics_mesh (  )  const

Get the TrackMesh used for the graphics.

Definition at line 72 of file Segment.cpp.

btScalar Track::Segment::get_length (  )  const

Get the length of the segment's physics floor mesh in the y direction.

Definition at line 92 of file Segment.cpp.

btScalar Track::Segment::get_minimum_y (  )  const

Get the lowest y position of the vertices in the physics floor mesh.

Definition at line 97 of file Segment.cpp.

const std::string & Track::Segment::get_name (  )  const

Get the human-readable name.

This name is taken from the object names in Blender when the theme is exported, and displayed to the users of racer_editor.

Definition at line 57 of file Segment.cpp.

std::size_t Track::Segment::get_number_of_connections (  )  const

Get the number of joins that are used to connect these segments to others.

Definition at line 62 of file Segment.cpp.

const Texture & Track::Segment::get_texture (  )  const

Get the texture to bind before drawing the graphics_mesh.

Definition at line 103 of file Segment.cpp.

const TrackMesh & Track::Segment::get_wall_mesh (  )  const

Get the TrackMesh used for the wall's physics.

This is the part you can collide with, but not drive on, as seen by the physics engine.

Definition at line 87 of file Segment.cpp.


Member Data Documentation

TrackMesh Track::Segment::ai_floor_mesh [protected]

Definition at line 108 of file Segment.h.

std::vector<boost::shared_ptr<SegmentConnection> > Track::Segment::connections [protected]

(undistorted) cross section connections information

Definition at line 116 of file Segment.h.

TrackMesh<DrawableMesh> Track::Segment::graphics_mesh [protected]

Definition at line 107 of file Segment.h.

bool Track::Segment::m_edges_allowed [protected]

True if good for edges, false otherwise.

Definition at line 119 of file Segment.h.

std::string Track::Segment::name [protected]

The human-readable name. Taken from blender scene the segment came from.

Definition at line 113 of file Segment.h.

TrackMesh Track::Segment::physics_floor_mesh [protected]

Definition at line 110 of file Segment.h.

TrackMesh Track::Segment::physics_wall_mesh [protected]

Definition at line 109 of file Segment.h.

Texture Track::Segment::texture [protected]

Definition at line 106 of file Segment.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:18 2010 by Doxygen version 1.4.7 for Racer version svn335.