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.

Object : Real

This class is included as part of the file Real.tz.
To use this class in a simulation, include the line "@use Real."

Class description:

A class which is never instantiated--just used as a logical distinction from the Abstract classes. See the child classes Mobile, Link and Stationary for more information. The methods documented here may be used with any of the child classes.

Class methods:

Configuring Physical Properties of the Object

Using Menus

Using Neighbor Detection

Changing the Appearence of Agents

Getting the Light Exposure of this Mobile Object

Handling Collisions

Useful Funtions for Sensors


add-dotted-line to otherObject (object) with-color theColor = (0, 0, 0) (vector)

Adds a dotted line to otherObject. See add-line for more information on object lines.


add-line to otherObject (object) with-color theColor = (0, 0, 0) (vector) with-style theStyle = "----------------" (string)

Adds a line to be drawn from this object to otherObject. The line can be removed later using remove-line.

The optional argument theColor specifies the color of the line. The default color is the vector (0, 0, 0), black.

The optional argument theStyle specifies a pattern for the line. theStyle is a string of 16 spaces and/or dashes which specify the line pattern to be drawn. A dotted line, for example, would use the pattern "- - - - - - - - ". A thickly dashed line would use the pattern "-------- ". If no style is given, a solid line is drawn.

If a line to otherObject already exists, its color and/or style will be updated.


add-menu named menuName (string) for-method theMethod (string)

Adds a menu named menuName to the application which will result in a call to theMethod for the calling instance.

If the calling instance is the Controller object, then the menu will become the "main" simulation menu. Otherwise, the menu will become a contextual menu associated with the specific object in the simulation.

Note that unlike the handle-collision which sets the collision handler for the whole type (class, that is), this method affects only the instance for which it is called, meaning that each instance of a certain class may have a different menu.


add-menu-separator

Adds a separator menu item--really just an empty menu item.


draw-as-point

Draws the object as a single point. This is by far the fastest way to display an agent. Points can be used to draw upwards of 20,000 agents with a reasonable frame rate, while drawing as many spheres or bitmaps would slow down the simulation significantly.


get-color

Returns the color of the object.


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-neighborhood-size

gets the neighborhood size for the current object.


get-neighbors

Returns a list of all real objects in the simulation that are within the "neighborhood" range of this object in the world.


handle-collisions with-type theType (string) with-method theMethod (string)

Adds a collision handler for this object. When a collision occurs between an instance of the this type and theType, the breve engine will automatically call theMethod of the colliding instance.


hide-axis

Hides the X and Y axes for the object. The axes are hidden by default, so you'll only need this method if you've previously enabled them using show-axis.


hide-bounding-box

Hides the bounding box for the object. The bounding box is hidden by default, so you'll only need this method if you've previously enabled them using show-axis.


hide-neighbor-lines

Hides lines to this objects neighbors.


ignore-collisions with-type theType (string)

Instructs the engine to ignore physical collisions with theType objects. This does not affect collision callbacks specified with handle-collisions.


make-invisible

Makes the object invisible. Can be made visible again later using the method make-visible.


make-visible

Makes the object visible again (if it has previously been hidden using make-invisible.


raytrace from-location theLocation (vector) with-direction theDirection (vector)

Computes the vector from theLocation towards theDirection that hits the shape of this object.

If the object was not hit vector (0, 0, 0) will be returned.

The location and direction vector must be given relative to the world's coordinate frame.


remove-all-lines

Removes all lines connecting this object to other objects.


remove-line to otherObject (object)

Removes the line connecting this object to otherObject.


set-bitmap-heading to radianAngle (float)

If this object is in 2d bitmap mode, the rotation of the bitmap will be set to radianAngle.


set-bitmap-heading-point towards-vector rotationVector (vector)

If this object is in 2d bitmap mode, the rotation of the bitmap will be set to degreeAngle degrees.


set-bitmap-image to bitmapImage (object)

Changes the bitmap of this object to bitmapImage, an instance of class image. If bitmapImage is NULL, bitmapping is turned off for the object.


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-lightmap-image to lightmapImage (object)

Sets the object to be displayed using a "lightmap". A lightmap uses the texture specified and treats it like a light source. It's hard to explain. Give it a try for yourself.

set-lightmap only has an effect on sphere shapes. Other shapes can be textured, but only spheres can be made into lightmaps.


set-mu to newMu (float)

Sets the coefficient of friction to newMu. mu is a parameter controlling friction between two bodies and may be any value between 0 and infinity.


set-neighborhood-size to size (float)

Used in conjunction with get-neighbors, this function will set the neighborhood size for the current object.


set-texture-image to textureImage (object)

Changes the texture of this object to textureImage, an instance of class Image. If textureImage is NULL texturing is turned off for the object.


set-texture-scale to scaleSize (float)

Changes the "scale" of the texture. When a texture is applied over a shape, this value is used to decide how large the texture will be in terms of breve-world units. The default value is 16, meaning that a 16x16 face will have one copy of the textured image. For smaller objects, this number will have to be decreased, or else the texture will be too big and will not be visible.


set-texture-scale-x to scaleSize (float)

Sets the texture scale in the X dimension. The Y texture scale value is unchanged. See set-texture-scale for more information.


set-texture-scale-y to scaleSize (float)

Sets the texture scale in the Y dimension. The X texture scale value is unchanged. See set-texture-scale for more information.


set-transparency to alphaValue (float)

Sets the transparency of this object to alphaValue, a number between 1.0 (totally opaque) and 0.0 (fully transparent).


show-axis

Shows the X and Y axes for the object.


show-bounding-box

Shows the bounding box for the object.


show-neighbor-lines

Draws lines to this objects neighbors (when neighbor checking is enabled).


watch

Makes the camera follow this object.


Documentation created Sat Jan 20 13:13:52 2007