[ODE] vector force

Tim Sorrells tsorrells at breakawayltd.com
Fri Feb 2 12:55:43 MST 2007


The math here is really simple (even I can handle it!).

 

You've got 2 boxes A and B and you desire a force from A to B with 10
units.  Simply subtract the position of B from A to give you a vector
from A to B.  Normalize the resultant vector then multiply it by 10.
That's your force vector.  Now call dBodyAddForce on box A with those
values.  See?  No trig involved.

 

ODE probably includes the appropriate vector functions to do all that,
although I use a separate math package, so I'm not 100% certain of that.

 

________________________________

From: ode-bounces at ode.org [mailto:ode-bounces at ode.org] On Behalf Of
elekis
Sent: Friday, February 02, 2007 11:14 AM
To: ode at ode.org
Subject: [ODE] vector force

 

hi all, 

noob in ode, I try to make a attraction between 2 object. (witch consist
of gluing a force on the second object.)

the only function I found is dBodyAddForce (Box,a,b,c);.
but we have to calculate the a,b,c. 
is there any function like that putForce(BoxA,boxB,10) who put a force
from A to B with 10 unit???

what I mean is if

A(xa,yb,zc)// a point
B(xa,yb,zc)// a other point 
force = 10 units // the force I wanna applicate on B in the direction of
A; 

I don't see how to calculate a, b, c  for dBodyAddForce (B,a,b,c);
without sinus and cosinus.(maybe my physics is a little old) 
is someone can help me?


thanks a+++

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mooshika.org/pipermail/ode/attachments/20070202/ff2093d0/attachment.htm


More information about the ODE mailing list