[ODE] strange dGeomSetRotation problem

Krystian Ligenza kxxl at poczta.onet.pl
Mon Jul 23 00:22:31 MST 2007


>> when I set rotation using matrix:
>>
>> [     0.0     0.0     1.0     ]
>> [     0.0   -1.0    -0.0     ]
>> [     1.0     0.0    -0.0     ]
>>
>> then I get that matrix from geom and this is what i get:
>>
>> [      1.0     0.0     0.0     ]
>> [     -0.0     1.0     0.0     ]
>> [      0.0    -0.0     1.0     ]
>
> Please post the code you are using to set and get the rotation matrix.
> And which ODE version you are using.

There is too much code to present, so I will show basic idea. I move
animation for skeleton to my ragdoll (but when driven ragdoll from animation
it do not have joints between bodies!). Update look something like that:

Update(){
    //move info from skeleton to ODE
    for(each bone){
        //getting and counting pos, vX,vY,vZ,avX,avY,avZ
        //from skeleton for bone
        ...
        //setting part
        dGeomSetPosition(bone.symModel, pos[0], pos[1], pos[2] );
        dGeomSetRotation(bone.symModel,R);
        dBodySetLinearVel(dGeomGetBody(bone.symModel),vX,vY,vZ);
        dBodySetAngularVel(dGeomGetBody(bone.symModel),avX,avY,avZ);
    }

    //check part, I get all bone and show them as boxes to see if all data
are set ok
    for(each bone){
        const dReal* bonePos;
        const dReal* R;
        bonePos = dGeomGetPosition(bone.symModel);
        R = dGeomGetRotation(bone.symModel);

        //set this to corresponding box
        ....
    }

    //process physics engine to move objects that are not driven by
animation
    dSpaceCollide(...);
    dWorldQuickStep(...);
    dJointGroupEmpty(...);
}

I use ODE 0.8, and when I was writting this I see that there are 3 potential
places, where data can be corrupt:
1) when I set data to ODE geoms
2) when I get data from ODE geoms
3) when I set data to show boxes in engine

is it possible that ODE corrupt this?

I would like to assure, that everything works ok, except some cases, like
this presented in first post. As a result of this corruption few frames of
all animation have "bone jumps".

Thanks,
Krystian

> -- 
> Daniel K. O. 



More information about the ODE mailing list