A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by misho » Fri Jan 15, 2016 10:32 pm
Is it possible to apply a force on an object at a point other than a geometric centre (or centre of mass), as it seems to be the case? (I'm using version 2.24)
I'd like to apply a thruster force on a spacecraft (actually, 2 thruster forces at opposite ends of the spacecraft) which would result in an attitude change. This would require me to apply it at some distance from it's centre of mass so I can get a torque on one of it's axis and cause it to spin.
I know I can use a force and torque combination (or just a torque) to get the same effect, but I'd like to do this on the simplest level possible.
Thanks,
Misho
-
misho
-
- Posts: 675
- Joined: Tue May 04, 2010 10:13 am
by Stucuk » Sat Jan 16, 2016 8:36 am
NewtonBodyAddImpulse will do what you want. You supply it the position as well as the velocity of the force.
-

Stucuk
-
- Posts: 801
- Joined: Sat Mar 12, 2005 3:54 pm
- Location: Scotland
-
by misho » Sat Jan 16, 2016 1:55 pm
Thanks!
unfortunately, not quite what I was hoping for... first, the point has to be in global space, which means that I have to convert from local to global coordinates. Second, same thing for the velocity vector, I have to convert orientation to global space. Finally, it is an impulse, not force. I have to calculate how much velocity I will get given an amount of force applied at a certain point on a certain object with certain weight (moment of inertia).
I would need something similar to NewtonBodyAddTorque. I suppose I could write a function that takes in a force and position and calculates torque on each of the axis...
Thanks,
Misho
-
misho
-
- Posts: 675
- Joined: Tue May 04, 2010 10:13 am
by JoeJ » Sat Jan 16, 2016 2:38 pm
- Code: Select all
AddGlobalForce (Force, Point)
{
R = Point - BodyMatrix.Position;
Torque = CrossProduct (R, Force);
NewtonAddForce (Force)
NewtonAddTorque (Torque)
}
AddLocalForce (LocalForce, localPoint)
{
GlobaForce = BodyMatrixRotate (LocalForce)
GlobalPoint = BodyMatrixTranform (localPoint)
AddGlobalForce (GlobaForce, GlobalPoint);
}
misho wrote:I know I can use a force and torque combination (or just a torque) to get the same effect, but I'd like to do this on the simplest level possible.
You talk about that code above and answer your own question.
That's laws of physics and you can't simplify them further

-

JoeJ
-
- Posts: 1489
- Joined: Tue Dec 21, 2010 6:18 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests