17#ifndef AGXCOLLIDE_SHAPECOLLIDER_H
18#define AGXCOLLIDE_SHAPECOLLIDER_H
24#define SHAPE_COLLIDER_VELOCITIES 0
42# pragma warning( disable : 4251 )
57 virtual ~ShapeCollider() {}
60 TypePair getDescriptor()
const;
63 void calculateContacts(
64 agx::Physics::Geometry::ShapeInstance shape1, agx::Physics::Geometry::ShapeInstance shape2,
68 bool earlyOut, LocalContactPointVector& result);
70 void calculateContacts(
71 agx::Physics::Geometry::ShapeInstance shape1, agx::Physics::Geometry::ShapeInstance shape2,
73 bool earlyOut, LocalContactPointVector& result);
81 LocalContactPointVector& result);
85 LocalContactPointVector& result);
87 static void addContactPoint(LocalContactPointVector& result,
const agx::Vec3& point,
92 static void addEarlyOutMarkerPoint(LocalContactPointVector& result);
96 ShapeCollider(
agx::UInt8 shapeType1,
agx::UInt8 shapeType2) : m_descriptor(shapeType1, shapeType2) {}
98 virtual void _calculateContacts(
99 agx::Physics::Geometry::ShapeInstance shape1, agx::Physics::Geometry::ShapeInstance shape2,
103 bool earlyOut, LocalContactPointVector& result) = 0;
107 TypePair m_descriptor;
113 virtual agxCollide::ShapeCollider* create() = 0;
114 virtual void destroy(agxCollide::ShapeCollider *collider) = 0;
117 template <
typename T>
118 class ShapeColliderPluginT :
public ShapeColliderPlugin
121 ShapeColliderPluginT()
123 PluginManager::instance()->registerPlugin(
this);
126 virtual agxCollide::ShapeCollider* create()
override
131 virtual void destroy(agxCollide::ShapeCollider *collider)
override
140 #define AGX_SHAPE_COLLIDER(T) static agxCollide::ShapeColliderPluginT<T> s_colliderPlugin;
145 AGX_FORCE_INLINE ShapeCollider::TypePair ShapeCollider::getDescriptor()
const
153 agx::Physics::Geometry::ShapeInstance shape1, agx::Physics::Geometry::ShapeInstance shape2,
158 this->calculateContacts(shape1, shape2, transform1, transform2, foo, foo, foo, foo, earlyOut, result);
171 this->calculateContacts(shape1->
getEntity(), shape2->
getEntity(), transform1, transform2,
false, result);
183 this->calculateContacts(
184 shape1->
getEntity(), shape2->
getEntity(), transform1, transform2, linearVelocity1, linearVelocity2,
185 angularVelocity1, angularVelocity2,
false, result);
196 result.push_back(LocalContactPoint(point, (
agx::Vec3f) normal, depth ) );
204 result.back().enabled() =
false;
#define AGXPHYSICS_EXPORT
agx::Physics::Geometry::ShapePtr getEntity() const
Only use as member allocated variable.
A std::pair, with both elements of the same type, and symmetric so (a, b) == (b, a)
Real length2() const
Length squared of the vector = vec .
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
This namespace consists of a set of classes for handling geometric intersection tests including boole...
agx::VectorPOD< LocalContactPoint > LocalContactPointVector
AGXCORE_EXPORT const Real Infinity
AGXPHYSICS_EXPORT agx::Bool equivalent(const agx::AddedMassInteraction::Matrix6x6 &lhs, const agx::AddedMassInteraction::Matrix6x6 &rhs, agx::Real eps=agx::RealEpsilon)