Sirikata
|
AggregateBoundingInfo represents the bounds information for a collection of objects in it's own coordinate frame. More...
#include <AggregateBoundingInfo.hpp>
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 |
AggregateBoundingInfo & | mergeIn (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 |
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.
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.
BoundingSphere3f Sirikata::AggregateBoundingInfo::centerBounds | ( | ) | const [inline] |
Get the bounding sphere containing the centers of all objects.
References centerBoundsRadius, and centerOffset.
Referenced by merge(), Sirikata::CBRLocationServiceCache::processBoundsUpdated(), Sirikata::CBRLocationServiceCache::processObjectAdded(), and Sirikata::PintoManagerLocationServiceCache::updateAggregateBounds().
BoundingSphere3f Sirikata::AggregateBoundingInfo::fullBounds | ( | ) | const [inline] |
Get the bounding sphere containing all objects.
References centerOffset, and fullRadius().
Referenced by Sirikata::LibproxProximity::addQuery(), Sirikata::Graphics::ProxyEntity::bounds(), Sirikata::CSFQODPFlowScheduler::getObjectWeightRegion(), Sirikata::LibproxProximity::handleObjectProximityMessage(), Sirikata::LibproxProximity::localBoundsUpdated(), Sirikata::LibproxProximity::localLocationUpdated(), Sirikata::Server::sendConnectSuccess(), Sirikata::LibproxProximity::sendQueryRequests(), and Sirikata::OH::Manual::ObjectQueryHandler::updateQuery().
float32 Sirikata::AggregateBoundingInfo::fullRadius | ( | ) | const [inline] |
Get the radius of the full bounding sphere.
References centerBoundsRadius, and maxObjectRadius.
Referenced by Sirikata::BulletObject::computeCollisionShape(), fullBounds(), Sirikata::Graphics::ProxyEntity::iUpdateLocation(), Sirikata::LibproxProximityBase::localBoundsUpdated(), Sirikata::LibproxProximityBase::localObjectAdded(), and Sirikata::ProxyObject::setBounds().
bool Sirikata::AggregateBoundingInfo::invalid | ( | ) | const [inline] |
References centerBoundsRadius.
AggregateBoundingInfo Sirikata::AggregateBoundingInfo::merge | ( | const AggregateBoundingInfo & | rhs | ) | [inline] |
References AggregateBoundingInfo(), centerBounds(), and maxObjectRadius.
Referenced by mergeIn().
AggregateBoundingInfo& Sirikata::AggregateBoundingInfo::mergeIn | ( | const AggregateBoundingInfo & | rhs | ) | [inline] |
References merge().
Referenced by Sirikata::LibproxProximity::recomputeAggregateQueryBounds().
bool Sirikata::AggregateBoundingInfo::operator!= | ( | const AggregateBoundingInfo & | rhs | ) | [inline] |
References centerBoundsRadius, centerOffset, and maxObjectRadius.
bool Sirikata::AggregateBoundingInfo::operator== | ( | const AggregateBoundingInfo & | rhs | ) | [inline] |
References centerBoundsRadius, centerOffset, and maxObjectRadius.
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().
Referenced by centerBounds(), fullRadius(), Sirikata::LibproxProximity::generateObjectQueryEvents(), Sirikata::OH::Manual::ObjectQueryHandler::generateObjectQueryEvents(), Sirikata::LibproxProximity::generateServerQueryEvents(), invalid(), operator!=(), Sirikata::operator<<(), operator==(), Sirikata::LibproxManualProximity::queryHasEvents(), Sirikata::LibproxProximity::recomputeAggregateQueryBounds(), and singleObject().
Referenced by centerBounds(), fullBounds(), Sirikata::LibproxProximity::generateObjectQueryEvents(), Sirikata::OH::Manual::ObjectQueryHandler::generateObjectQueryEvents(), Sirikata::LibproxProximity::generateServerQueryEvents(), operator!=(), Sirikata::operator<<(), operator==(), Sirikata::LibproxManualProximity::queryHasEvents(), and Sirikata::LibproxProximity::recomputeAggregateQueryBounds().
Referenced by fullRadius(), Sirikata::LibproxProximity::generateObjectQueryEvents(), Sirikata::OH::Manual::ObjectQueryHandler::generateObjectQueryEvents(), Sirikata::LibproxProximity::generateServerQueryEvents(), merge(), operator!=(), Sirikata::operator<<(), operator==(), Sirikata::CBRLocationServiceCache::processBoundsUpdated(), Sirikata::CBRLocationServiceCache::processObjectAdded(), Sirikata::LibproxManualProximity::queryHasEvents(), and Sirikata::PintoManagerLocationServiceCache::updateAggregateBounds().