Home   Help Search Login Register  

Author Topic: Move Objects in Parabolic path using setPos (new function:MovePosGrav.sqf)  (Read 2712 times)

0 Members and 1 Guest are viewing this topic.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
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.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Excuse my stupidness, but what does parabolic trajectory mean lol. ???

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
 parabola
  the explanation wiki style :)
           http://en.wikipedia.org/wiki/Parabola
I love ofp

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Ahhhhhh... Like a grenade ? :P

Offline Cheetah

  • Former Staff
  • ****
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?
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
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.
« Last Edit: 18 Jun 2008, 20:37:58 by Raptorsaurus »