• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

(Realistic) Sliding?!! Halp

Status
Not open for further replies.
Level 3
Joined
Jun 14, 2007
Messages
56
Yeeah, SUP G

So what I'm trying to do is create a realistic 'sliding' movement style.

A 'car on ice' type situation. And realistic, not like the maze games from war3 where you would have maneouver between objects with complete control over steering, but rather one where you try to steer but you would slide outwards when taking corners, etc

So basically its a question of acceleration!

At the moment:
JASS:
real acceleration = 0.01 (constant)
real x velocity
real y velocity
unit u
real x
real y
point d

if the x of u < the x of point d then
set x velocity = x velocity + acceleration
else
set x velocity = x velocity - acceleration

and then repeat for Y values

and then move unit to his location + x velocity + y velocity

(the above written correctly)


This gives a rough simulation of what I want, he accelerates towards a point and curves out on some corners, but its far from perfect.

So please, people of the interweb may you help me with this functionn?

What am I doing wrong, good sir? Should I be using vectors for acceleration? Or is the effect achieved in a completerly different way?!
 
Level 7
Joined
Apr 23, 2007
Messages
326
Also you need to account for the friction generated by the tires and the object's directed momentum not to mention the surface of the...

Meh try vectors they never hurt anyone.
 
Status
Not open for further replies.
Top