Sirikata
|
Ogre entities using ProxyObjects for their information. More...
#include <ProxyEntity.hpp>
Public Member Functions | |
ProxyEntity (OgreRenderer *scene, const ProxyObjectPtr &ppo) | |
NOTE that you *MUST* call initializeToProxy with the same ProxyObjectPtr immediately after. | |
virtual | ~ProxyEntity () |
void | initializeToProxy (const ProxyObjectPtr &ppo) |
virtual BoundingSphere3f | bounds () |
virtual void | tick (const Time &t, const Duration &deltaTime) |
virtual bool | isDynamic () const |
virtual bool | isMobile () const |
ProxyObject & | getProxy () const |
const ProxyObjectPtr & | getProxyPtr () const |
virtual void | updateLocation (ProxyObjectPtr proxy, const TimedMotionVector3f &newLocation, const TimedMotionQuaternion &newOrient, const AggregateBoundingInfo &newBounds, const SpaceObjectReference &sporef) |
virtual void | validated (ProxyObjectPtr proxy) |
virtual void | invalidated (ProxyObjectPtr proxy, bool permanent) |
virtual void | destroyed (ProxyObjectPtr proxy) |
virtual void | onSetMesh (ProxyObjectPtr proxy, Transfer::URI const &newMesh, const SpaceObjectReference &sporef) |
virtual void | onSetScale (ProxyObjectPtr proxy, float32 newScale, const SpaceObjectReference &sporef) |
virtual void | onSetIsAggregate (ProxyObjectPtr proxy, bool isAgg, const SpaceObjectReference &sporef) |
void | extrapolateLocation (TemporalValue< Location >::Time current) |
Static Public Member Functions | |
static ProxyEntity * | fromMovableObject (Ogre::MovableObject *obj) |
Protected Member Functions | |
void | handleDestroyTimeout () |
void | tryDelete () |
Protected Attributes | |
ProxyObjectPtr | mProxy |
bool | mActive |
Network::IOTimerPtr | mDestroyTimer |
bool | mCanDestroy |
Private Member Functions | |
void | iUpdateLocation (ProxyObjectPtr proxy, const TimedMotionVector3f &newLocation, const TimedMotionQuaternion &newOrient, const AggregateBoundingInfo &newBounds, const SpaceObjectReference &sporef, Liveness::Token lt) |
void | iValidated (ProxyObjectPtr proxy, Liveness::Token lt) |
void | iInvalidated (ProxyObjectPtr proxy, bool permanent, Liveness::Token lt) |
void | iDestroyed (ProxyObjectPtr proxy, Liveness::Token lt) |
void | iOnSetMesh (ProxyObjectPtr proxy, Transfer::URI const &newMesh, const SpaceObjectReference &sporef, Liveness::Token lt) |
void | iOnSetScale (ProxyObjectPtr proxy, float32 newScale, const SpaceObjectReference &sporef, Liveness::Token lt) |
void | iOnSetIsAggregate (ProxyObjectPtr proxy, bool isAgg, const SpaceObjectReference &sporef, Liveness::Token lt) |
void | iHandleDestroyTimeout (Liveness::Token lt) |
Ogre entities using ProxyObjects for their information.
Sirikata::Graphics::ProxyEntity::ProxyEntity | ( | OgreRenderer * | scene, |
const ProxyObjectPtr & | ppo | ||
) |
NOTE that you *MUST* call initializeToProxy with the same ProxyObjectPtr immediately after.
We can't completely split the construction and initialization right now because Entity expects a name at construction, but to initialize we may need some virtual functions.
References Sirikata::Graphics::OgreRenderer::context(), Sirikata::Network::IOTimer::create(), handleDestroyTimeout(), Sirikata::Context::mainStrand, mDestroyTimer, and Sirikata::Graphics::Entity::mScene.
Sirikata::Graphics::ProxyEntity::~ProxyEntity | ( | ) | [virtual] |
FIXME: ADDING AND REMOVING LISTENERS COULD INVALIDATE ITERATORS
References Sirikata::Logging::detailed, getProxy(), Sirikata::ProxyObject::isStatic(), Sirikata::Liveness::letDie(), mProxy, Sirikata::Graphics::Entity::removeFromScene(), and SILOG.
BoundingSphere3f Sirikata::Graphics::ProxyEntity::bounds | ( | ) | [virtual] |
Implements Sirikata::Graphics::Entity.
References Sirikata::ProxyObject::bounds(), Sirikata::AggregateBoundingInfo::fullBounds(), and getProxy().
void Sirikata::Graphics::ProxyEntity::destroyed | ( | ProxyObjectPtr | proxy | ) | [virtual] |
void Sirikata::Graphics::ProxyEntity::extrapolateLocation | ( | TemporalValue< Location >::Time | current | ) |
ProxyEntity * Sirikata::Graphics::ProxyEntity::fromMovableObject | ( | Ogre::MovableObject * | obj | ) | [static] |
Reimplemented from Sirikata::Graphics::Entity.
Referenced by Sirikata::Graphics::OgreSystem::internalRayTrace().
ProxyObject& Sirikata::Graphics::ProxyEntity::getProxy | ( | ) | const [inline] |
References mProxy.
Referenced by bounds(), extrapolateLocation(), isMobile(), Sirikata::Graphics::OgreSystem::queryRay(), and ~ProxyEntity().
const ProxyObjectPtr& Sirikata::Graphics::ProxyEntity::getProxyPtr | ( | ) | const [inline] |
References mProxy.
Referenced by Sirikata::Graphics::OgreSystem::entityDestroyed().
void Sirikata::Graphics::ProxyEntity::handleDestroyTimeout | ( | ) | [protected] |
References iHandleDestroyTimeout(), Sirikata::Liveness::livenessToken(), mActive, mProxy, Sirikata::Graphics::Entity::mScene, and Sirikata::Graphics::OgreRenderer::renderStrand().
Referenced by ProxyEntity().
void Sirikata::Graphics::ProxyEntity::iDestroyed | ( | ProxyObjectPtr | proxy, |
Liveness::Token | lt | ||
) | [private] |
References mCanDestroy, mProxy, and tryDelete().
Referenced by destroyed().
void Sirikata::Graphics::ProxyEntity::iHandleDestroyTimeout | ( | Liveness::Token | lt | ) | [private] |
void Sirikata::Graphics::ProxyEntity::iInvalidated | ( | ProxyObjectPtr | proxy, |
bool | permanent, | ||
Liveness::Token | lt | ||
) | [private] |
References Sirikata::Logging::detailed, iHandleDestroyTimeout(), mActive, mDestroyTimer, mProxy, and SILOG.
Referenced by invalidated().
void Sirikata::Graphics::ProxyEntity::initializeToProxy | ( | const ProxyObjectPtr & | ppo | ) |
FIXME: ADDING AND REMOVING LISTENERS COULD INVALIDATE ITERATORS
References Sirikata::Graphics::Entity::checkDynamic(), mProxy, and Sirikata::Graphics::Entity::setIsAggregate().
Referenced by Sirikata::Graphics::OgreSystem::iOnCreateProxy().
void Sirikata::Graphics::ProxyEntity::invalidated | ( | ProxyObjectPtr | proxy, |
bool | permanent | ||
) | [virtual] |
void Sirikata::Graphics::ProxyEntity::iOnSetIsAggregate | ( | ProxyObjectPtr | proxy, |
bool | isAgg, | ||
const SpaceObjectReference & | sporef, | ||
Liveness::Token | lt | ||
) | [private] |
void Sirikata::Graphics::ProxyEntity::iOnSetMesh | ( | ProxyObjectPtr | proxy, |
Transfer::URI const & | newMesh, | ||
const SpaceObjectReference & | sporef, | ||
Liveness::Token | lt | ||
) | [private] |
void Sirikata::Graphics::ProxyEntity::iOnSetScale | ( | ProxyObjectPtr | proxy, |
float32 | newScale, | ||
const SpaceObjectReference & | sporef, | ||
Liveness::Token | lt | ||
) | [private] |
bool Sirikata::Graphics::ProxyEntity::isDynamic | ( | ) | const [virtual] |
Reimplemented from Sirikata::Graphics::Entity.
References isMobile().
bool Sirikata::Graphics::ProxyEntity::isMobile | ( | ) | const [virtual] |
Implements Sirikata::Graphics::Entity.
References getProxy(), and Sirikata::ProxyObject::isStatic().
Referenced by isDynamic().
void Sirikata::Graphics::ProxyEntity::iUpdateLocation | ( | ProxyObjectPtr | proxy, |
const TimedMotionVector3f & | newLocation, | ||
const TimedMotionQuaternion & | newOrient, | ||
const AggregateBoundingInfo & | newBounds, | ||
const SpaceObjectReference & | sporef, | ||
Liveness::Token | lt | ||
) | [private] |
References Sirikata::Graphics::Entity::checkDynamic(), Sirikata::Logging::detailed, Sirikata::AggregateBoundingInfo::fullRadius(), mProxy, Sirikata::TimedMotionQuaternion::position(), Sirikata::TimedMotionVector< MotionVectorType >::position(), Sirikata::Graphics::Entity::setOgreOrientation(), Sirikata::Graphics::Entity::setOgrePosition(), SILOG, and Sirikata::Graphics::Entity::updateScale().
Referenced by iValidated(), and updateLocation().
void Sirikata::Graphics::ProxyEntity::iValidated | ( | ProxyObjectPtr | proxy, |
Liveness::Token | lt | ||
) | [private] |
References Sirikata::Graphics::ResourceDownloadPlanner::addNewObject(), Sirikata::Logging::detailed, Sirikata::Graphics::OgreRenderer::downloadPlanner(), Sirikata::Graphics::Entity::getScene(), iUpdateLocation(), mActive, mCanDestroy, mDestroyTimer, mProxy, Sirikata::SpaceObjectReference::null(), and SILOG.
Referenced by validated().
void Sirikata::Graphics::ProxyEntity::onSetIsAggregate | ( | ProxyObjectPtr | proxy, |
bool | isAgg, | ||
const SpaceObjectReference & | sporef | ||
) | [virtual] |
void Sirikata::Graphics::ProxyEntity::onSetMesh | ( | ProxyObjectPtr | proxy, |
Transfer::URI const & | newMesh, | ||
const SpaceObjectReference & | sporef | ||
) | [virtual] |
void Sirikata::Graphics::ProxyEntity::onSetScale | ( | ProxyObjectPtr | proxy, |
float32 | newScale, | ||
const SpaceObjectReference & | sporef | ||
) | [virtual] |
Reimplemented from Sirikata::Graphics::Entity.
References extrapolateLocation().
void Sirikata::Graphics::ProxyEntity::tryDelete | ( | ) | [protected] |
void Sirikata::Graphics::ProxyEntity::updateLocation | ( | ProxyObjectPtr | proxy, |
const TimedMotionVector3f & | newLocation, | ||
const TimedMotionQuaternion & | newOrient, | ||
const AggregateBoundingInfo & | newBounds, | ||
const SpaceObjectReference & | sporef | ||
) | [virtual] |
void Sirikata::Graphics::ProxyEntity::validated | ( | ProxyObjectPtr | proxy | ) | [virtual] |
bool Sirikata::Graphics::ProxyEntity::mActive [protected] |
Referenced by handleDestroyTimeout(), iHandleDestroyTimeout(), iInvalidated(), iValidated(), and tryDelete().
bool Sirikata::Graphics::ProxyEntity::mCanDestroy [protected] |
Referenced by iDestroyed(), iValidated(), and tryDelete().
Referenced by iInvalidated(), iValidated(), and ProxyEntity().