Track::TrackMesh< T > Class Template Reference

A mesh that can be chained together and distorted to make a track with corners and twists. More...

#include <TrackMesh.h>

List of all members.

Public Member Functions

 TrackMesh (std::istream &source)
 Create from a description in a stream.
virtual ~TrackMesh ()
btScalar get_maximum_bend () const
 The sharpest corner in radians this track mesh can manage.
btScalar get_length () const
 Get the length of the segment.
btScalar get_minimum_y () const
 Get the minimum y value of all vertices in the mesh.
get_distorted_faces (PieceDistortion piece_distortion) const
 get the faces of a distorted mesh.
get_distorted_faces (btTransform tranform) const
 get the faces of a linearly transformed mesh.
const T & get_faces () const
 get non-distorted mesh.

Protected Attributes

float maximum_bend
 The maximum bend a PieceDistortion should have when applied to this mesh.
float length
 length between end connections (may not be applicable).
btScalar minimum_y
 The lowest y value of all vertices' positions in the mesh.
btScalar maximum_y
 The heighest y value of all vertices' positions in the mesh.
mesh
 The mesh with no distortion.


Detailed Description

template<class T = MeshFaces>
class Track::TrackMesh< T >

A mesh that can be chained together and distorted to make a track with corners and twists.

A theme contains a variety of Segments for different looks and purposes, which define a few TrackMeshes each (for physics, AI, graphics).

A TrackMesh is linked to from TrackMeshInstances. T class to use as the mesh. Should behave like MeshFaces.

Definition at line 37 of file TrackMesh.h.


Constructor & Destructor Documentation

template<class T>
Track::TrackMesh< T >::TrackMesh ( std::istream &  source  ) 

Create from a description in a stream.

Advances the stream to the end of the TrackMesh.

Todo:
calculate the maximum bend.

Definition at line 97 of file TrackMesh.h.

template<class T>
Track::TrackMesh< T >::~TrackMesh (  )  [virtual]

Definition at line 118 of file TrackMesh.h.


Member Function Documentation

template<class T>
T Track::TrackMesh< T >::get_distorted_faces ( btTransform  tranform  )  const

get the faces of a linearly transformed mesh.

This is useful for getting collision shapes.

Graphics meshes should use get_faces(), and do transformations in the graphics pipeline instead for better memory use.

Definition at line 162 of file TrackMesh.h.

template<class T>
T Track::TrackMesh< T >::get_distorted_faces ( PieceDistortion  piece_distortion  )  const

get the faces of a distorted mesh.

This is useful for distorting a navigation mesh for AI.

Definition at line 141 of file TrackMesh.h.

template<class T>
const T & Track::TrackMesh< T >::get_faces (  )  const

get non-distorted mesh.

Definition at line 156 of file TrackMesh.h.

template<class T>
btScalar Track::TrackMesh< T >::get_length (  )  const

Get the length of the segment.

Definition at line 129 of file TrackMesh.h.

template<class T>
btScalar Track::TrackMesh< T >::get_maximum_bend (  )  const

The sharpest corner in radians this track mesh can manage.

It is determined algorithmically from the mesh's shape.

Definition at line 123 of file TrackMesh.h.

template<class T>
btScalar Track::TrackMesh< T >::get_minimum_y (  )  const

Get the minimum y value of all vertices in the mesh.

Definition at line 135 of file TrackMesh.h.


Member Data Documentation

template<class T = MeshFaces>
float Track::TrackMesh< T >::length [protected]

length between end connections (may not be applicable).

Definition at line 84 of file TrackMesh.h.

template<class T = MeshFaces>
float Track::TrackMesh< T >::maximum_bend [protected]

The maximum bend a PieceDistortion should have when applied to this mesh.

Any more and the vertices of the mesh will cross the wrong way.

Definition at line 81 of file TrackMesh.h.

template<class T = MeshFaces>
btScalar Track::TrackMesh< T >::maximum_y [protected]

The heighest y value of all vertices' positions in the mesh.

Definition at line 90 of file TrackMesh.h.

template<class T = MeshFaces>
T Track::TrackMesh< T >::mesh [protected]

The mesh with no distortion.

Definition at line 93 of file TrackMesh.h.

template<class T = MeshFaces>
btScalar Track::TrackMesh< T >::minimum_y [protected]

The lowest y value of all vertices' positions in the mesh.

Definition at line 87 of file TrackMesh.h.


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

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