Calculate Z from object position
#1

I can't calculate good Z position from object to next object position infront.
I'm using 0.3z callback for weapon shot position.

Look at image:
Low angle from shot position to destination

Big angle from shot position to destination

Middle angle from shot position to destination


CODE: http://pastebin.com/W8dYvtSS

Log:
Код:
[17:25:24] Angle: 10.8, Heigh: 3.73
[17:25:40] Angle: -3.6, Heigh: -1.28
[17:26:01] Angle: 34.5, Heigh: 10.83
[17:26:09] Angle: 28.2, Heigh: 9.19
[17:26:16] Angle: -2.6, Heigh: -0.93
[17:26:55] Angle: 13.1, Heigh: 4.52
[17:27:26] Angle: -5.3, Heigh: -1.86
[17:27:50] Angle: 40.1, Heigh: 12.11
[17:27:59] Angle: -32.0, Heigh: -10.20
[17:28:05] Angle: 5.8, Heigh: 2.02
[17:29:10] Angle: 15.3, Heigh: 5.26
[17:29:33] Angle: 2.8, Heigh: 0.98
[17:30:00] Angle: 31.6, Heigh: 10.10
I want to make long rope for hook, but as you can see, the Z position is calculated wrong.
If the angle between start pos to end pos is bigger than 10, the Z offset is lower or higher than destination Z level.
It is floatsin issue or what?


//edit
Solved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)