[ODE] dBodyGetRotation

adastra@inorbit.com adastra at inorbit.com
Wed Jul 12 08:20:14 MST 2006


Hi Everyone,
I have a problem with the dBodyGetRotation function (ode 4.2)

I set the position and the rotation of my ode body to the correct
position/rotation, I know this because I checked it with TRACE.
I got no collision figure so I checked that the body was infact rotating
according to the matrix I passed into it and, nope, nothing.
Is this an ODE problem or a me problem?!

Here's a bit of my code:

 vtkMatrix4x4 *indexprot = transformIndexp->GetMatrix();
 indexprot->GetElement(0,0),indexprot->GetElement(0,1),indexprot->GetElement(0,2),
 indexprot->GetElement(1,0),indexprot->GetElement(1,1),indexprot->GetElement(1,2),
 indexprot->GetElement(2,0),indexprot->GetElement(2,1),indexprot->GetElement(2,2));

 dMatrix3 indexmatrix;

 for (int indexmatrixrot1=0; indexmatrixrot1<3; indexmatrixrot1++) {
  for (int indexmatrixrot2=0; indexmatrixrot2<3; indexmatrixrot2++) {
   indexmatrix[indexmatrixrot1*3+indexmatrixrot2] =
indexprot->GetElement(indexmatrixrot1, indexmatrixrot2);
  }
 }

dReal odeip_x = indexprot->GetElement(0,3);
dReal odeip_y = indexprot->GetElement(1,3);
dReal odeip_z = indexprot->GetElement(2,3);

dBodySetPosition(handbody[3], odeip_x, odeip_y, odeip_z);
dBodySetRotation(handbody[3],indexmatrix);
dMassTranslate(&m, odeip_x, odeip_y, odeip_z);
dMassRotate(&m, indexmatrix);

TRACE("ODE position is %f, %f, %f\n",odeip_x,odeip_y,odeip_z);
const dReal *bodyrot = dBodyGetRotation(handbody[3]);
TRACE("ODE rotation is\n %f, %f, %f,\n %f, %f, %f,\n %f, %f, %f\n",
indexmatrix[0], indexmatrix[1], indexmatrix[2],
indexmatrix[3], indexmatrix[4], indexmatrix[5],
indexmatrix[6], indexmatrix[7], indexmatrix[8]);

TRACE("ODE rotation is\n %f, %f, %f,\n %f, %f, %f,\n %f, %f, %f\n %f %f
%f\n",
bodyrot[0], bodyrot[1], bodyrot[2],
bodyrot[3], bodyrot[4], bodyrot[5],
bodyrot[6], bodyrot[7], bodyrot[8],
bodyrot[9], bodyrot[10], bodyrot[11]);

Cheers,
Jemma

-- 
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://q12.org/pipermail/ode/attachments/20060712/a8aab6fa/attachment-0001.htm


More information about the ODE mailing list