My Project: dgCollisionConvex Class Reference

My Project

Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
dgCollisionConvex Class Reference

`#include <dgCollisionConvex.h>`

Inheritance diagram for dgCollisionConvex:

## Classes

class | dgMinkFace
class | dgMinkHull
class | dgPerimenterEdge

## Public Member Functions

virtual void | CalcAABB (const dgMatrix &matrix, dgVector &p0, dgVector &p1) const
virtual dgFloat32 | RayCast (const dgVector &localP0, const dgVector &localP1, dgFloat32 maxT, dgContactPoint &contactOut, const dgBody *const body, void *const userData, OnRayPrecastAction preFilter) const
virtual dgFloat32 | ConvexRayCast (const dgCollisionInstance *const convexShape, const dgMatrix &origin, const dgVector &veloc, dgFloat32 maxT, dgContactPoint &contactOut, const dgBody *const referenceBody, const dgCollisionInstance *const referenceInstance, void *const userData, dgInt32 threadId) const
virtual dgVector | SupportVertex (const dgVector &dir, dgInt32 *const vertexIndex) const
virtual dgInt32 | CalculatePlaneIntersection (const dgVector &normal, const dgVector &point, dgVector *const contactsOut, dgFloat32 normalSign) const
virtual dgInt32 | GetConvexVertexCount () const
bool | IntesectionTest (dgCollisionParamProxy &proxy) const
bool | CalculateClosestPoints (dgCollisionParamProxy &proxy) const
dgInt32 | CalculateConvexCastContacts (dgCollisionParamProxy &proxy) const
dgInt32 | CalculateConvexToConvexContact (dgCollisionParamProxy &proxy) const
Public Member Functions inherited from dgCollision
dgInt32 | IsType (dgRTTI type) const
dgUnsigned32 | GetSignature () const
dgCollisionID | GetCollisionPrimityType () const
virtual void | SetCollisionBBox (const dgVector &p0, const dgVector &p1)=0
virtual dgFloat32 | GetSkinThickness () const
virtual void | Serialize (dgSerialize callback, void *const userData) const =0
virtual void | GetCollisionInfo (dgCollisionInfo *const info) const
const dgCollision * | AddRef () const
dgInt32 | GetRefCount () const
virtual dgInt32 | Release () const
const dgVector & | GetObbOrigin () const
virtual dgVector | GetObbSize () const
dgFloat32 | GetUmbraClipSize () const
dgMemoryAllocator * | GetAllocator () const

## Static Public Attributes

static dgVector | m_hullDirs [14]
static dgVector | m_dummySum [4]
static dgInt32 | m_rayCastSimplex [4][4]
static dgCollisionPriority | m_priorityOrder

## Protected Member Functions

| dgCollisionConvex (dgMemoryAllocator *const allocator, dgUnsigned32 signature, dgCollisionID id)
| dgCollisionConvex (dgWorld *const world, dgDeserialize deserialization, void *const userData)
| ~dgCollisionConvex ()
virtual void | SerializeLow (dgSerialize callback, void *const userData) const
virtual dgVector | CalculateVolumeIntegral (const dgMatrix &globalMatrix, const dgVector &plane, const dgCollisionInstance &parentScale) const
virtual dgFloat32 | GetVolume () const
virtual dgFloat32 | GetBoxMinRadius () const
virtual dgFloat32 | GetBoxMaxRadius () const
virtual void * | GetUserData () const
virtual void | SetUserData (void *const userData)
dgInt32 | RayCastClosestFace (dgVector *tetrahedrum, const dgVector &origin, dgFloat32 &pointDist) const
dgInt32 | SimplifyClipPolygon (dgInt32 count, const dgVector &normal, dgVector *const polygon) const
dgVector | CalculateVolumeIntegral (const dgPlane &plane) const
void | SetVolumeAndCG ()
bool | SanityCheck (dgPolyhedra &hull) const
virtual void | DebugCollision (const dgMatrix &matrix, dgCollision::OnDebugCollisionMeshCallback callback, void *const userData) const
virtual void | MassProperties ()
virtual dgMatrix | CalculateInertiaAndCenterOfMass (const dgMatrix &m_alignMatrix, const dgVector &localScale, const dgMatrix &matrix) const
virtual dgFloat32 | CalculateMassProperties (const dgMatrix &offset, dgVector &inertia, dgVector &crossInertia, dgVector &centerOfMass) const
bool | SanityCheck (dgInt32 count, const dgVector &normal, dgVector *const contactsOut) const
dgPerimenterEdge * | ReduceContacts (dgPerimenterEdge *poly, dgInt32 maxCount) const
dgInt32 | RectifyConvexSlice (dgInt32 count, const dgVector &normal, dgVector *const contactsOut) const
virtual dgVector | ConvexConicSupporVertex (const dgVector &dir) const
virtual dgVector | ConvexConicSupporVertex (const dgVector &point, const dgVector &dir) const
virtual dgInt32 | CalculateContacts (const dgVector &point, const dgVector &normal, dgCollisionParamProxy &proxy, dgVector *const contactsOut) const
dgInt32 | CalculateContactsGeneric (const dgVector &point, const dgVector &normal, dgCollisionParamProxy &proxy, dgVector *const contactsOut) const
dgInt32 | ConvexPolygonsIntersection (const dgVector &nornal, dgInt32 count1, dgVector *const shape1, dgInt32 count2, dgVector *const shape2, dgVector *const contactOut, dgInt32 maxContacts) const
dgInt32 | ConvexPolygonToLineIntersection (const dgVector &normal, dgInt32 count1, dgVector *const shape1, dgInt32 count2, dgVector *const shape2, dgVector *const contactOut, dgVector *const mem) const
dgFloat32 | ConvexConicConvexRayCast (const dgCollisionInstance *const convexConicShape, const dgMatrix &conicShapeMatrix, const dgCollisionInstance *const convexCastingShape, const dgMatrix &castingMatrix, const dgVector &castingVeloc, dgFloat32 maxT, dgContactPoint &contactOut) const
virtual const dgConvexSimplexEdge ** | GetVertexToEdgeMapping () const
Protected Member Functions inherited from dgCollision
| dgCollision (const dgCollision &source)
| dgCollision (dgMemoryAllocator *const allocator, dgUnsigned32 signature, dgCollisionID id)
| dgCollision (dgWorld *const world, dgDeserialize deserialization, void *const userData)
virtual | ~dgCollision ()
void | SetSignature (dgInt32 signature)
virtual dgInt32 | CalculateSignature () const =0

## Static Protected Member Functions

static void | CalculateInertia (void *userData, int vertexCount, const dgFloat32 *const FaceArray, int faceId)

## Protected Attributes

void * | m_userData
dgVector * | m_vertex
dgConvexSimplexEdge * | m_simplex
dgFloat32 | m_boxMinRadius
dgFloat32 | m_boxMaxRadius
dgFloat32 | m_simplexVolume
dgUnsigned16 | m_edgeCount
dgUnsigned16 | m_vertexCount
Protected Attributes inherited from dgCollision
dgVector | m_inertia
dgVector | m_crossInertia
dgVector | m_centerOfMass
dgVector | m_boxSize
dgVector | m_boxOrigin
dgInt32 | m_rtti
dgInt32 | m_refCount
dgUnsigned32 | m_signature
dgCollisionID | m_collisionId
dgMemoryAllocator * | m_allocator

## Friends

class | dgWorld
class | dgMinkowskiConv
class | dgCollisionCompound
class | dgBroadPhase
class | dgCollisionConvexModifier

## Additional Inherited Members

Public Types inherited from dgCollision

enum

dgRTTI {
dgCollisionNull_RTTI = 1<<0, dgCollisionBox_RTTI = 1<<1, dgCollisionCone_RTTI = 1<<2, dgCollisionSphere_RTTI = 1<<3,
dgCollisionCapsule_RTTI = 1<<4, dgCollisionCylinder_RTTI = 1<<5, dgCollisionConvexHull_RTTI = 1<<6, dgCollisionTaperedCapsule_RTTI = 1<<7,
dgCollisionTaperedCylinder_RTTI = 1<<8, dgCollisionChamferCylinder_RTTI = 1<<9, dgCollisionConvexPolygon_RTTI = 1<<10, dgCollisionConvexShape_RTTI = 1<<11,
dgCollisionCompound_RTTI = 1<<12, dgCollisionBVH_RTTI = 1<<13, dgCollisionMesh_RTTI = 1<<14, dgCollisionDeformableMesh_RTTI = 1<<15,
dgCollisionDeformableSolidMesh_RTTI = 1<<16, dgCollisionDeformableClothPatch_RTTI = 1<<17, dgCollisionUserMesh_RTTI = 1<<18, dgCollisionHeightField_RTTI = 1<<19,
dgCollisionScene_RTTI = 1<<20, dgCollisionCompoundBreakable_RTTI = 1<<21
}

typedef void(dgApi * | OnDebugCollisionMeshCallback) (void *userData, int vertexCount, const dgFloat32 *FaceArray, int faceId)
Static Public Member Functions inherited from dgCollision
static dgUnsigned32 | Quantize (dgFloat32 value)
static dgUnsigned32 | Quantize (void *buffer, int size)

## Constructor & Destructor Documentation

## § dgCollisionConvex() [1/2]

dgCollisionConvex::dgCollisionConvex | ( | dgMemoryAllocator *const | allocator,
|  | dgUnsigned32 | signature,
|  | dgCollisionID | id
| ) |  |

protected

## § dgCollisionConvex() [2/2]

dgCollisionConvex::dgCollisionConvex | ( | dgWorld *const | world,
|  | dgDeserialize | deserialization,
|  | void *const | userData
| ) |  |

protected

## § ~dgCollisionConvex()

dgCollisionConvex::~dgCollisionConvex | ( |  | ) |

protected

## Member Function Documentation

## § CalcAABB()

void dgCollisionConvex::CalcAABB | ( | const dgMatrix & | matrix,
|  | dgVector & | p0,
|  | dgVector & | p1
| ) |  | const

virtual

Implements dgCollision.

Reimplemented in dgCollisionDeformableMesh, dgCollisionSphere, dgCollisionBox, and dgCollisionNull.

## § CalculateClosestPoints()

bool dgCollisionConvex::CalculateClosestPoints | ( | dgCollisionParamProxy & | proxy | ) | const

## § CalculateContacts()

dgInt32 dgCollisionConvex::CalculateContacts | ( | const dgVector & | point,
|  | const dgVector & | normal,
|  | dgCollisionParamProxy & | proxy,
|  | dgVector *const | contactsOut
| ) |  | const

protectedvirtual

Reimplemented in dgCollisionSphere, and dgCollisionChamferCylinder.

## § CalculateContactsGeneric()

dgInt32 dgCollisionConvex::CalculateContactsGeneric | ( | const dgVector & | point,
|  | const dgVector & | normal,
|  | dgCollisionParamProxy & | proxy,
|  | dgVector *const | contactsOut
| ) |  | const

protected

## § CalculateConvexCastContacts()

dgInt32 dgCollisionConvex::CalculateConvexCastContacts | ( | dgCollisionParamProxy & | proxy | ) | const

## § CalculateConvexToConvexContact()

dgInt32 dgCollisionConvex::CalculateConvexToConvexContact | ( | dgCollisionParamProxy & | proxy | ) | const

## § CalculateInertia()

void dgCollisionConvex::CalculateInertia | ( | void * | userData,
|  | int | vertexCount,
|  | const dgFloat32 *const | FaceArray,
|  | int | faceId
| ) |  |

staticprotected

## § CalculateInertiaAndCenterOfMass()

dgMatrix dgCollisionConvex::CalculateInertiaAndCenterOfMass | ( | const dgMatrix & | m_alignMatrix,
|  | const dgVector & | localScale,
|  | const dgMatrix & | matrix
| ) |  | const

protectedvirtual

Reimplemented from dgCollision.

## § CalculateMassProperties()

dgFloat32 dgCollisionConvex::CalculateMassProperties | ( | const dgMatrix & | offset,
|  | dgVector & | inertia,
|  | dgVector & | crossInertia,
|  | dgVector & | centerOfMass
| ) |  | const

protectedvirtual

Reimplemented from dgCollision.

Reimplemented in dgCollisionDeformableMesh.

## § CalculatePlaneIntersection()

dgInt32 dgCollisionConvex::CalculatePlaneIntersection | ( | const dgVector & | normal,
|  | const dgVector & | point,
|  | dgVector *const | contactsOut,
|  | dgFloat32 | normalSign
| ) |  | const

virtual

Implements dgCollision.

Reimplemented in dgCollisionSphere, dgCollisionConvexPolygon, dgCollisionChamferCylinder, and dgCollisionBox.

## § CalculateVolumeIntegral() [1/2]

dgVector dgCollisionConvex::CalculateVolumeIntegral | ( | const dgMatrix & | globalMatrix,
|  | const dgVector & | plane,
|  | const dgCollisionInstance & | parentScale
| ) |  | const

protectedvirtual

Implements dgCollision.

Reimplemented in dgCollisionNull.

## § CalculateVolumeIntegral() [2/2]

dgVector dgCollisionConvex::CalculateVolumeIntegral | ( | const dgPlane & | plane | ) | const

protected

## § ConvexConicConvexRayCast()

dgFloat32 dgCollisionConvex::ConvexConicConvexRayCast | ( | const dgCollisionInstance *const | convexConicShape,
|  | const dgMatrix & | conicShapeMatrix,
|  | const dgCollisionInstance *const | convexCastingShape,
|  | const dgMatrix & | castingMatrix,
|  | const dgVector & | castingVeloc,
|  | dgFloat32 | maxT,
|  | dgContactPoint & | contactOut
| ) |  | const

protected

## § ConvexConicSupporVertex() [1/2]

dgVector dgCollisionConvex::ConvexConicSupporVertex | ( | const dgVector & | dir | ) | const

protectedvirtual

Reimplemented in dgCollisionSphere, and dgCollisionChamferCylinder.

## § ConvexConicSupporVertex() [2/2]

dgVector dgCollisionConvex::ConvexConicSupporVertex | ( | const dgVector & | point,
|  | const dgVector & | dir
| ) |  | const

protectedvirtual

Reimplemented in dgCollisionSphere, and dgCollisionChamferCylinder.

## § ConvexPolygonsIntersection()

dgInt32 dgCollisionConvex::ConvexPolygonsIntersection | ( | const dgVector & | nornal,
|  | dgInt32 | count1,
|  | dgVector *const | shape1,
|  | dgInt32 | count2,
|  | dgVector *const | shape2,
|  | dgVector *const | contactOut,
|  | dgInt32 | maxContacts
| ) |  | const

protected

## § ConvexPolygonToLineIntersection()

dgInt32 dgCollisionConvex::ConvexPolygonToLineIntersection | ( | const dgVector & | normal,
|  | dgInt32 | count1,
|  | dgVector *const | shape1,
|  | dgInt32 | count2,
|  | dgVector *const | shape2,
|  | dgVector *const | contactOut,
|  | dgVector *const | mem
| ) |  | const

protected

## § ConvexRayCast()

dgFloat32 dgCollisionConvex::ConvexRayCast | ( | const dgCollisionInstance *const | convexShape,
|  | const dgMatrix & | origin,
|  | const dgVector & | veloc,
|  | dgFloat32 | maxT,
|  | dgContactPoint & | contactOut,
|  | const dgBody *const | referenceBody,
|  | const dgCollisionInstance *const | referenceInstance,
|  | void *const | userData,
|  | dgInt32 | threadId
| ) |  | const

virtual

Implements dgCollision.

## § DebugCollision()

void dgCollisionConvex::DebugCollision | ( | const dgMatrix & | matrix,
|  | dgCollision::OnDebugCollisionMeshCallback | callback,
|  | void *const | userData
| ) |  | const

protectedvirtual

Implements dgCollision.

Reimplemented in dgCollisionDeformableMesh, dgCollisionDeformableSolidMesh, dgCollisionConvexHull, dgCollisionChamferCylinder, dgCollisionSphere, and dgCollisionNull.

## § GetBoxMaxRadius()

dgFloat32 dgCollisionConvex::GetBoxMaxRadius | ( |  | ) | const

protectedvirtual

Implements dgCollision.

Reimplemented in dgCollisionConvexPolygon.

## § GetBoxMinRadius()

dgFloat32 dgCollisionConvex::GetBoxMinRadius | ( |  | ) | const

protectedvirtual

Implements dgCollision.

Reimplemented in dgCollisionConvexPolygon.

## § GetConvexVertexCount()

virtual dgInt32 dgCollisionConvex::GetConvexVertexCount | ( |  | ) | const

inlinevirtual

Reimplemented from dgCollision.

## § GetUserData()

void * dgCollisionConvex::GetUserData | ( |  | ) | const

protectedvirtual

## § GetVertexToEdgeMapping()

virtual const dgConvexSimplexEdge** dgCollisionConvex::GetVertexToEdgeMapping | ( |  | ) | const

inlineprotectedvirtual

Reimplemented in dgCollisionConvexHull, and dgCollisionBox.

## § GetVolume()

dgFloat32 dgCollisionConvex::GetVolume | ( |  | ) | const

protectedvirtual

Implements dgCollision.

Reimplemented in dgCollisionPoint, dgCollisionConvexPolygon, and dgCollisionNull.

## § IntesectionTest()

bool dgCollisionConvex::IntesectionTest | ( | dgCollisionParamProxy & | proxy | ) | const

## § MassProperties()

void dgCollisionConvex::MassProperties | ( |  | ) |

protectedvirtual

Reimplemented from dgCollision.

Reimplemented in dgCollisionSphere, and dgCollisionBox.

## § RayCast()

dgFloat32 dgCollisionConvex::RayCast | ( | const dgVector & | localP0,
|  | const dgVector & | localP1,
|  | dgFloat32 | maxT,
|  | dgContactPoint & | contactOut,
|  | const dgBody *const | body,
|  | void *const | userData,
|  | OnRayPrecastAction | preFilter
| ) |  | const

virtual

Implements dgCollision.

Reimplemented in dgCollisionConvexPolygon, dgCollisionNull, dgCollisionSphere, dgCollisionChamferCylinder, and dgCollisionBox.

## § RayCastClosestFace()

dgInt32 dgCollisionConvex::RayCastClosestFace | ( | dgVector * | tetrahedrum,
|  | const dgVector & | origin,
|  | dgFloat32 & | pointDist
| ) |  | const

protected

## § RectifyConvexSlice()

dgInt32 dgCollisionConvex::RectifyConvexSlice | ( | dgInt32 | count,
|  | const dgVector & | normal,
|  | dgVector *const | contactsOut
| ) |  | const

protected

## § ReduceContacts()

dgCollisionConvex::dgPerimenterEdge * dgCollisionConvex::ReduceContacts | ( | dgPerimenterEdge * | poly,
|  | dgInt32 | maxCount
| ) |  | const

protected

## § SanityCheck() [1/2]

bool dgCollisionConvex::SanityCheck | ( | dgPolyhedra & | hull | ) | const

protected

## § SanityCheck() [2/2]

bool dgCollisionConvex::SanityCheck | ( | dgInt32 | count,
|  | const dgVector & | normal,
|  | dgVector *const | contactsOut
| ) |  | const

protected

## § SerializeLow()

void dgCollisionConvex::SerializeLow | ( | dgSerialize | callback,
|  | void *const | userData
| ) |  | const

protectedvirtual

Reimplemented from dgCollision.

## § SetUserData()

void dgCollisionConvex::SetUserData | ( | void *const | userData | ) |

protectedvirtual

## § SetVolumeAndCG()

void dgCollisionConvex::SetVolumeAndCG | ( |  | ) |

protected

## § SimplifyClipPolygon()

dgInt32 dgCollisionConvex::SimplifyClipPolygon | ( | dgInt32 | count,
|  | const dgVector & | normal,
|  | dgVector *const | polygon
| ) |  | const

protected

## § SupportVertex()

dgVector dgCollisionConvex::SupportVertex | ( | const dgVector & | dir,
|  | dgInt32 *const | vertexIndex
| ) |  | const

virtual

Implements dgCollision.

Reimplemented in dgCollisionPoint, dgCollisionConvexPolygon, dgCollisionConvexHull, dgCollisionChamferCylinder, dgCollisionBox, dgCollisionNull, and dgCollisionSphere.

## Friends And Related Function Documentation

## § dgBroadPhase

friend class dgBroadPhase

friend

## § dgCollisionCompound

friend class dgCollisionCompound

friend

## § dgCollisionConvexModifier

friend class dgCollisionConvexModifier

friend

## § dgMinkowskiConv

friend class dgMinkowskiConv

friend

## § dgWorld

friend class dgWorld

friend

## Member Data Documentation

## § m_boxMaxRadius

dgFloat32 dgCollisionConvex::m_boxMaxRadius

protected

## § m_boxMinRadius

dgFloat32 dgCollisionConvex::m_boxMinRadius

protected

## § m_dummySum

dgVector dgCollisionConvex::m_dummySum

static

## § m_edgeCount

dgUnsigned16 dgCollisionConvex::m_edgeCount

protected

## § m_hullDirs

dgVector dgCollisionConvex::m_hullDirs

static

Initial value:
=
{
dgVector(dgFloat32 (0.577350f), dgFloat32 (-0.577350f), dgFloat32 (0.577350f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (-0.577350f), dgFloat32 (-0.577350f), dgFloat32 (-0.577350f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (0.577350f), dgFloat32 (-0.577350f), dgFloat32 (-0.577350f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (-0.577350f), dgFloat32 (0.577350f), dgFloat32 (0.577350f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (0.577350f), dgFloat32 (0.577350f), dgFloat32 (-0.577350f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (-0.577350f), dgFloat32 (0.577350f), dgFloat32 (-0.577350f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (-0.577350f), dgFloat32 (-0.577350f), dgFloat32 (0.577350f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (0.577350f), dgFloat32 (0.577350f), dgFloat32 (0.577350f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (0.000000f), dgFloat32 (-1.000000f), dgFloat32 (0.000000f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (0.000000f), dgFloat32 (1.000000f), dgFloat32 (0.000000f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (1.000000f), dgFloat32 (0.000000f), dgFloat32 (0.000000f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (-1.000000f), dgFloat32 (0.000000f), dgFloat32 (0.000000f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (0.000000f), dgFloat32 (0.000000f), dgFloat32 (1.000000f), dgFloat32 (0.0f)),
dgVector(dgFloat32 (0.000000f), dgFloat32 (0.000000f), dgFloat32 (-1.000000f), dgFloat32 (0.0f)),
}

## § m_priorityOrder

dgCollisionConvex::dgCollisionPriority dgCollisionConvex::m_priorityOrder

static

## § m_rayCastSimplex

dgInt32 dgCollisionConvex::m_rayCastSimplex

static

Initial value:
=
{
{0, 1, 2, 3},
{0, 2, 3, 1},
{2, 1, 3, 0},
{1, 0, 3, 2},
}

## § m_simplex

dgConvexSimplexEdge* dgCollisionConvex::m_simplex

protected

## § m_simplexVolume

dgFloat32 dgCollisionConvex::m_simplexVolume

protected

## § m_userData

void* dgCollisionConvex::m_userData

protected

## § m_vertex

dgVector* dgCollisionConvex::m_vertex

protected

## § m_vertexCount

dgUnsigned16 dgCollisionConvex::m_vertexCount

protected

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

- dynamics.mod/NewtonDynamics/source/physics/dgCollisionConvex.h
- dynamics.mod/NewtonDynamics/source/physics/dgCollisionConvex.cpp