188
Appendix A: Cosmo Basic Types
Cosmo 3D provides two bounding shapes as well as an abstract class from which you can
derive your own bounding shapes.
• csBound— is the abstract base class from which bounding objects are derived.
• csBoxBound—prescribes the minimum-sized box that can enclose an object.
• csSphereBound—prescribes the minimum-sized sphere that can enclose an object.
csBound provides methods to compute a bounding object around a group of points,
boxes, or spheres, and to extend an existing bounding object by any of these. In addition,
there are methods to determine if a point, bounding box, or bounding sphere is contained
entirely within a bounding object. Methods are also provided to transform bounding
objects using a matrix, test it for emptiness, or test it for intersection with a line segment.
csNodes use csSphereBound for efficient bounding updates and checking.
csGeoSets contain a csBoxBound because it provides a tighter bound around the
vertices.
Field Classes
Together, fields and methods comprise a scene graph node. A field is a class with set()
and get() methods that set and return the values of the field. Fields can also have other
methods that perform other operations related to setting or returning the field value.
Cosmo 3D contains the following Field classes:
• csField— represents a simple data type, such as float, csVec3f, and arrays of simple
types.
• csFieldInfo—maintains information about the fields of a class including string
name, integer id, default value, and a pointer to a member in csContainer.
• csMField— is an abstract class containing some of the functionality common to
arrays.
• csAtomField<Type>—is a single-valued atomic field type.
• csArrayField<Type>—is a single-valued array field type.
You can substitute for <Type> any character type, such as Int, Short, or Field. The
following sections describe each of these field classes.