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.

Abstract : Shape

Class Description:

The Shape class is a work-in-progress which allows users to create shapes which will be associated with Mobile, Stationary or Link objects and added to the simulated world. An instance of the class Shape may be shared by several objects simultaneously.

Each Shape has it's own local coordinate frame, with the origin at the middle of the shape.

Class methods:

Dynamically Changing the Size of a Shape

Initializing the Shape

Getting Information About a Shape's Geometry

Serializing the Shape


get-data-for-shape

Returns serialized data for the shape (if the shape object has been properly initialized). Used for archiving/dearchiving, should generally not be called manually, unless you really know what you're doing.


get-mass

If the shape is properly initialized, this method returns the shape's mass.


get-point-on-shape on-vector theVector (vector)

This method is experimental.

Starting from inside the shape at the center, this function goes in the direction of theVector until it hits the edge of the shape. The resulting point is returned.

This allows you to compute link points for arbitrary shapes. For example, if you want to compute a link point for the "left-most" point on the shape, you can call this method with (-1, 0, 0).

Returns (0, 0, 0) if the shape is not initialized or if an error occurs.


init-with-cube size v (vector)

Sets this Shape object to a rectangular solid with size v.

size refers to the vector from the center to one point, so the for a vector (x, y, z), the actual size of the rectangular solid will be 2*x by 2*y by 2*z.


init-with-polygon-cone radius theRadius (float) sides sideCount (int) height theHeight (float)

Sets this Shape object to a cone-like shape with sideCount sides.

The distance from the center of the n-gon faces to the vertices is theRadius. sides has a maximum value of 99. Higher values will cause the shape not to be initialized.

The height, or depth of the extrusion, is theHeight.

This method is experimental, but seems to work okay. Go figure.


init-with-polygon-disk radius theRadius (float) sides sideCount (int) height theHeight (float)

Sets this Shape object to an extruded n-gon of sideCount sides, in other words, a disk with sideCount sides.

The distance from the center of the n-gon faces to the vertices is theRadius. sides has a maximum value of 99. Higher values will cause the shape not to be initialized.

The height, or depth of the extrusion, is theHeight.

This method is experimental, but seems to work okay. Go figure.


init-with-sphere radius r (float)

Sets this Shape object to a sphere with radius r.


scale by scale (vector)

If the shape is not a sphere, scales the shape by the x, y and z elements of scale. If the shape is a sphere, scales the shape by only the x element such that the shape always remains spherical.

After the size has been changed, the instances announces a "size-changed" notification.


set-density to newDensity (float)

Sets the density for this Shape object, if (and only if) called before this object is associated with a shape.


Documentation created Tue May 11 10:28:37 2004