Hi,
I know that this isn't Newton dynamics forum, but many people here know a lot about Newton, there so i decided to ask.
I'am writing simulation of cannon using irrlicht and newton. I managed to do Newton car for cannon cart but i can't make the cannon ball to move.
I mean that I dont know how to add force of shot and air friction force.
I have all forces counted up, but I dont know how to add them to newton.
I tried to add them to NewtonBodySetForceAndTorqueCallback function with gravity, but i dont know how to do that, when i tried:
dVector force (ShotForce-AriFriction,- mass * NEWTON_GRAVITY , 0.0f);
But it didn't work. Another thing I would like to add to simulation is side wind, but I dont know how to do that either.
Thanks for help (I'am sorry for my english but I'am beginner)
Cannonball simulation
Yep, you'll have to add your forces somewhat like that in the callback. Also make sure that the cannon body is not in a froozen state, if it is then the callback won't be called unless something touches it or it's moving.
About the air friction, i think there is some parameter in newton for dampening of motion, sortof. If i'm not mistaken that is just what air friction is.
About the wind, i'd make some kind of function that returns a vector of how much wind there is at a given point, like vector3df GetWindVector(const vector3df &Point) and call it in the callback and add the returned value to the force you add. Sortof.
About the air friction, i think there is some parameter in newton for dampening of motion, sortof. If i'm not mistaken that is just what air friction is.
About the wind, i'd make some kind of function that returns a vector of how much wind there is at a given point, like vector3df GetWindVector(const vector3df &Point) and call it in the callback and add the returned value to the force you add. Sortof.
If you don't have anything nice to say, don't say anything at all.