| PhysicalWheel
The PhysicalWheel
object is used in conjunction with the Entity object for physically modeling
vehicles.
The PhysicsWheel.long???
and PhysicsWheel.lat??? properties are used to describe tire properties.
Lateral and longitudal directions are calculated differently. They both
take a measure for tire slip as input and produce a force or impulse as
an output.
For people
who are interested in the technical details the curve is a two piece cubic
Hermite spline. Looking at the graph below, in the first part of the curve
(0,0) to (extremumSlip, extremumValue), at which point the curve's tangent
is zero. The second section goes from (extremumSlip, extremumValue) to
(asymptoteSlip, asymptoteValue), at which point the curve's tangent is
again zero.

Properties
type
| |
Usage |
String
= PhysicalWheel.type |
| |
Description |
Obtains
the type of the object which is PhysicalWheel. (Read Only) |
| |
Return
Value |
Returns
the type of the object as a string. |
| |
Example
|
// Get the type of the object
if ( PhysicalWheel.type == "PhysicalWheel" )
Chat.print( "Object is of type PhysicalWheel" ); |
suspensionSpring
| |
Usage |
Entity
= PhysicalWheel.suspensionSpring |
| |
Description |
Determines
or sets the suspension spring coefficient. Essentially how springy
is the suspension on the wheel.
|
| |
Return
Value |
Returns
the current suspension spring coefficient value. |
| |
Example
|
// Set the springy ness of the suspension
oPhysicalWheel.suspensionSpring = 200; |
suspensionDamper
| |
Usage |
Entity
= PhysicalWheel.suspensionDamper |
| |
Description |
Determines
or sets suspension damper coefficient. Essentially how quickly does
the spring come to rest. The vehicle equivalent is the shock absorber.
The value must be greater than or equal to 0. |
| |
Return
Value |
Returns
the second entity involved in the collision or contact. |
| |
Example
|
// Set the amount of damping applied to the suspension
oPhysicalWheel.suspensionDamper = 50; |
suspensionTargetValue
| |
Usage |
Double
= PhysicalWheel.suspensionTargetValue |
| |
Description |
Determines
or sets the suspension target value (angle/position) of the suspension
spring where the spring force is zero. Essentially the length of
the spring when at rest along the distance specified in the PhysicalWheel.suspensionTravel
property. Valid values range from 0 to 1. The default valu is 0. |
| |
Return
Value |
Returns
the current target value for the suspension spring. |
| |
Example
|
// Set the suspension target value
oPhysicalWheel.suspensionTargetValue = 100; |
longExtremumSlip
| |
Usage |
Double
= PhysicalWheel.longExtremumSlip |
| |
Description |
Determines
or sets the extremal point of the curve. The value must be greater
than or equal to 0. The defualt value is 1.0 |
| |
Return
Value |
Returns
the current longitudal extremum slip. |
| |
Example
|
// Set the longitudal extremum slip
0PhysicalWheel.longExtremumSlip = 1.0; |
latExtremumSlip
| |
Usage |
Double
= PhysicalWheel.latExtremumSlip |
| |
Description |
Determines
or sets the extremal point of the curve. The value must be greater
than or equal to 0. The default value is 1.0 |
| |
Return
Value |
Returns
the current lateral extremum slip. |
| |
Example
|
// Set the lateral extremum slip
0PhysicalWheel.latExtremumSlip = 1.0; |
longExtemumValue
| |
Usage |
Double
= PhysicalWheel.longExtremumValue |
| |
Description |
Determines
or sets the extremal point of the curve. The value must be greater
than or equal to 0. The defualt value is 0.02
|
| |
Return
Value |
Returns
the current longitudal extremum value. |
| |
Example
|
// Set the longitudal extremum value
oPhysicalWheel.longExtremumValue = 0.02; |
latExtemumValue
| |
Usage |
Double
= PhysicalWheel.latExtremumValue |
| |
Description |
Determines
or sets the extremal point of the curve. The value must be greater
than or equal to 0. The defualt value is 0.02 |
| |
Return
Value |
Returns
the current lateral extremum value. |
| |
Example
|
// Set the lateral extremum value
oPhysicalWheel.latExtremumValue = 0.02; |
longAsymptoteSlip
| |
Usage |
Double
= PhysicalWheel.longAsymptoteSlip |
| |
Description |
Determines
or sets point on curve at which for all x > minumumX, function
equals minimumY. The value must be greater than or equal to 0. The
defualt value is 1.0. |
| |
Return
Value |
Returns
the current longitudal asymptote slip. |
| |
Example
|
// Set the lateral extremum value
oPhysicalWheel.longAsymptoteSlip = 1.0; |
latAsymptoteSlip
| |
Usage |
Double
= PhysicalWheel.latAsymptoteSlip |
| |
Description |
Determines
or sets point on curve at which for all x > minumumX, function
equals minimumY. The value must be greater than or equal to 0. The
defualt value is 1.0. |
| |
Return
Value |
Returns
the current lateral asymptote slip. |
| |
Example
|
// Set the lateral extremum value
oPhysicalWheel.latAsymptoteSlip = 1.0; |
longAsymptoteValue
| |
Usage |
Double
= PhysicalWheel.longAsympoteValue |
| |
Description |
Determines
or sets point on curve at which for all x > minumumX, function
equals minimumY. The value must be greater than or equal to 0. The
default value is 0.01. |
| |
Return
Value |
Returns
the current longitudal asymptote value. |
| |
Example
|
// Set the longitudal asymptote value
oPhysicalWheel.longAsymptoteValue = 0.01; |
latAsymptoteValue
| |
Usage |
Double
= PhysicalWheel.latAsympoteValue |
| |
Description |
Determines
or sets point on curve at which for all x > minumumX, function
equals minimumY. The value must be greater than or equal to 0. The
default value is 0.01. |
| |
Return
Value |
Returns
the current lateral asymptote value. |
| |
Example
|
// Set the lateral asymptote value
oPhysicalWheel.latAsymptoteValue = 0.01; |
longStiffnessFactor
| |
Usage |
Vector
= PhysicalWheel.longStiffnessFactor |
| |
Description |
Determines
or sets the scaling factor for tire force. An additional overall
positive scaling that is applied to tire forces before they are
passed to the solver. Higher values make improve grip. Increasing
the PhysicsWheel.longExtremumValue property may require that this
property's value be lowered. Setting this property to 0 zero will
disable all longitudal friction. The default value is 1000000.0
|
| |
Return
Value |
Returns
the normal impulse of the contact or collision. |
| |
Example
|
// Set the stiffnessfactor
oPhysicalWheel.longStifnessFactor = 500000.0; |
latStiffnessFactor
| |
Usage |
Vector
= PhysicalWheel.latStiffnessFactor |
| |
Description |
Determines or sets the scaling factor for tire force. An additional
overall positive scaling that is applied to tire forces before they
are passed to the solver. Higher values make improve grip. Increasing
the PhysicsWheel.latExtremumValue property may require that this
properties value be lowered. Setting this property to 0 zero will
disable all lateral friction. The default value is 1000000.0 |
| |
Return
Value |
Returns
the normal impulse of the contact or collision. |
| |
Example
|
// Set the stiffness factor
oPhysicalWheel.latStifnessFactor = 500000.0; |
longInputSlipVelocity
| |
Usage |
Double
= PhysicalWheel.longInputSlipVelocity |
| |
Description |
Enables
or disables using the longitudinal slip velocity as input for the
tire properties, rather than the slip angle. When set to true the
longitudinal slip velocity is used.
|
| |
Return
Value |
Returns
true if the longitudinal slip velocity is used as input to the tire
properties. |
| |
Example
|
// Use longitudal slip velocity as input to tire properties
PhysicalWheel.longInputSlipVelocity; |
latInputSlipVelocity
| |
Usage |
Boolean
= PhysicalWheel.latInputSlipVelocity |
| |
Description |
Enables
or disables using the lateral slip velocity as input to the tire
properties, rather than the slip angle. When set to true the lateral
slip velocity is used. |
| |
Return
Value |
Returns
true if the lateral slip velocity is used as input to the tire properties. |
| |
Example
|
// Use lateral slip velocity as input to tire properties
PhysicalWheel.longInputSlipVelocity; |
axisContactNormal
| |
Usage |
Boolean
= PhysicalWheel.axisContactNormal |
| |
Description |
Determines
if the
suspension axis or the ground contact normal is used for the suspension
constraint. When set to true the ground contact normal is used.
The default value is false.
|
| |
Return
Value |
Returns
true if the ground contact normal is being used for the suspension
constraint |
| |
Example
|
// Use the ground contact normal for the suspension constraint
oPhysicalWheel.axisContactNormal = true; |
unscaledSpringBehavior
| |
Usage |
Boolean
= PhysicalWheel.unscaledSpringbehavior |
| |
Description |
Determines
how suspension travel and wheel radius from the suspension spring
is handled. When set to true, the system does not factor out the
suspension travel and wheel radius from the spring force computation.
|
| |
Return
Value |
Returns
true if the system should not factor out suspendion travel and wheel
radius from the spring force computaton.. |
| |
Example
|
// Stop the system from factoring in suspension travel etc.
oPhysicalWheel.unscaledSpringBehavior = true; |
axleSpeedOverride
| |
Usage |
Boolean
= PhysicalWheel.axleSpeedOverride |
| |
Description |
Enables
or disables axle speed override. If set to true, the axle speed is
not computed by the simulation. It should therefore be specified directly
every frame using the PhysicalModel.axleSpeed property. |
| |
Return
Value |
Returns
true if axle speed override is enabled. |
| |
Example
|
// Set the axle speed
oEntity.physicalModel.axleSpeedOverride = true;
this.oTimestep1 = new Object(); this.oTimestep1.oEntity = oEntity; this.oTimestep1.timestep = function( dElapsedTime, dDeltaTime ) { this.oEntity.physicalWheel.axleSpeed = 500;
} |
suspensionTravel
| |
Usage |
Double
= PhysicalWheel.suspensionTravel |
| |
Description |
Determines
or sets the maximum extension distance of suspension along the Entity's
-Y axis. Essentially what is the longest the suspension spring can
be stretched to. Valid
values 0 to infinite.
|
| |
Return
Value |
Returns
the current length of suspension travel. |
| |
Example
|
// Set the length of suspension travel
oPhysicalWheel.suspensionTravel = 50; |
inverseWheelMass
| |
Usage |
Double
= PhysicalWheel.inverseWheelMass |
| |
Description |
Determines
or sets the inverse mass of the wheel which determines the wheel velocity
that wheel torques can achieve.
The default value is 1.0, values must be greater than or equal to
0. |
| |
Return
Value |
Returns
the current inverse wheel mass. |
| |
Example
|
// Set the inverse wheel mass
oPhysicalWheel.inverseWheelMass = 2.0; |
motorTorque
| |
Usage |
Double
= PhysicalWheel.motorTorque |
| |
Description |
Determines
or sets the engine torque on the wheel axle. Use positive values to
move forward and negative values to reverse.
This property will have no effect if PhysicalMaterial.axleSpeedOverride
is set to true. |
| |
Return
Value |
Returns
the current engine torque. |
| |
Example
|
// Set the engine torque
oPhysicalWheel.motorTorque = 500; |
brakeTorque
| |
Usage |
Double
= PhysicalWheel.brakeTorque |
| |
Description |
Determines
or sets the brake torque. Increasing the value of this property is
the equivalent of applying the brakes in a car. Values must be greater
than or equal to 0. Very large values will lock wheel. This property
will have no effect if PhysicalMaterial.axleSpeedOverride is set to
true.
|
| |
Return
Value |
Returns
the current brake torque. |
| |
Example
|
// Set the brake torque
oPhysicalWheel.brakeTorque = 10; |
steerAngle
| |
Usage |
Double
= PhysicalWheel.steerAngle |
| |
Description |
Determines
or sets the steering angle, around Entity's Y axis. Valid values are
-PI to PI. |
| |
Return
Value |
Returns
the current steer angle around the Entity's Y axis. |
| |
Example
|
// Set the steer angle
oPhysicalWheel.steerAngle = 0.5; |
axleSpeed
| |
Usage |
Double
= PhysicalWheel.axleSpeed |
| |
Description |
Determines
or sets the current axle rotation speed. This property only has
an effect if the PhysicalWheel.axleSpeedOverride property is set
to true. If
the PhysicalWheel.axleSpeedOverride property is set to true the
PhysicalWheel.motorTorque and PhysicalWheel.brakeTorques properties
are ineffective. This
property must be set for every frame. Values can be positive or
negative depending on the direction of rotation.
|
| |
Return
Value |
Returns
the current axle speed. |
| |
Example
|
// Set the axle speed
oEntity.physicalModel.axleSpeedOverride = true;
this.oTimestep1 = new Object(); this.oTimestep1.oEntity = oEntity; this.oTimestep1.timestep = function( dElapsedTime, dDeltaTime ) { this.oEntity.physicalWheel.axleSpeed = 500;
} |
|