Sirikata
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
Sirikata::ProxyObject Class Reference

This class represents a generic object on a remote server. More...

#include <ProxyObject.hpp>

Inheritance diagram for Sirikata::ProxyObject:
Collaboration diagram for Sirikata::ProxyObject:

List of all members.

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 SpaceObjectReferencegetObjectReference () const
 Returns the unique identification for this object and the space to which it is connected that gives it said name.
const SpaceObjectReferencegetOwnerPresenceID () 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

Detailed Description

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.


Member Typedef Documentation


Constructor & Destructor Documentation

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().

Parameters:
manThe ProxyManager controlling this object.
idThe SpaceID and ObjectReference assigned to this proxyObject.
vwobjthe owning VWObject, allowing the ProxyObject to interact with the space

References mParent, and reset().

Referenced by construct().

Sirikata::ProxyObject::~ProxyObject ( )

Member Function Documentation

AggregateBoundingInfo Sirikata::ProxyObject::bounds ( ) const [virtual]
ProxyObjectPtr Sirikata::ProxyObject::construct ( ProxyManagerPtr  man,
const SpaceObjectReference id 
) [static]

References ProxyObject().

void Sirikata::ProxyObject::destroy ( ) [virtual]
Location Sirikata::ProxyObject::extrapolateLocation ( TemporalValue< Location >::Time  current) const [inline]
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]
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]
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
const bool Sirikata::ProxyObject::isValid ( ) const [inline]
TimedMotionVector3f Sirikata::ProxyObject::location ( ) const [virtual]
Transfer::URI Sirikata::ProxyObject::mesh ( ) const [virtual]
TimedMotionQuaternion Sirikata::ProxyObject::orientation ( ) const [virtual]
ObjectReference Sirikata::ProxyObject::parentAggregate ( ) const [virtual]
String Sirikata::ProxyObject::physics ( ) const [virtual]
void Sirikata::ProxyObject::reset ( )

Reimplemented from Sirikata::SequencedPresenceProperties.

Referenced by ProxyObject().

void Sirikata::ProxyObject::setBounds ( const AggregateBoundingInfo bnds,
uint64  seqno 
)
void Sirikata::ProxyObject::setIsAggregate ( bool  isAggregate,
uint64  seqno 
)
void Sirikata::ProxyObject::setLocation ( const TimedMotionVector3f reqloc,
uint64  seqno 
)
void Sirikata::ProxyObject::setMesh ( Transfer::URI const &  rhs,
uint64  seqno 
)
void Sirikata::ProxyObject::setOrientation ( const TimedMotionQuaternion reqorient,
uint64  seqno 
)
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.


Member Data Documentation

Referenced by invalidate(), and validate().


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