Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cCylinder Class Reference

#include <cCylinder.h>

Inheritance diagram for GrayLib::cCylinder:
GrayLib::cSegment3f

Public Member Functions

 cCylinder ()
 
 cCylinder (const cVector3f &v1, const cVector3f &v2)
 
void Update ()
 
bool GetIntersectWithTri (const cTriangle3f &Tri, OUT cVector3f &rvCollisionPoint, OUT DVALUE_t &rfDistToCollision) const
 
 UNITTEST_FRIEND (cCylinder)
 
- Public Member Functions inherited from GrayLib::cSegment3f
 cSegment3f () noexcept
 
 cSegment3f (const cVector3f &v1, const cVector3f &v2) noexcept
 
cVector3f get_Center () const noexcept
 
DVALUE_t get_Width () const noexcept
 
DVALUE_t get_Height () const noexcept
 
DVALUE_t get_HeightMax () const noexcept
 
DVALUE_t get_Depth () const noexcept
 
cVector3f get_Delta () const noexcept
 
enum AXIS_TYPE get_LargestAxis () const noexcept
 
DVALUE_t get_MaxDelta () const noexcept
 
DVALUE_t get_Diameter () const
 
DVALUE_t get_Radius () const
 
DVALUE_t GetDistanceTo (const cVector3f &v) const
 
bool operator== (const cSegment3f &line) const
 
 operator const DVALUE_t * () const noexcept
 
 operator DVALUE_t * () noexcept
 
void SetMin () noexcept
 
void SetMax () noexcept
 
void SetOne () noexcept
 
void SetZero () noexcept
 
void SetRay (const cVector3f &vOrigin, const cVector3f &vDir, DVALUE_t fDist)
 
void Scale (DVALUE_t fScale)
 Change operators. More...
 
void ScaleVect (const cVector3f &vScale)
 
void ScaleY (DVALUE_t fScaleY)
 
void Offset (const cVector3f &vOffset)
 
void Grow (const cVector3f &vOffset)
 
void GrowN (DVALUE_t nValue)
 
ITERATE_t v_SetLine (const cVariant &vArgs, ITERATE_t i=0)
 
void v_GetLine (cVariant &vArgs) const
 
 UNITTEST_FRIEND (cSegment3)
 

Static Public Member Functions

static bool GRAYCALL GetLowestRoot (DVALUE_t a, DVALUE_t b, DVALUE_t c, DVALUE_t maxR, OUT DVALUE_t &rfRoot)
 

Public Attributes

cVector3f m_vDir
 derived values from cSegment3f More...
 
cVector3f m_vDirNorm
 normalized vector of m_vDir. More...
 
- Public Attributes inherited from GrayLib::cSegment3f
cVector3f m_vMin
 a vertex on the line segment More...
 
cVector3f m_vMax
 

Additional Inherited Members

- Public Types inherited from GrayLib::cSegment3f
typedef float DVALUE_t
 Dimension value type. More...
 

Detailed Description

a 3d cylinder of unit radius 1. Used for sphere sweep collision detection with triangles. cSegment3f = center ray starting at point (m_vMin) and proceeding to m_vMax in 3d space.

Constructor & Destructor Documentation

◆ cCylinder() [1/2]

GrayLib::cCylinder::cCylinder ( )
inline

ASSUME m_vMin,m_vMax are undefined.

◆ cCylinder() [2/2]

GrayLib::cCylinder::cCylinder ( const cVector3f v1,
const cVector3f v2 
)
inline

Member Function Documentation

◆ GetIntersectWithTri()

bool GrayLib::cCylinder::GetIntersectWithTri ( const cTriangle3f Tri,
OUT cVector3f rvCollisionPoint,
OUT DVALUE_t rfDistToCollision 
) const

Does the cylinder of unit radius 1 collide with the triangle?

Returns
fDistToCollision = distance along cCylinder (from m_vMin) to vCollisionPoint

◆ GetLowestRoot()

bool GrayLib::cCylinder::GetLowestRoot ( DVALUE_t  a,
DVALUE_t  b,
DVALUE_t  c,
DVALUE_t  maxR,
OUT DVALUE_t rfRoot 
)
static

check if solution exists. Called by GetIntersectWithTri()

◆ UNITTEST_FRIEND()

GrayLib::cCylinder::UNITTEST_FRIEND ( cCylinder  )

◆ Update()

void GrayLib::cCylinder::Update ( )
inline

if cSegment3f changes call this.

Member Data Documentation

◆ m_vDir

cVector3f GrayLib::cCylinder::m_vDir

derived values from cSegment3f

vector of move. m_vMax - m_vMin

◆ m_vDirNorm

cVector3f GrayLib::cCylinder::m_vDirNorm

normalized vector of m_vDir.


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