Newton2 - Joint info body pointers unset?

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Newton2 - Joint info body pointers unset?

Postby Aphex » Thu Aug 21, 2008 8:14 am

Just using the new sdk and noticed in the collision callback I got the joint info from the contact joint, and the m_attachBody_0/1 members were unset. Are these supposed to be the coliding bodies?
NewtonJointGetBody0/1 still work ok...
Aphex
 
Posts: 144
Joined: Fri Jun 18, 2004 6:08 am
Location: UK

Re: Newton2 - Joint info body pointers unset?

Postby Julio Jerez » Thu Aug 21, 2008 10:34 am

Aphex wrote:Just using the new sdk and noticed in the collision callback I got the joint info from the contact joint, and the m_attachBody_0/1 members were unset


?
can you post a code fragment?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton2 - Joint info body pointers unset?

Postby Aphex » Thu Aug 21, 2008 4:12 pm

sure:
Code: Select all
void CPhysEngWrapper::ProcessContact(const NewtonJoint* aContactJoint, dFloat aTimestep, int aThreadIndex)
{
   for (void* contact=NewtonContactJointGetFirstContact(aContactJoint) ; contact ; contact=NewtonContactJointGetNextContact(aContactJoint, contact))
   {
//todo: find max speed collision and use that:
      NewtonJointRecord info;
      NewtonJointGetInfo(aContactJoint, &info);
      mBody1 = info.m_attachBody_0;            // m_attachBody_0 ptr = garbage
      mBody1 = NewtonJointGetBody1(aContactJoint);   //works fine
...
}
Aphex
 
Posts: 144
Joined: Fri Jun 18, 2004 6:08 am
Location: UK

Re: Newton2 - Joint info body pointers unset?

Postby Julio Jerez » Thu Aug 21, 2008 4:28 pm

Oh I see whe you mean.
The contact joint do not feel the info record, because I did not implement the virtual function, but there is not reason why it should not work.
Thanks for the bug report, I will fix it.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 4 guests

cron