Home   Help Search Login Register  

Author Topic: Distance to impact!  (Read 2626 times)

0 Members and 1 Guest are viewing this topic.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Distance to impact!
« Reply #15 on: 18 Sep 2005, 02:03:39 »
Kinematics. Smells like physics to me!

Anyhow, I hope you have success in this respect; the only times I've tried to use physics to solve problems in ofp, such as points of impact, the damn random element always gets me, ie a shell doesnt land in the same place twice when created and setvelocity'd at the same spot twice... and the whole using script to time things always causes problems. I gave up.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Distance to impact!
« Reply #16 on: 18 Sep 2005, 07:04:26 »
What is physics?  This could get deep and off topic pretty quickly, so I won't start even though I have a lot to say on the subject.

Bluelikeu:  Physics or maths I am glad you felt inspired.  The formula you use (S = ...) is indeed the one I used, there are a couple of comments I would make for the sake of clarity:

Quote
u = initial speed of the object

Should read:

u = initial vertical  velocity of the object

Two points here:
1. Any horizontal movement is irrelevant to the calculation.  That is why my formula uses:
u*sin(angle of elevation) where u is the initial velocity of the object.  (incidentally u*cos (angle of elevation) will give the horizontal velocity of the object)

2. It is still a velocity not a speed.  That is, its direction is important.  Imagine the shooter is on top of a hill firing downwards u would then need to be represented by a negative number in your formula.
« Last Edit: 18 Sep 2005, 07:09:46 by THobson »

Offline RobinHansenDK

  • Members
  • *
  • I'm a llama!
Re:Distance to impact!
« Reply #17 on: 24 Sep 2005, 12:24:00 »
Tnx for all the replies...I'm glad that a lot of people actually shows interrest in my problem. I don't have enougt time ATM due to work and studies so - can someone make the script for me? ;)