17 #ifndef AGXCOLLIDE_SHAPECOLLIDER_H
18 #define AGXCOLLIDE_SHAPECOLLIDER_H
24 #define SHAPE_COLLIDER_VELOCITIES 0
41 # pragma warning(push)
42 # pragma warning( disable : 4251 ) // class X needs to have dll-interface to be used by clients of class Y
57 virtual ~ShapeCollider() {}
60 TypePair getDescriptor()
const;
63 void calculateContacts(
64 agx::Physics::Geometry::ShapeInstance shape1, agx::Physics::Geometry::ShapeInstance shape2,
70 void calculateContacts(
71 agx::Physics::Geometry::ShapeInstance shape1, agx::Physics::Geometry::ShapeInstance shape2,
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,
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;
209 # pragma warning(pop)