OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Raptorsaurus on 13 Sep 2006, 11:28:52
-
OK, here is a parabolic trajectory version of my previous MovePos.sqf (that version was for linear movement). The demo simulates a fire ball being launched from the ground at the truck. The fire moves using setpos, but the positions are calculated using actual physics acceleration formulas.
Included script: setPosMoveGrav.sqs
Included function: MovePosGrav.sqf
The explode.sqs script is just for the eye candy explosion when the fireball hits the truck.
-
Excuse my stupidness, but what does parabolic trajectory mean lol. ???
-
parabola
the explanation wiki style :)
http://en.wikipedia.org/wiki/Parabola (http://en.wikipedia.org/wiki/Parabola)
-
Ahhhhhh... Like a grenade ? :P
-
Yep, like a grenade trajectory, one of a bullet or one of a stone thrown or launched by catapult.
But there's differents sorts of parabola, ones that looks like a valley or others that resemble a hill. Even more sophisticated ones.
Clear?
-
When a moving object with constant speed has a force acting on it in a direction other than its exact instantaneous direction or the exact opposite thereof, its trajectory will be curved. If that force is constant, as in the case of gravity, its path will be parabolic. In the case of this demo, if the fire ball is launched straight up (make the fire ball its own target when the script is called). Its path will not be parabolic. It will go straight up and then straight down because the simulated gravity will act exactly parallel to its movement direction (actually, even that is parabolic, but it is the special case of a "degenerate parabola", which is a straight line - see the link to the wikipedia article posted by Deano). Play around with the demo and you can have some good visual demonstrations of Basic Gravity. Change the acceleration to 1.633, to simulate the gravity on the Moon (1/6 of the Earth's 9.8 m/s/s). Make it 3.266 and it will behave like on Mars (about 1/3 of the Earth's gravity). Also, move the starting point of the fire ball closer or further from the truck, or make the fire ball start out at different altitudes.