linear limits in world coordinates

marios
Posts: 52
Joined: Mon Jul 19, 2010 3:11 am

linear limits in world coordinates

Post by marios »

I am playing with btGeneric6DofSpringConstraint and during simulation I like to know linear constraint limits in world coordinates (first body is fixed). I was trying to achieve that by doing calculations with frameA, frameB, calculatedTransformA and calculatedTransformA but without good result. I need it to know when body reach constraint linear limit. Thanks for any help
marios
Posts: 52
Joined: Mon Jul 19, 2010 3:11 am

Re: linear limits in world coordinates

Post by marios »

Ok i managed to do that. Constraint limit in world coordinates is :

Code: Select all

constraint->getLinearLowerLimit(lowLimit);
lowLimit=lowLimit  -
constraint->getFrameOffsetB().getOrigin()  +
constraint->getFrameOffsetA().getOrigin();

//low limit is now in world coordinates
note tat there is no rotations, with rotations it doesn't work, perhaps some vector must be multiplied by matrix