These pages are auto-generated from self-documenting comments embedded in class files.

For more information on breve and steve, refer to the breve homepage.

Real : Mobile

Class Description:

Mobile objects are objects in the simulated world which move around and interact with other objects. This is in contrast to Stationary objects which can collide and interact with other objects but which never move.

When a Mobile object is created, it will be by default a simple sphere. You can change the appearence of this sphere by using methods in this class, or its parent class Real. Or you can change the shape altogether with the method set-shape.

Class methods:

Setting Up the Mobile Object

Configuring Physics Parameters

Getting the Light Exposure of this Mobile Object

Controlling the Agent's Motion and Position

Chaning the Object's Appearence


disable-physics

Disables the physical simulation for a Mobile object.

Note that disabling physics for instances of the subclass MultiBody may produce unexpected results and is not recommended.


enable-physics

Enables physical simulation for a Mobile object. This must be used in conjunction with a PhysicalControl object which sets up physical simulation for the entire world.

When physics is enabled for an object, the acceleration can no longer be assigned manually--it will be computed from the forces applied to the object.


get-acceleration

Returns the vector acceleration of this object.


get-color

Returns the color of the object.


get-distance from otherObject (object)

Returns the scalar distance from this object's center to otherObject.


get-light-exposure

When used in conjunction with light exposure detection (enable-light-exposure-detection (Control)), this method returns the level of light exposure on this object.


get-location

Returns the vector location of this object.


get-rotation

Returns the matrix rotation of this object.


get-rotational-velocity

Returns the vector angular velocity of this object.


get-velocity

Returns the vector velocity of this object.


move to newLocation (vector)

Moves this object to location newLocation.


offset by amount (vector)

Moves this object by amount.


point vertex theVertex (vector) at theLocation (vector)

An easier way to rotate an object--this function rotates an object such that the local point theVertex, points towards the world direction theLocation. In other words, theLocation is where you want the object to face, and theVertex indicates which side of the object is to be considered the "front".


register with-shape theShape (object)

Use of this method is depreciated, use set-shape instead.


relative-rotate around-axis thisAxis (vector) by amount (float)

Sets the rotation of this object around vector axis thisAxis by scalar amount (in radians). This is a rotation relative to the current position.


remove-label

Removes the label that would be drawn next to an object.


rotate around-axis thisAxis (vector) by amount (float)

Sets the rotation of this object around vector axis thisAxis by scalar amount (in radians). This is an "absolute" rotation--the current rotation of the object does not affect how the object will be rotated. For a rotation relative to the current orientation, set relative-rotate.


set-acceleration to newAcceleration (vector)

Sets the acceleration of this object to newAcceleration. This method has no effect if physical simulation is turned on for the object, in which case the physical simulation engine computes acceleration.


set-color to newColor (vector)

Sets the color of this object to newColor.


set-e to newE (float)

Sets the "coefficient of restitution" a value which determines the elasticity of the object in a collision. Valid values range from 0.0 to 1.0, with 0.0 representing a totally inelastic collision (such as a lump of clay) while 1.0 represents a totally (and unrealistically) elastic collision (such as a rubber ball).


set-eT to newET (float)

Sets the "tangential coefficient of restitution", a frictional version of the "coefficient of restitution" described in the documentation for set-e. The value ranges from -1.0 to 1.0. Negative values mean that friction pushes against the sliding object.


set-force to newForce (vector)

Sets the velocity acting on the object to newForce. This force will remain in effect until it is disabled with a new call to set-force.


set-label to theLabel (string)

Sets the label to be drawn along side the object.


set-mu to newMu (float)

Sets the coefficient of friction to newMu.


set-rotation to r (matrix)

Sets the rotation of this object to the rotation matrix r. Working with matrices can be complicated, so a more simple approach is to use rotate.


set-rotational-acceleration to newAcceleration (vector)

Sets the rotational acceleration of this object to newAcceleration. This method has no effect if physical simulation is turned on for the object, in which case the physical simulation engine computes acceleration.


set-rotational-velocity to angularVelocity (vector)

Sets the rotational velocity of this object to angularVelocity.


set-shape to theShape (object)

Associates a Shape object with this Mobile object. Returns this object.


set-torque to newTorque (vector)

Sets the torque acting on the object to newTorque. This torque will remain in effect until it is disabled with a new call to set-torque.


set-velocity to newVelocity (vector)

Sets the velocity of this object to newVelocity.


transform world-vector theVector (vector)

Transforms theVector in the world coordinate frame to a vector in the frame of this object. This assumes that the origin of the link is the object itself.


Documentation created Tue May 11 10:28:37 2004