I have been looking at the 'Cyclone' physics engine for helping me build my own simplified one.
Was looking through and found this:
void RigidBody::addForceAtPoint(const Vector3 &force, const Vector3 &point)
{
// Convert to coordinates relative to center of mass.
Vector3 pt = point;
pt -= position;
forceAccum += force;
torqueAccum += pt % force;
}
//note that both the point and the force were given in world coordinates, neither in body coordinates
Surely thats not correct. The forceaccum is used to add up all the forces and then take the sum to calculate the acceleration of the linear velocity of the body. Using this method would mean that if you were in deep space and a pencil was floating still in the air, if you were to push on the end of the pencil in a sudden moment, the linear velocity of the pencil would be the same as if you had pushed on the center of the pencil (center of mass). I think what would actually happen is the pencil would just spin, and not move in a linear velocity, but just a rotational one, as all the force would be turned into torque.
Am i right? or is the method right instead and you can just sum the forces, no matter where they are applied to a body, and use that for calculating the linear acceleration?
Was looking through and found this:
void RigidBody::addForceAtPoint(const Vector3 &force, const Vector3 &point)
{
// Convert to coordinates relative to center of mass.
Vector3 pt = point;
pt -= position;
forceAccum += force;
torqueAccum += pt % force;
}
//note that both the point and the force were given in world coordinates, neither in body coordinates
Surely thats not correct. The forceaccum is used to add up all the forces and then take the sum to calculate the acceleration of the linear velocity of the body. Using this method would mean that if you were in deep space and a pencil was floating still in the air, if you were to push on the end of the pencil in a sudden moment, the linear velocity of the pencil would be the same as if you had pushed on the center of the pencil (center of mass). I think what would actually happen is the pencil would just spin, and not move in a linear velocity, but just a rotational one, as all the force would be turned into torque.
Am i right? or is the method right instead and you can just sum the forces, no matter where they are applied to a body, and use that for calculating the linear acceleration?