6 #include "VsSimulator.h"
10 namespace Visualization
17 VsIntersectionEvent::VsIntersectionEvent() :
18 VxUniverse::IntersectSubscriber()
23 VsIntersectionEvent::~VsIntersectionEvent()
30 {
Std_TraceMsg(0,
"Caught Error in desctructor of VsIntersectionEvent\r\n",
"", -1,
false,
true);}
33 void VsIntersectionEvent::notifyIntersect(VxUniverse::eIntersectEventType type, VxIntersectResult* inResult, VxDynamicsResponseInput* inResp)
36 if ( type == VxUniverse::kEventFirst )
39 inResult->getEntityPair(&e1, &e2);
43 void *v1 = e1->getUserData();
44 void *v2 = e2->getUserData();
48 RigidBody *lpBody1 = (RigidBody *) v1;
49 RigidBody *lpBody2 = (RigidBody *) v2;
51 if( !((lpBody1->Parent() == lpBody2) || (lpBody2->Parent() == lpBody1)) )
53 lpBody1->AddSurfaceContact(lpBody2);
54 lpBody2->AddSurfaceContact(lpBody1);
61 void VsIntersectionEvent::notifyDisjoint(VxUniverse::eIntersectEventType type, VxIntersectResult* inResult)
63 if ( type == VxUniverse::kEventDisjoint )
66 inResult->getEntityPair(&e1, &e2);
70 void *v1 = e1->getUserData();
71 void *v2 = e2->getUserData();
75 RigidBody *lpBody1 = (RigidBody *) v1;
76 RigidBody *lpBody2 = (RigidBody *) v2;
78 if( !((lpBody1->Parent() == lpBody2) || (lpBody2->Parent() == lpBody1)) )
80 lpBody1->RemoveSurfaceContact(lpBody2);
81 lpBody2->RemoveSurfaceContact(lpBody1);
Simulator * m_lpSim
The pointer to a Simulation.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.