Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LSS Class Reference

#include <IceLSS.h>

Inheritance diagram for LSS:
Segment

Public Member Functions

inline_ LSS ()
 Constructor. More...
 
inline_ LSS (const Segment &seg, float radius)
 Constructor. More...
 
inline_ ~LSS ()
 Destructor. More...
 
void ComputeOBB (OBB &box)
 
inline_ bool Contains (const Point &pt) const
 
inline_ bool Contains (const Sphere &sphere)
 
inline_ bool Contains (const LSS &lss)
 
- Public Member Functions inherited from Segment
inline_ Segment ()
 Constructor. More...
 
inline_ Segment (const Point &p0, const Point &p1)
 Constructor. More...
 
inline_ Segment (const Segment &seg)
 Copy constructor. More...
 
inline_ ~Segment ()
 Destructor. More...
 
inline_ const PointGetOrigin () const
 
inline_ Point ComputeDirection () const
 
inline_ void ComputeDirection (Point &dir) const
 
inline_ float ComputeLength () const
 
inline_ float ComputeSquareLength () const
 
inline_ void SetOriginDirection (const Point &origin, const Point &direction)
 
inline_ void ComputePoint (Point &pt, float t) const
 
float SquareDistance (const Point &point, float *t=null) const
 
inline_ float Distance (const Point &point, float *t=null) const
 

Public Attributes

float mRadius
 Sphere radius. More...
 
- Public Attributes inherited from Segment
Point mP0
 Start of segment. More...
 
Point mP1
 End of segment. More...
 

Detailed Description

Definition at line 15 of file IceLSS.h.

Constructor & Destructor Documentation

inline_ LSS::LSS ( )
inline

Constructor.

Definition at line 19 of file IceLSS.h.

19 {}
inline_ LSS::LSS ( const Segment seg,
float  radius 
)
inline

Constructor.

Definition at line 21 of file IceLSS.h.

21 : Segment(seg), mRadius(radius) {}
inline_ LSS::~LSS ( )
inline

Destructor.

Definition at line 23 of file IceLSS.h.

23 {}

Member Function Documentation

void LSS::ComputeOBB ( OBB box)

Computes an OBB surrounding the LSS.

Parameters
box[out] the OBB
inline_ bool LSS::Contains ( const Point pt) const
inline

Tests if a point is contained within the LSS.

Parameters
pt[in] the point to test
Returns
true if inside the LSS
Warning
point and LSS must be in same space

Definition at line 41 of file IceLSS.h.

41 { return SquareDistance(pt) <= mRadius*mRadius; }
inline_ bool LSS::Contains ( const Sphere sphere)
inline

Tests if a sphere is contained within the LSS.

Parameters
sphere[in] the sphere to test
Returns
true if inside the LSS
Warning
sphere and LSS must be in same space

Definition at line 51 of file IceLSS.h.

52  {
53  float d = mRadius - sphere.mRadius;
54  if(d>=0.0f) return SquareDistance(sphere.mCenter) <= d*d;
55  else return false;
56  }
inline_ bool LSS::Contains ( const LSS lss)
inline

Tests if an LSS is contained within the LSS.

Parameters
lss[in] the LSS to test
Returns
true if inside the LSS
Warning
both LSS must be in same space

Definition at line 66 of file IceLSS.h.

67  {
68  // We check the LSS contains the two spheres at the start and end of the sweep
69  return Contains(Sphere(lss.mP0, lss.mRadius)) && Contains(Sphere(lss.mP0, lss.mRadius));
70  }

Member Data Documentation

float LSS::mRadius

Sphere radius.

Definition at line 72 of file IceLSS.h.


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