ORTS

TerrainBase::Segment Struct Reference

A pair of locations, representing boundaries etc. More...

#include <TerrainBase.H>

List of all members.

Public Member Functions

 Segment (sint4 x1=0, sint4 y1=0, sint4 x2=0, sint4 y2=0)
 Segment (const Loc &l1_, const Loc &l2_)
sint4 is_left_turn (const Loc &l3) const
 positive if l3 is on the left of the line from l1 to l2; negative if l3 is on the right; 0 if l3 is on the line containing the segment.
bool touches (const Segment &o) const
 true if the segments weakly intersect
bool intersects (const Segment &o) const
 true if the segments strictly intersect

Public Attributes

Loc l1
Loc l2

Detailed Description

A pair of locations, representing boundaries etc.

Definition at line 64 of file TerrainBase.H.


Constructor & Destructor Documentation

TerrainBase::Segment::Segment ( sint4  x1 = 0,
sint4  y1 = 0,
sint4  x2 = 0,
sint4  y2 = 0 
) [inline]

Definition at line 68 of file TerrainBase.H.

TerrainBase::Segment::Segment ( const Loc l1_,
const Loc l2_ 
) [inline]

Definition at line 69 of file TerrainBase.H.


Member Function Documentation

bool TerrainBase::Segment::intersects ( const Segment o) const [inline]

true if the segments strictly intersect

Definition at line 84 of file TerrainBase.H.

References is_left_turn(), l1, and l2.

sint4 TerrainBase::Segment::is_left_turn ( const Loc l3) const [inline]

positive if l3 is on the left of the line from l1 to l2; negative if l3 is on the right; 0 if l3 is on the line containing the segment.

Adapted for the reversed y-axis used by ORTS.

Definition at line 75 of file TerrainBase.H.

References l1, l2, TerrainBase::Loc::x, and TerrainBase::Loc::y.

Referenced by intersects(), and touches().

bool TerrainBase::Segment::touches ( const Segment o) const [inline]

true if the segments weakly intersect

Definition at line 78 of file TerrainBase.H.

References is_left_turn(), l1, and l2.

Referenced by TRTerrain::UnitPath::is_intersect(), SimpleTerrain::UnitPath::is_intersect(), and SimplePathfinder::is_intersect().


Member Data Documentation


The documentation for this struct was generated from the following file:


Generated on Fri May 18 2012 03:03:10 for ORTS by Doxygen1.7.3