Sirikata
|
This class represents a generic object on a remote server. More...
#include <ProxyObject.hpp>
Classes | |
class | Hasher |
class | UpdateNeeded |
Public Types | |
typedef TimedWeightedExtrapolator < Location, UpdateNeeded > | Extrapolator |
Public Member Functions | |
ProxyObject (ProxyManagerPtr man, const SpaceObjectReference &id) | |
Constructs a new ProxyObject. | |
const bool | isValid () const |
virtual void | destroy () |
Subclasses can do any necessary cleanup first. | |
const SpaceObjectReference & | getObjectReference () const |
Returns the unique identification for this object and the space to which it is connected that gives it said name. | |
const SpaceObjectReference & | getOwnerPresenceID () const |
ProxyManagerPtr | getOwner () const |
Gets the owning ProxyManager. | |
bool | isPresence () const |
Returns true if this ProxyObject is the one for the presence, i.e. | |
~ProxyObject () | |
void | reset () |
void | validate () |
Marks this ProxyObject as validated, which indicates that updates about the object's properties will be provided by the system. | |
void | invalidate (bool permanent) |
Marks this ProxyObject as invalidated, which indicates that although messages can still be sent and the last values of properties are available, no further updates will be received. | |
bool | isStatic () const |
Returns if this object has a zero velocity and requires no extrapolation. | |
virtual TimedMotionVector3f | location () const |
virtual TimedMotionQuaternion | orientation () const |
virtual AggregateBoundingInfo | bounds () const |
virtual Transfer::URI | mesh () const |
virtual String | physics () const |
virtual bool | isAggregate () const |
virtual ObjectReference | parentAggregate () const |
TimedMotionVector3f | verifiedLocation () const |
TimedMotionQuaternion | verifiedOrientation () const |
AggregateBoundingInfo | verifiedBounds () const |
Transfer::URI | verifiedMesh () const |
String | verifiedPhysics () const |
void | setLocation (const TimedMotionVector3f &reqloc, uint64 seqno) |
void | setOrientation (const TimedMotionQuaternion &reqorient, uint64 seqno) |
void | setBounds (const AggregateBoundingInfo &bnds, uint64 seqno) |
void | setMesh (Transfer::URI const &rhs, uint64 seqno) |
void | setPhysics (const String &rhs, uint64 seqno) |
void | setIsAggregate (bool isAggregate, uint64 seqno) |
Location | extrapolateLocation (TemporalValue< Location >::Time current) const |
Retuns the local location of this object at the current timestamp. | |
unsigned int | hash () const |
Static Public Member Functions | |
static ProxyObjectPtr | construct (ProxyManagerPtr man, const SpaceObjectReference &id) |
Private Attributes | |
bool | mValid |
const SpaceObjectReference | mID |
ProxyManagerPtr | mParent |
This class represents a generic object on a remote server.
This tracks the basic properties maintained by the space -- the object identifier, location, orientation, bounds, mesh, and physics. Note that this *always* represents the current reported status of the object in the space, even if you own the presence.
Note that this class is *not* thread safe. You need to protect it by locking a mutex from the ProxyManager or HostedObject while accessing it.
Sirikata::ProxyObject::ProxyObject | ( | ProxyManagerPtr | man, |
const SpaceObjectReference & | id | ||
) |
Constructs a new ProxyObject.
After constructing this object, it should be wrapped in a shared_ptr and sent to ProxyManager::createObject().
man | The ProxyManager controlling this object. |
id | The SpaceID and ObjectReference assigned to this proxyObject. |
vwobj | the owning VWObject, allowing the ProxyObject to interact with the space |
References mParent, and reset().
Referenced by construct().
Sirikata::ProxyObject::~ProxyObject | ( | ) |
References mID, mParent, and Sirikata::SpaceObjectReference::object().
AggregateBoundingInfo Sirikata::ProxyObject::bounds | ( | ) | const [virtual] |
Reimplemented from Sirikata::PresenceProperties.
References Sirikata::PresenceProperties::bounds(), getObjectReference(), isPresence(), Sirikata::SequencedPresenceProperties::LOC_BOUNDS_PART, mParent, and PROXY_SERIALIZED.
Referenced by Sirikata::Graphics::ProxyEntity::bounds(), and verifiedBounds().
ProxyObjectPtr Sirikata::ProxyObject::construct | ( | ProxyManagerPtr | man, |
const SpaceObjectReference & | id | ||
) | [static] |
References ProxyObject().
void Sirikata::ProxyObject::destroy | ( | ) | [virtual] |
Subclasses can do any necessary cleanup first.
References Sirikata::ProxyObjectListener::destroyed(), Sirikata::SelfWeakPtr< ProxyObject >::getSharedPtr(), and Sirikata::Provider< ListenerPtr >::notify().
Location Sirikata::ProxyObject::extrapolateLocation | ( | TemporalValue< Location >::Time | current | ) | const [inline] |
Retuns the local location of this object at the current timestamp.
References Sirikata::TimedMotionQuaternion::position(), Sirikata::TimedMotionVector< MotionVectorType >::position(), Sirikata::TimedMotionVector< MotionVectorType >::velocity(), and Sirikata::TimedMotionQuaternion::velocity().
const SpaceObjectReference& Sirikata::ProxyObject::getObjectReference | ( | ) | const [inline] |
Returns the unique identification for this object and the space to which it is connected that gives it said name.
Referenced by bounds(), isAggregate(), location(), mesh(), orientation(), physics(), and Sirikata::Graphics::OgreSystem::queryRay().
ProxyManagerPtr Sirikata::ProxyObject::getOwner | ( | ) | const [inline] |
Gets the owning ProxyManager.
const SpaceObjectReference& Sirikata::ProxyObject::getOwnerPresenceID | ( | ) | const [inline] |
unsigned int Sirikata::ProxyObject::hash | ( | ) | const [inline] |
Referenced by Sirikata::ProxyObject::Hasher::operator()().
void Sirikata::ProxyObject::invalidate | ( | bool | permanent | ) |
Marks this ProxyObject as invalidated, which indicates that although messages can still be sent and the last values of properties are available, no further updates will be received.
References Sirikata::SelfWeakPtr< ProxyObject >::getSharedPtr(), Sirikata::ProxyObjectListener::invalidated(), mValid, and Sirikata::Provider< ListenerPtr >::notify().
bool Sirikata::ProxyObject::isAggregate | ( | ) | const [virtual] |
Reimplemented from Sirikata::PresenceProperties.
References getObjectReference(), Sirikata::PresenceProperties::isAggregate(), isPresence(), Sirikata::SequencedPresenceProperties::LOC_IS_AGG_PART, mParent, and PROXY_SERIALIZED.
bool Sirikata::ProxyObject::isPresence | ( | ) | const [inline] |
Returns true if this ProxyObject is the one for the presence, i.e.
if it's ID is the same as the owner ID
Referenced by bounds(), isAggregate(), location(), mesh(), orientation(), and physics().
bool Sirikata::ProxyObject::isStatic | ( | ) | const |
Returns if this object has a zero velocity and requires no extrapolation.
References Sirikata::Quaternion::identity(), Sirikata::PresenceProperties::mLoc, Sirikata::PresenceProperties::mOrientation, PROXY_SERIALIZED, Sirikata::TimedMotionQuaternion::velocity(), and Sirikata::TimedMotionVector< MotionVectorType >::velocity().
Referenced by Sirikata::Graphics::ProxyEntity::isMobile(), and Sirikata::Graphics::ProxyEntity::~ProxyEntity().
const bool Sirikata::ProxyObject::isValid | ( | ) | const [inline] |
TimedMotionVector3f Sirikata::ProxyObject::location | ( | ) | const [virtual] |
Reimplemented from Sirikata::PresenceProperties.
References getObjectReference(), isPresence(), Sirikata::SequencedPresenceProperties::LOC_POS_PART, Sirikata::PresenceProperties::location(), mParent, and PROXY_SERIALIZED.
Referenced by verifiedLocation().
Transfer::URI Sirikata::ProxyObject::mesh | ( | ) | const [virtual] |
Reimplemented from Sirikata::PresenceProperties.
References getObjectReference(), isPresence(), Sirikata::SequencedPresenceProperties::LOC_MESH_PART, Sirikata::PresenceProperties::mesh(), mParent, and PROXY_SERIALIZED.
Referenced by verifiedMesh().
TimedMotionQuaternion Sirikata::ProxyObject::orientation | ( | ) | const [virtual] |
Reimplemented from Sirikata::PresenceProperties.
References getObjectReference(), isPresence(), Sirikata::SequencedPresenceProperties::LOC_ORIENT_PART, mParent, Sirikata::PresenceProperties::orientation(), and PROXY_SERIALIZED.
Referenced by verifiedOrientation().
ObjectReference Sirikata::ProxyObject::parentAggregate | ( | ) | const [virtual] |
References Sirikata::PresenceProperties::parent(), and PROXY_SERIALIZED.
String Sirikata::ProxyObject::physics | ( | ) | const [virtual] |
Reimplemented from Sirikata::PresenceProperties.
References getObjectReference(), isPresence(), Sirikata::SequencedPresenceProperties::LOC_PHYSICS_PART, mParent, Sirikata::PresenceProperties::physics(), and PROXY_SERIALIZED.
Referenced by verifiedPhysics().
void Sirikata::ProxyObject::reset | ( | ) |
Reimplemented from Sirikata::SequencedPresenceProperties.
Referenced by ProxyObject().
void Sirikata::ProxyObject::setBounds | ( | const AggregateBoundingInfo & | bnds, |
uint64 | seqno | ||
) |
Reimplemented from Sirikata::SequencedPresenceProperties.
References Sirikata::AggregateBoundingInfo::fullRadius(), Sirikata::SelfWeakPtr< ProxyObject >::getSharedPtr(), Sirikata::PresenceProperties::mBounds, mID, Sirikata::PresenceProperties::mLoc, Sirikata::PresenceProperties::mOrientation, Sirikata::Provider< ListenerPtr >::notify(), Sirikata::MeshListener::onSetScale(), PROXY_SERIALIZED, Sirikata::SequencedPresenceProperties::setBounds(), and Sirikata::PositionListener::updateLocation().
void Sirikata::ProxyObject::setIsAggregate | ( | bool | isAggregate, |
uint64 | seqno | ||
) |
void Sirikata::ProxyObject::setLocation | ( | const TimedMotionVector3f & | reqloc, |
uint64 | seqno | ||
) |
Reimplemented from Sirikata::SequencedPresenceProperties.
References Sirikata::SelfWeakPtr< ProxyObject >::getSharedPtr(), Sirikata::PresenceProperties::mBounds, mID, Sirikata::PresenceProperties::mLoc, Sirikata::PresenceProperties::mOrientation, Sirikata::Provider< ListenerPtr >::notify(), PROXY_SERIALIZED, Sirikata::SequencedPresenceProperties::setLocation(), and Sirikata::PositionListener::updateLocation().
void Sirikata::ProxyObject::setMesh | ( | Transfer::URI const & | rhs, |
uint64 | seqno | ||
) |
void Sirikata::ProxyObject::setOrientation | ( | const TimedMotionQuaternion & | reqorient, |
uint64 | seqno | ||
) |
Reimplemented from Sirikata::SequencedPresenceProperties.
References Sirikata::SelfWeakPtr< ProxyObject >::getSharedPtr(), Sirikata::PresenceProperties::mBounds, mID, Sirikata::PresenceProperties::mLoc, Sirikata::PresenceProperties::mOrientation, Sirikata::Provider< ListenerPtr >::notify(), PROXY_SERIALIZED, Sirikata::SequencedPresenceProperties::setOrientation(), and Sirikata::PositionListener::updateLocation().
void Sirikata::ProxyObject::setPhysics | ( | const String & | rhs, |
uint64 | seqno | ||
) |
void Sirikata::ProxyObject::validate | ( | ) |
Marks this ProxyObject as validated, which indicates that updates about the object's properties will be provided by the system.
References Sirikata::SelfWeakPtr< ProxyObject >::getSharedPtr(), mValid, Sirikata::Provider< ListenerPtr >::notify(), and Sirikata::ProxyObjectListener::validated().
AggregateBoundingInfo Sirikata::ProxyObject::verifiedBounds | ( | ) | const |
References bounds(), and PROXY_SERIALIZED.
TimedMotionVector3f Sirikata::ProxyObject::verifiedLocation | ( | ) | const |
References location(), and PROXY_SERIALIZED.
Transfer::URI Sirikata::ProxyObject::verifiedMesh | ( | ) | const |
References mesh(), and PROXY_SERIALIZED.
TimedMotionQuaternion Sirikata::ProxyObject::verifiedOrientation | ( | ) | const |
References orientation(), and PROXY_SERIALIZED.
String Sirikata::ProxyObject::verifiedPhysics | ( | ) | const |
References physics(), and PROXY_SERIALIZED.
const SpaceObjectReference Sirikata::ProxyObject::mID [private] |
Referenced by setBounds(), setIsAggregate(), setLocation(), setMesh(), setOrientation(), setPhysics(), and ~ProxyObject().
Reimplemented from Sirikata::PresenceProperties.
Referenced by bounds(), isAggregate(), location(), mesh(), orientation(), physics(), ProxyObject(), and ~ProxyObject().
bool Sirikata::ProxyObject::mValid [private] |
Referenced by invalidate(), and validate().