Within my "ndContactNotify" callback class, I'm trying to get the contact points from within this function;
- Code: Select all
void PhysicsContactCallback::OnContactCallback(const ndContact* contact, ndFloat32 timestep) const {
auto body0 = contact->GetBody0();
auto body1 = contact->GetBody1();
//auto map = body0->GetContactMap();//inaccessible, won't compile
auto points = contact->GetContactPoints();//crashes when called
However GetContactMap() is inaccessible and won't compile and GetContactPoints() crashes here in "ndList.h"
- Code: Select all
template<class T, class allocator>
ndList<T, allocator>::ndList(const ndList& src)
:ndClassAlloc()
,m_first(src.m_first)
,m_last(src.m_last)
,m_count(src.m_count)
{
//steal the members.
//yes I know this is wrong, I have to add the move semantic,
//but since my code predate move semantic, I will do my own steal
//this will work as long as src is empty
ndAssert(src.m_count == 0);
ndAssert(src.m_first == nullptr);
ndAssert(src.m_last == nullptr);
}
I see why the program is crashing here based on the Asserts, but should it be? Is there a better way to find out the contact positions?
Thankyou!