Sirikata
Public Member Functions | Public Attributes
Sirikata::AggregateBoundingInfo Class Reference

AggregateBoundingInfo represents the bounds information for a collection of objects in it's own coordinate frame. More...

#include <AggregateBoundingInfo.hpp>

Collaboration diagram for Sirikata::AggregateBoundingInfo:

List of all members.

Public Member Functions

 AggregateBoundingInfo ()
 Default constructor, initializes to an invalid value, where the bounds information is negative.
 AggregateBoundingInfo (Vector3f off, float32 obj_size)
 Constructor for single object data.
 AggregateBoundingInfo (const BoundingSphere3f &obj_bounds)
 Constructor for single object data.
 AggregateBoundingInfo (Vector3f off, float32 center_bounds, float32 max_obj_size)
 Constructor for aggregate.
BoundingSphere3f centerBounds () const
 Get the bounding sphere containing the centers of all objects.
float32 fullRadius () const
 Get the radius of the full bounding sphere.
BoundingSphere3f fullBounds () const
 Get the bounding sphere containing all objects.
bool singleObject () const
 Returns true if this is a single object, i.e.
bool invalid () const
AggregateBoundingInfomergeIn (const AggregateBoundingInfo &rhs)
AggregateBoundingInfo merge (const AggregateBoundingInfo &rhs)
bool operator== (const AggregateBoundingInfo &rhs)
bool operator!= (const AggregateBoundingInfo &rhs)

Public Attributes

Vector3f centerOffset
float32 centerBoundsRadius
float32 maxObjectRadius

Detailed Description

AggregateBoundingInfo represents the bounds information for a collection of objects in it's own coordinate frame.

It is used to represent bounds for both collections of objects and individual objects: individual objects are just a degenerate case.

Three values are included in this bounds information: offset, center bounds radius, and maximum object size. The offset adjusts the center of mass of the object or collection of objects -- it's not the position of the object, which is stored separately. The center bounds radius is the radius which, when combined with the offset position, encompasses the center points of all individual objects in this aggregate. (Note that this is *not* the radius which bounds all the objects, it only bounds their center points.) Finally, the maximum object size is the radius of the largest object in this aggregate.

Because this covers the needs of both individual objects and aggregates, it can have some degenerate values. In particular, for a single object the center bounds radius will be 0 since there is only 1 center point to form bounds around, and for aggregates the offset should generally be 0 since there's nothing meaningful that can be accomplished by setting it to some other value.


Constructor & Destructor Documentation

Sirikata::AggregateBoundingInfo::AggregateBoundingInfo ( ) [inline]

Default constructor, initializes to an invalid value, where the bounds information is negative.

Referenced by merge().

Sirikata::AggregateBoundingInfo::AggregateBoundingInfo ( Vector3f  off,
float32  obj_size 
) [inline]

Constructor for single object data.

Sirikata::AggregateBoundingInfo::AggregateBoundingInfo ( const BoundingSphere3f &  obj_bounds) [inline, explicit]

Constructor for single object data.

Sirikata::AggregateBoundingInfo::AggregateBoundingInfo ( Vector3f  off,
float32  center_bounds,
float32  max_obj_size 
) [inline]

Constructor for aggregate.


Member Function Documentation

BoundingSphere3f Sirikata::AggregateBoundingInfo::centerBounds ( ) const [inline]
BoundingSphere3f Sirikata::AggregateBoundingInfo::fullBounds ( ) const [inline]
float32 Sirikata::AggregateBoundingInfo::fullRadius ( ) const [inline]
bool Sirikata::AggregateBoundingInfo::invalid ( ) const [inline]

References centerBoundsRadius.

AggregateBoundingInfo Sirikata::AggregateBoundingInfo::merge ( const AggregateBoundingInfo rhs) [inline]
AggregateBoundingInfo& Sirikata::AggregateBoundingInfo::mergeIn ( const AggregateBoundingInfo rhs) [inline]
bool Sirikata::AggregateBoundingInfo::operator!= ( const AggregateBoundingInfo rhs) [inline]
bool Sirikata::AggregateBoundingInfo::operator== ( const AggregateBoundingInfo rhs) [inline]
bool Sirikata::AggregateBoundingInfo::singleObject ( ) const [inline]

Returns true if this is a single object, i.e.

if the center bounds radius is 0.

References centerBoundsRadius.

Referenced by Sirikata::Server::sendConnectSuccess(), and Sirikata::OH::Manual::ObjectQueryHandler::updateQuery().


Member Data Documentation


The documentation for this class was generated from the following file: