Wheelconstraint - Adobe ATMOSPHERE User Manual

Table of Contents

Advertisement

solver.addConstraint(constraint);
removeAnimator(this);
}
}
addAnimator(loader);

WheelConstraint

A wheel constraint simulates the effects of a wheel being held by a stiff suspension along with a motor to apply torque
to the wheels. There are functions to control the preferred speed of the wheels as well as the desired steering angle of
the wheel. A set of wheel constraints may be used to attach physical models for the wheels to a physical model for a
chassis. A physically realistic vehicle will result.
Properties
strength
The strength or stiffness of the constraint.
tau
The time constant for the constraint, similar to damping.
Methods
setMotorSpeedAndMaxTorque(fl oat speed, fl oat maxTorque)
Sets the desired speed of the motor driving the wheel and the maximum angular force the motor can exert.
setSteeringAngle(fl oat angleInRadians)
Sets the degree of the angle the wheels are turned around the suspension. Valid range is from -180 to 180 degrees.
Default is 0.0 degrees.
setWorldSpacePivotAxleAndSuspension(Vector pivot, Vector axle, Vector suspension)
Sets the point where the wheel constraint is, the axle around which it spins, and the suspension around which
the steering angle is set.
Code Sample
frame = SceneGroup("./frame.aer").add();
wheel = SceneGroup("./wheel.aer").add();
loader = new Object();
loader.timestep = function()
{
if (frame.loaded && wheel.loaded)
{
frame.physicalModel = frame.createPhysicalModel(10);
wheel.physicalModel = wheel.createPhysicalModel(2);
solver = FastConstraintSolver();
373
ADOBE ATMOSPHERE
User Guide

Advertisement

Table of Contents
loading

Table of Contents