"L. Spiro Engine"
Classes | Typedefs | Enumerations | Functions | Variables

lsm Namespace Reference

Classes

class  CCylinder3
 A 3D cylinder. More...
class  CFixed
class  CFloat16
 A basic class for converting to and from 16-bit floating-point values. More...
class  CFrustum
 A frustum. More...
class  CLine3
 A 3D line and the math that loves it. More...
class  CLineSeg3Base
 A 3D line segment stored as 2 points. More...
class  CRay3Base
 A 3D ray stored as 1 point and a normalized direction. More...
class  CMathLib
 The base for our math functions. More...
class  CMatrix2x2Base
 The base matrix template allowing any type of number to be used. More...
class  CMatrix3x3
 A specialization of the 3-by-3 matrix template using the standard LSREAL type. More...
class  CMatrix3x3Base
 The base matrix template allowing any type of number to be used. More...
class  CMatrix4x4
 Specialization of the template base class for use with standard LSREAL matrices. More...
class  CMatrix4x4Base
 The base matrix template allowing any type of number to be used. Vectors are stored row-major. More...
class  COrientation
 Orientation of objects. More...
class  CPlane3
 A 3D plane. More...
class  CPlane3Base
 A template for any type of 3D plane. More...
class  CQuaternion
 A quaternion. More...
class  CRand
 Random-number generator. More...
class  CRect2
class  CSphere
class  CTriangle3
class  CTriangle3I
class  CVector2
 A standard 2D vector of type LSREAL. More...
class  CVector2Base
 A template for any type of 2D vector. More...
class  CVector3
 A standard 2D vector of type LSREAL. More...
class  CVector3Base
 A template for any type of 3D vector. More...
class  CVector4Base
 A template for any type of 4D vector. More...

Typedefs

typedef CLineSeg3Base< LSREAL,
CVector3
Parent
typedef float LSREAL
typedef double LSREALHP
typedef CVector4Base< LSREAL,
CVector3
CVector4
 A standard 4D vector of type LSREAL.

Enumerations

enum  LSM_FRUSTUM_POINTS {
  LSM_FP_FAR_BOTTOM_LEFT, LSM_FP_FAR_TOP_LEFT, LSM_FP_FAR_TOP_RIGHT, LSM_FP_FAR_BOTTOM_RIGHT,
  LSM_FP_NEAR_BOTTOM_LEFT, LSM_FP_NEAR_TOP_LEFT, LSM_FP_NEAR_TOP_RIGHT, LSM_FP_NEAR_BOTTOM_RIGHT
}
enum  LSM_ORIENT_DIRTY_FLAGS { LSM_ODF_POSITION = (1 << 0), LSM_ODF_ROTATION = (1 << 1), LSM_ODF_SCALE = (1 << 2), LSM_ODF_NORMALIZATION = (1 << 3) }
enum  LSM_PLANE_INTERSECT {
  LSM_PI_FRONT, LSM_PI_BACK, LSM_PI_INTERSECT, LSM_PI_STRADDLING,
  LSM_PI_COPLANAR
}

Functions

LSE_INLINE LSE_CALLCTOR CCapsule3 (const CCapsule3 &_cCapsule)
LSE_INLINE LSE_CALLCTOR CCapsule3 (const CVector3 &_vA, const CVector3 &_vB, LSREAL _fR)
LSE_INLINE LSE_CALLCTOR CLineSeg3 ()
LSE_INLINE LSE_CALLCTOR CLineSeg3 (const CLineSeg3 &_ls3Line)
LSE_INLINE LSE_CALLCTOR CLineSeg3 (const CVector3 &_vStart, const CVector3 &_vEnd)
LSE_INLINE LSE_CALLCTOR CRect3 (LSREAL _fX0, LSREAL _fX1, LSREAL _fY0, LSREAL _fY1, LSREAL _fZ0, LSREAL _fZ1)
LSE_INLINE LSREAL LSE_FCALL SizeX () const
LSE_INLINE LSREAL LSE_FCALL SizeY () const
LSE_INLINE LSREAL LSE_FCALL SizeZ () const
LSE_INLINE CVector3 LSE_FCALL Size () const
LSE_INLINE LSVOID LSE_FCALL Clear ()
LSE_INLINE LSVOID LSE_FCALL NegativeBox ()
LSE_INLINE LSVOID LSE_FCALL EnclosePoint (const CVector3 &_vPoint)
LSE_INLINE LSVOID LSE_FCALL EncloseBox (const CRect3 &_rRect)
LSE_INLINE LSVOID LSE_FCALL Set2D (const CRect2 &_rRect)
LSE_INLINE LSE_CALLCTOR CTriangle3Ex (const CVector3 _vArray[3])
LSE_INLINE LSE_CALLCTOR CTriangle3Ex (const CTriangle3 &_tTri)
LSE_INLINE LSE_CALLCTOR CTriangle3Ex (const CTriangle3Ex &_tTri)
LSE_INLINE const CVector3
&LSE_FCALL 
operator[] (LSUINT32 _ui32Index) const
LSE_INLINE LSBOOL LSE_FCALL operator== (const CTriangle3 &_tTri) const
LSE_INLINE LSBOOL LSE_FCALL operator!= (const CTriangle3 &_tTri) const
LSE_INLINE LSBOOL LSE_FCALL operator== (const CTriangle3Ex &_teTri) const
LSE_INLINE LSBOOL LSE_FCALL operator!= (const CTriangle3Ex &_tTri) const
LSE_INLINE const CVector3
&LSE_FCALL 
A () const
LSE_INLINE const CVector3
&LSE_FCALL 
B () const
LSE_INLINE const CVector3
&LSE_FCALL 
C () const
LSE_INLINE const CVector3
&LSE_FCALL 
N () const
LSE_INLINE const LSREAL LSE_FCALL D00 () const
LSE_INLINE const LSREAL LSE_FCALL D01 () const
LSE_INLINE const LSREAL LSE_FCALL D11 () const
LSE_INLINE const LSREAL LSE_FCALL Denom () const
LSE_INLINE LSVOID LSE_FCALL ReverseOrder ()
LSVOID LSE_FCALL Barycentric (const CVector3 &_vPoint, LSREAL &_fU, LSREAL &_fV, LSREAL &_fW) const
LSVOID LSE_FCALL Update ()

Variables

__pad0__
CVector3 a
CVector3 b
LSREAL r
LSM_FP_RIGHT
LSM_FP_TOP
LSM_FP_BOTTOM
LSM_FP_NEAR
LSM_FP_FAR
LSM_FP_TOTAL
F CQuaternion_qRot
F CQuaternion CVector3_vScale
F CQuaternion CVector3 CVector3_vPos
F CVector2 CMatrix2x2
LSREAL x0
LSREAL x1
LSREAL y0
LSREAL y1
LSREAL z0
LSREAL z1
CVector3 m_vNormal
LSREAL m_fD00
LSREAL m_fD01
LSREAL m_fD11
LSREAL m_fDenom

Detailed Description

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D capsule stored as 2 points and a radius.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D cylinder stored as 2 points and a radius.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A basic class for converting to and from 16-bit floating-point values. Does not provide operators for working directly on 16-bit floats.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A frustum is formed of 6 planes representing the near, far, left, right, top, and bottom of a 3D box. It is usually used with cameras to represent the veiwable area of the camera and can be tested against various types of primites (cylinders, spheres, AABB's, etc.) to determine objects that are partially or entirely inside the box. This helps determine which objects should be drawn.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: Helper/high-level functions.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D line stored as 2 points on the line.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D line segment stored as 2 points.

Copyright L. Spiro 2012 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D line segment stored as 2 points.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D ray stored as a point and normalized direction.

Copyright L. Spiro 2012 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D ray stored as 1 point and a normalized direction.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A specialization of the 2-by-2 matrix template using the standard LSREAL type.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: The base matrix template allowing any type of number to be used. Vectors are stored row-major.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A specialization of the 3-by-3 matrix template using the standard LSREAL type.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: Specialization of the template base class for use with standard LSREAL matrices.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A base class for all objects that can have an orientation in 3D.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D plane stored in constant-normal form (normal + distance from origin). Note that the plane is stored such that ax + by + cx - d = 0 instead of ax + by + cx + d = 0 to avoid the superfluous negation that frequently occurs in math related to planes.

Copyright L. Spiro 2012 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A template for any type of 3D plane.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: Quaternion in XYZW format.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: Random-number class. Uses the Mersenne Twister approach due to Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus.

Reference: M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions on Modeling and Computer Simulation, Vol. 8, No. 1, January pp.3-30 (1998).

Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, Copyright (C) 2000 - 2003, Richard J. Wagner All rights reserved. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/earticles.html http://portal.acm.org/citation.cfm?doid=272991.272995

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 2D rectangle. It is axis-aligned and technically works well as an AABB, but is not specialized in that direction.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D rectangle. It is axis-aligned and technically works well as an AABB, but is not specialized in that direction.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A sphere stored as a center position and radius.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D triangle with no additional data. It is just 3 points assumed to be in counter-clockwise order.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: An extended 3D triangle with precomputed barycentric weights and a normal.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A 3D triangle with no additional data stored as indices into a vertex list. The triangle must always be used in conjunction with a vertex list. No pointer to a vertex list is stored here.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A standard 2D vector of type LSREAL.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A template for any type of 2D vector.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A template for any type of 3D vector.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A standard 4D vector of type LSREAL.

Copyright L. Spiro 2011 All rights reserved.

Written by: Shawn (L. Spiro) Wilcoxen

This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.

Description: A template for any type of 4D vector.


Typedef Documentation

A standard 4D vector of type LSREAL.

Class CVector4 Description: A standard 4D vector of type LSREAL.


Enumeration Type Documentation

Frustum points.

Dirty flags for orientations.

Intersection.


Function Documentation

LSE_INLINE const CVector3& LSE_FCALL lsm::A ( ) const

Get point A.

Returns:
Returns a read-only reference to point A.
LSE_INLINE const CVector3& LSE_FCALL lsm::B ( ) const

Get point B.

Returns:
Returns a read-only reference to point B.
LSVOID LSE_FCALL lsm::Barycentric ( const CVector3 &  _vPoint,
LSREAL &  _fU,
LSREAL &  _fV,
LSREAL &  _fW 
) const

Get the barycentric coordinates of a given point.

Parameters:
_vPointThe point whose barycentric weights are to be obtained.
_fUBarycentric U coordinate.
_fVBarycentric V coordinate.
_fWBarycentric W coordinate.
LSE_INLINE const CVector3& LSE_FCALL lsm::C ( ) const

Get point C.

Returns:
Returns a read-only reference to point C.
LSE_INLINE LSVOID LSE_FCALL lsm::Clear ( )

Sets all axes to 0.

LSE_INLINE const LSREAL LSE_FCALL lsm::CTriangle3Ex::D00 ( ) const

Get the barycentric term D00.

Returns:
Returns a read-only reference to the barycentric term D00.
LSE_INLINE const LSREAL LSE_FCALL lsm::CTriangle3Ex::D01 ( ) const

Get the barycentric term D01.

Returns:
Returns a read-only reference to the barycentric term D01.
LSE_INLINE const LSREAL LSE_FCALL lsm::CTriangle3Ex::D11 ( ) const

Get the barycentric term D11.

Returns:
Returns a read-only reference to the barycentric term D11.

Get the barycentric term D11.

Returns:
Returns a read-only reference to the barycentric term D1.
LSE_INLINE const LSREAL LSE_FCALL lsm::CTriangle3Ex::Denom ( ) const

Get the denominator.

Returns:
Returns a read-only reference to the denominator.
LSE_INLINE LSVOID LSE_FCALL lsm::EncloseBox ( const CRect3 &  _rRect)

Resize to fit around another box, assuming *0 are mins and *1 are maxes.

Parameters:
_rRectThe rectangle to enclose.
LSE_INLINE LSVOID LSE_FCALL lsm::EnclosePoint ( const CVector3 &  _vPoint)

Resize to enclose the given point.

Parameters:
_vPointThe point to enclose.
LSE_INLINE const CVector3 &LSE_FCALL lsm::CTriangle3Ex::N ( ) const

Get the normal.

Returns:
Returns a read-only reference to the normal.
LSE_INLINE LSVOID LSE_FCALL lsm::NegativeBox ( )

Set to infitely small negative size.

LSE_INLINE LSBOOL LSE_FCALL lsm::operator!= ( const CTriangle3Ex &  _tTri) const

Inequality operator.

Parameters:
_teTriTriangle against which to check for inequality.
Returns:
Returns true if both triangles are not equal.
LSE_INLINE LSBOOL LSE_FCALL lsm::operator!= ( const CTriangle3 &  _tTri) const

Inequality operator.

Parameters:
_tTriTriangle against which to check for inequality.
Returns:
Returns true if both triangles are not equal.
LSE_INLINE LSBOOL LSE_FCALL lsm::operator== ( const CTriangle3Ex &  _teTri) const

Equality operator.

Parameters:
_teTriTriangle against which to check for equality.
Returns:
Returns true if both triangles are equal.
LSE_INLINE LSBOOL LSE_FCALL lsm::operator== ( const CTriangle3 &  _tTri) const

Equality operator.

Parameters:
_tTriTriangle against which to check for equality.
Returns:
Returns true if both triangles are equal.
LSE_INLINE const CVector3& LSE_FCALL lsm::operator[] ( LSUINT32  _ui32Index) const

Give array access.

Parameters:
_ui32IndexIndex of the point to get.
Returns:
Returns the point at the given index.
LSE_INLINE LSVOID LSE_FCALL lsm::ReverseOrder ( )

Reverse the order of the triangle.

LSE_INLINE LSVOID LSE_FCALL lsm::CRect3::Set2D ( const CRect2 &  _rRect)

Set the x and y values to those given by the 2D rectangle.

Parameters:
_rRectThe 2D rectangle whose X and Y components are to be copied to this rectangle.
LSE_INLINE CVector3 LSE_FCALL lsm::Size ( ) const

Returns the size of the box along all world axes.

Returns:
Returns the size of the box along all world axes.
LSE_INLINE LSREAL LSE_FCALL lsm::SizeX ( ) const

Returns the size of the box along the X world axis.

Returns:
Returns the size of the box along the X world axis.
LSE_INLINE LSREAL LSE_FCALL lsm::SizeY ( ) const

Returns the size of the box along the Y world axis.

Returns:
Returns the size of the box along the Y world axis.
LSE_INLINE LSREAL LSE_FCALL lsm::CRect3::SizeZ ( ) const

Returns the size of the box along the Z world axis.

Returns:
Returns the size of the box along the Z world axis.
LSVOID LSE_FCALL lsm::Update ( ) [protected]

Update the data.


Variable Documentation

The starting point.

Ending point.

LSREAL lsm::r

Radius.

LSREAL lsm::x0

The X-axis extents.

LSREAL lsm::y0

The Y-axis extents.

LSREAL lsm::z0

The Z-axis extents.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator