• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Library] physics.inc
#3
physics.inc v0.5



PHY_RollObject(objectid, toggle = 1, rollingmode = PHY_ROLLING_MODE_DEFAULT, PHY_ROLLING_MODE_ADVANCED)

More realistic rolling of the objects, through calculations made by using quaternions instead of Euler angles. This can be activated by selecting PHY_ROLLING_MODE_ADVANCED in PHY_RollObject.



[Video: https://www.youtube.com/watch?v=-qOY1_9PAec]

Here's a comparison between the old rolling mode (default) and the new one.

As you can see, with the "advanced mode" the change of direction of rolling does not affect the rotation of the ball, thus resulting in a more smooth appearance.



Thanks to gta191977649 for fixing the quaternion calculations and to SimoSbara for merging his code.



UPDATE: changed completely the code for the rolling mode, because it didn't work well; now it does and uses functions taken from i_quat include

demo.pwn, pool.pwn and soccer.pwn have been changed to use the new functionality



https://gyazo.com/4b31bfb69090c51d05cb3fce343050be
  Reply


Messages In This Thread
physics.inc - by Peppe - 2019-06-07, 02:01 PM
RE: physics.inc - by ronfino - 2019-06-07, 04:24 PM
RE: physics.inc - by Peppe - 2019-06-07, 08:39 PM
RE: physics.inc - by Broke - 2019-06-09, 11:48 PM
RE: physics.inc - by RogueDrifter - 2019-07-03, 11:42 AM
RE: physics.inc - by Markski - 2019-07-04, 08:12 PM
RE: physics.inc - by wups - 2019-07-07, 03:22 PM
RE: physics.inc - by J_esus - 2019-07-08, 04:32 AM
RE: physics.inc - by Tama - 2019-10-01, 07:17 AM
RE: physics.inc - by Shaun - 2020-01-17, 03:30 PM

Forum Jump: