Jump to content
BroncoBuster

quicker stopping of angular turning

Recommended Posts

What is the difference between VEHICLE_ANGULAR_FRICTION_TIMESCALE and VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE ??

- I want my vehicle to stop turning more quickly,  so which should I change, and should I make it a smaller value ?

 

 

Share this post


Link to post
Share on other sites

I'm a little fuzzy on the details, but according to some notes I wrote to myself in the past:

Angular motor direction is the vehicle's "velocity around the Z axis," meaning how fast it's currently trying to turn to the side.
Angular motor decay is how fast that velocity decreases to 0, meaning the vehicle will stop turning without input and just driving straight.

Linear friction timescale is how fast the vehicle will "roll to a stop" after you stop accelerating.
Angular friction timescale is how fast the vehicle will stop "drifting" sideways for example after making a sharp turn at high speed, or bumped by another object.

I don't know how accurate these statements are. I haven't really used vehicle params.

Share this post


Link to post
Share on other sites
Posted (edited)

The timescale parameters govern how long it takes in seconds for whatever associated attribute to take hold. So yes, smaller values generally make them more responsive. I find this quote from the Linden Vehicle tutorial helpful:

Quote

In other words, it is the timescale for exponential decay toward full compliance to the desired behavior. When you want the vehicle to be very responsive use a short timescale of one second or less, and if you want to disable a behavior then set the timescale to a very large number like 300 (5 minutes) or more. Note, for stability reasons, there is usually a limit to how small a timescale is allowed to be, and is usually on the order of a tenth of a second. Setting a timescale to zero is safe and is always equivalent to setting it to its minimum.

As for the difference between the friction and motor decay parameters...

Friction timescale is how long it takes friction to bring the vehicle to a stop - whether that's movement along the XYZ axes (linear) or rotating about its reference frame (angular). So a small value for your angular friction timescale would mean its rotations would quickly succumb to friction and therefore stop turning. See this section.

Motor decay on the other hand is how long it takes the effectiveness of the motor to degrade to zero without any other intervention.

Both of these parameters can be used together in different ways to achieve similar behaviors. Again, the Linden tutorial gives some examples:

Quote

When steering a vehicle you probably do not want it to turn very far or for very long. One way to do it using the angular motor would be to leave the decay timescale long, enable a significant amount of angular friction (to quickly slow the vehicle down when the motor is turned off) then set the angular motor to a large vector on a key press, and set it to zero when the key is released. Another way to do it is to set the VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE to a short value and push the vehicle about with a more impulsive method that sets the motor fast on a key press down (and optionally setting the motor to zero on a key up) relying on the automatic exponential decay of the motor's effectiveness rather than a constant angular friction.

Setting the angular motor to zero magnitude is different from allowing it to decay. When the motor completely decays it no longer affects the motion of the vehicle, however setting it to zero will reset the "grip" of the vehicle and will make the vehicle try to achieve zero angular velocity.

 

Edited by Fenix Eldritch
word change

Share this post


Link to post
Share on other sites
Posted (edited)

Scratches my head -- they both seem quite similar, I *think* you need a smaller friction timescale to make the angular rotation stop more quickly.  The angular motor decay will stop the force causing more angular motion but it wont stop until friction slows it down and stops it.

 

Edited by Always Stillwater

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...