Track::PathVertex Class Reference

Information to store at the vertices of a Path. More...

#include <PathVertex.h>

Inheritance diagram for Track::PathVertex:

Track::UniqueIdentifier Track::EditAssist::Dragable Track::AABBDrawable Track::EditAssist::Selectable Track::Drawable Track::AABBBounded List of all members.

Public Member Functions

 PathVertex ()
 Failing constuctor.
 PathVertex (const Track *track)
 PathVertex (std::istream &source, const Theme &theme, const Track *track)
virtual ~PathVertex ()
const btVector3 & get_position () const
 Get the position of the centre of the vertex.
btVector3 get_position (std::size_t index) const
 Get a SegmentConnection's position on this vertex.
void set_position (const btVector3 &position)
const btVector3 & get_gradient () const
 Get the tangent of the arcs where they meet the vertex.
btVector3 get_gradient (std::size_t index) const
 Get the tangent of the arcs where they meet a SegmentConnection.
const btVector3 & get_up () const
 Get the up vector of the track at the vertex.
btVector3 get_up (std::size_t index) const
 Get the up vector of the track at a SegmentConnection.
void set_angle (btQuaternion angle)
 Set the angle used to determine the gradient and up vector.
const btQuaternion & get_angle () const
 Get the angle used to determine the gradient and up vector of the vertex itself.
btQuaternion get_angle (std::size_t index) const
 Get the angle used to determine the gradient and up vector at a SegmentConnection.
std::size_t get_segment_index () const
void set_segment (std::size_t new_segment_index, const Segment *new_segment)
const Segmentget_segment () const
virtual bool is_here (btVector3 start, btVector3 stop, btScalar radius) const
 Check if the object lies along a given line segment.
virtual boost::shared_ptr<
Document::DocumentDelta
make_delta (btVector3 new_position) const
 Create a document delta moving the vertex to a new position.
const EditAssist::ControlPointget_control_point_here (btVector3 start, btVector3 stop, btScalar radius) const
 Return any vertex handles near a line segment.
void draw_control_points () const
 Draw all ControlPoint objects adjusting this vertex.
void set_handle_lengths (btScalar handle_length)
 Set the lengths of the rotation handles.
const std::vector< boost::shared_ptr<
EditAssist::SegmentConnectionHandle > > & 
get_connection_handles () const
void set_track (const Track *track)
void add_collision_faces (btTriangleMesh &shape) const
 Add the collision faces of the PathVertex into a shape.
void add_floor_faces (btTriangleMesh &shape) const
 Add the drivable surface of the PathVertex into a shape.
void add_ai_faces (MeshFaces &mesh) const
 Add the surface the AI considers driving on to a mesh.
virtual AxisAlignedBoundingBox get_bounds () const
 Get the Axis aligned bounding box of the object.
virtual void draw () const
 Draw the object.

Protected Member Functions

void calculate_bounds ()
 Set the correct value for m_bounds and m_transform and update the navigation graph.
void update_handles ()
 Update the properties of the vertices control points.

Protected Attributes

unsigned int file_version
btVector3 position
 The position of the vertex.
const Segmentsegment
 The segment to use at the vertex.
std::size_t segment_index
 The index of the segment in the Theme.
btVector3 gradient
 The normalised forward direction from this vertex.
btVector3 up
 The normalised up direction from this vertex.
btQuaternion angle
 The rotation from gradient (0, 1, 0) and up (0, 0, 1).
std::vector< btQuaternion > connection_angles
 Rotation of each of the connections.
EditAssist::VertexRotationHandle up_handle
 control point used to change the up direction in the editor.
EditAssist::VertexRotationHandle forward_handle
 control point used to change the forward direction in the editor.
std::vector< boost::shared_ptr<
EditAssist::SegmentConnectionHandle > > 
connection_handles
const Tracktrack
AxisAlignedBoundingBox m_bounds
 The bounds of the segment's transformed graphics mesh.
btTransform m_transform
 The transformation of the segment to world space.
MeshFaces m_nav_mesh
 The navigation mesh.
MeshFaces::Graph m_navigation_graph

Friends

std::ostream & operator<< (std::ostream &destination, const PathVertex &path_vertex)
AxisAlignedBoundingBoxoperator|= (AxisAlignedBoundingBox &box, const PathVertex &path_vertex)
 Expand an AxisAlignedBoundingBox almost minimally to contain a PathVertex.

Detailed Description

Information to store at the vertices of a Path.

Definition at line 39 of file PathVertex.h.


Constructor & Destructor Documentation

Track::PathVertex::PathVertex (  ) 

Failing constuctor.

This is added for compatibility with boost's graph library. It should never be called, since we only create graph edges where the vertices already exist.

Definition at line 23 of file PathVertex.cpp.

Track::PathVertex::PathVertex ( const Track track  ) 

Definition at line 33 of file PathVertex.cpp.

Track::PathVertex::PathVertex ( std::istream &  source,
const Theme theme,
const Track track 
)

Definition at line 47 of file PathVertex.cpp.

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

Definition at line 64 of file PathVertex.cpp.


Member Function Documentation

void Track::PathVertex::add_ai_faces ( MeshFaces mesh  )  const

Add the surface the AI considers driving on to a mesh.

Definition at line 285 of file PathVertex.cpp.

void Track::PathVertex::add_collision_faces ( btTriangleMesh &  shape  )  const

Add the collision faces of the PathVertex into a shape.

Definition at line 272 of file PathVertex.cpp.

void Track::PathVertex::add_floor_faces ( btTriangleMesh &  shape  )  const

Add the drivable surface of the PathVertex into a shape.

Definition at line 279 of file PathVertex.cpp.

void Track::PathVertex::calculate_bounds (  )  [protected]

Set the correct value for m_bounds and m_transform and update the navigation graph.

Definition at line 298 of file PathVertex.cpp.

void Track::PathVertex::draw (  )  const [virtual]

Draw the object.

Called indirectly by draw(const OcclusionTester &) const when it is on the screen, but can also be called manually if view bounds are not known.

Implements Track::Drawable.

Definition at line 310 of file PathVertex.cpp.

void Track::PathVertex::draw_control_points (  )  const

Draw all ControlPoint objects adjusting this vertex.

See also:
void Track::EditAssist::ControlPoint::draw() const

Definition at line 241 of file PathVertex.cpp.

btQuaternion Track::PathVertex::get_angle ( std::size_t  index  )  const

Get the angle used to determine the gradient and up vector at a SegmentConnection.

Parameters:
index The index the Segment uses for the SegmentConnection.

Definition at line 148 of file PathVertex.cpp.

const btQuaternion & Track::PathVertex::get_angle (  )  const

Get the angle used to determine the gradient and up vector of the vertex itself.

Definition at line 143 of file PathVertex.cpp.

AxisAlignedBoundingBox Track::PathVertex::get_bounds (  )  const [virtual]

Get the Axis aligned bounding box of the object.

The object is contained entierly within this region.

Implements Track::AABBBounded.

Definition at line 293 of file PathVertex.cpp.

const std::vector< boost::shared_ptr< EditAssist::SegmentConnectionHandle > > & Track::PathVertex::get_connection_handles (  )  const

Definition at line 262 of file PathVertex.cpp.

const EditAssist::ControlPoint * Track::PathVertex::get_control_point_here ( btVector3  start,
btVector3  stop,
btScalar  radius 
) const

Return any vertex handles near a line segment.

Parameters:
start The starting point of the line segment to scan.
stop The end point of the the line segment to scan
radius The radius around the line to consider.
Returns:
A pointer to a control point that alters this vertex within a cylinder around the line, with the request radius, or 0 if there is no such control point.

Definition at line 217 of file PathVertex.cpp.

btVector3 Track::PathVertex::get_gradient ( std::size_t  index  )  const

Get the tangent of the arcs where they meet a SegmentConnection.

It is unit length.

Parameters:
index The index the Segment uses for the SegmentConnection.

Definition at line 115 of file PathVertex.cpp.

const btVector3 & Track::PathVertex::get_gradient (  )  const

Get the tangent of the arcs where they meet the vertex.

It is unit length.

Definition at line 110 of file PathVertex.cpp.

btVector3 Track::PathVertex::get_position ( std::size_t  index  )  const

Get a SegmentConnection's position on this vertex.

Parameters:
index The index of the SegmentConnection in the Segment to look up.
Returns:
The position of the SegmentConnection transformed to its position on the vertex.

Definition at line 74 of file PathVertex.cpp.

const btVector3 & Track::PathVertex::get_position (  )  const

Get the position of the centre of the vertex.

Definition at line 69 of file PathVertex.cpp.

const Segment * Track::PathVertex::get_segment (  )  const

Definition at line 180 of file PathVertex.cpp.

std::size_t Track::PathVertex::get_segment_index (  )  const

Definition at line 153 of file PathVertex.cpp.

btVector3 Track::PathVertex::get_up ( std::size_t  index  )  const

Get the up vector of the track at a SegmentConnection.

It is perpendicular to gradient, and unit length.

Parameters:
index The index the Segment uses for the SegmentConnection.

Definition at line 126 of file PathVertex.cpp.

const btVector3 & Track::PathVertex::get_up (  )  const

Get the up vector of the track at the vertex.

It is perpendicular to gradient, and unit length.

Definition at line 121 of file PathVertex.cpp.

bool Track::PathVertex::is_here ( btVector3  start,
btVector3  stop,
btScalar  radius 
) const [virtual]

Check if the object lies along a given line segment.

Parameters:
start The start position of the line in world space.
stop The end position of the line in world space
radius to consider points near the line
Returns:
true if it is on or near the line, false otherwise.

Implements Track::EditAssist::Selectable.

Definition at line 185 of file PathVertex.cpp.

boost::shared_ptr< Document::DocumentDelta > Track::PathVertex::make_delta ( btVector3  new_position  )  const [virtual]

Create a document delta moving the vertex to a new position.

Parameters:
new_position The location the vertex should ocupy when the produced delta is applied.
Returns:
a shared pointer to a Document::MoveNodeDelta.

Implements Track::EditAssist::Dragable.

Definition at line 205 of file PathVertex.cpp.

void Track::PathVertex::set_angle ( btQuaternion  angle  ) 

Set the angle used to determine the gradient and up vector.

The gradient is wherever the rotation takes y axis, and the up vector is wherever the rotation takes the z axis.

Definition at line 132 of file PathVertex.cpp.

void Track::PathVertex::set_handle_lengths ( btScalar  handle_length  ) 

Set the lengths of the rotation handles.

Definition at line 254 of file PathVertex.cpp.

void Track::PathVertex::set_position ( const btVector3 &  position  ) 

Definition at line 79 of file PathVertex.cpp.

void Track::PathVertex::set_segment ( std::size_t  new_segment_index,
const Segment new_segment 
)

Definition at line 158 of file PathVertex.cpp.

void Track::PathVertex::set_track ( const Track track  ) 

Definition at line 267 of file PathVertex.cpp.

void Track::PathVertex::update_handles (  )  [protected]

Update the properties of the vertices control points.

Definition at line 86 of file PathVertex.cpp.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  destination,
const PathVertex path_vertex 
) [friend]

Definition at line 323 of file PathVertex.cpp.

AxisAlignedBoundingBox& operator|= ( AxisAlignedBoundingBox box,
const PathVertex path_vertex 
) [friend]

Expand an AxisAlignedBoundingBox almost minimally to contain a PathVertex.

Definition at line 333 of file PathVertex.cpp.


Member Data Documentation

btQuaternion Track::PathVertex::angle [protected]

The rotation from gradient (0, 1, 0) and up (0, 0, 1).

Definition at line 174 of file PathVertex.h.

std::vector<btQuaternion> Track::PathVertex::connection_angles [protected]

Rotation of each of the connections.

Definition at line 177 of file PathVertex.h.

std::vector<boost::shared_ptr<EditAssist::SegmentConnectionHandle> > Track::PathVertex::connection_handles [protected]

Definition at line 184 of file PathVertex.h.

unsigned int Track::PathVertex::file_version [protected]

Definition at line 161 of file PathVertex.h.

EditAssist::VertexRotationHandle Track::PathVertex::forward_handle [protected]

control point used to change the forward direction in the editor.

Definition at line 182 of file PathVertex.h.

btVector3 Track::PathVertex::gradient [protected]

The normalised forward direction from this vertex.

Definition at line 170 of file PathVertex.h.

AxisAlignedBoundingBox Track::PathVertex::m_bounds [protected]

The bounds of the segment's transformed graphics mesh.

Definition at line 189 of file PathVertex.h.

MeshFaces Track::PathVertex::m_nav_mesh [protected]

The navigation mesh.

Definition at line 194 of file PathVertex.h.

MeshFaces::Graph Track::PathVertex::m_navigation_graph [protected]

Definition at line 195 of file PathVertex.h.

btTransform Track::PathVertex::m_transform [protected]

The transformation of the segment to world space.

Definition at line 191 of file PathVertex.h.

btVector3 Track::PathVertex::position [protected]

The position of the vertex.

Definition at line 163 of file PathVertex.h.

const Segment* Track::PathVertex::segment [protected]

The segment to use at the vertex.

Definition at line 165 of file PathVertex.h.

std::size_t Track::PathVertex::segment_index [protected]

The index of the segment in the Theme.

Definition at line 168 of file PathVertex.h.

const Track* Track::PathVertex::track [protected]

Definition at line 186 of file PathVertex.h.

btVector3 Track::PathVertex::up [protected]

The normalised up direction from this vertex.

Definition at line 172 of file PathVertex.h.

EditAssist::VertexRotationHandle Track::PathVertex::up_handle [protected]

control point used to change the up direction in the editor.

Definition at line 180 of file PathVertex.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.