示例#1
0
void ProxyEntity::updateLocation(const TimedMotionVector3f &newLocation, const TimedMotionQuaternion& newOrient, const BoundingSphere3f& newBounds) {
    SILOG(ogre,detailed,"UpdateLocation "<<this<<" to "<<newLocation.position()<<"; "<<newOrient.position());
    setOgrePosition(Vector3d(newLocation.position()));
    setOgreOrientation(newOrient.position());
    updateScale( newBounds.radius() );
    checkDynamic();
}
示例#2
0
void ProxyEntity::initializeToProxy(const ProxyObjectPtr &ppo) {
    assert( ppo );
    assert( !mProxy || (mProxy->getObjectReference() == ppo->getObjectReference()) );

    if (mProxy) {
        mProxy->ProxyObjectProvider::removeListener(this);
        mProxy->PositionProvider::removeListener(this);
        mProxy->MeshProvider::removeListener(this);
    }
    mProxy = ppo;
    mProxy->ProxyObjectProvider::addListener(this);
    mProxy->PositionProvider::addListener(this);
    mProxy->MeshProvider::addListener(this);
    checkDynamic();
}
示例#3
0
void ProxyEntity::iUpdateLocation(
    ProxyObjectPtr proxy, const TimedMotionVector3f &newLocation,
    const TimedMotionQuaternion& newOrient, const BoundingSphere3f& newBounds,
    const SpaceObjectReference& sporef, Liveness::Token lt)
{
    if (!lt)
        return;
    
    assert(proxy == mProxy);
    SILOG(ogre,detailed,"UpdateLocation "<<this<<" to "<<newLocation.position()<<"; "<<newOrient.position());

    setOgrePosition(Vector3d(newLocation.position()));
    setOgreOrientation(newOrient.position());
    updateScale( newBounds.radius() );
    checkDynamic();
}
示例#4
0
void ProxyEntity::initializeToProxy(const ProxyObjectPtr &ppo) {
    assert( ppo );
    assert( !mProxy || (mProxy->getObjectReference() == ppo->getObjectReference()) );

    setIsAggregate(ppo->isAggregate());
    /**
       FIXME: ADDING AND REMOVING LISTENERS COULD INVALIDATE ITERATORS
     */
    if (mProxy) {
        mProxy->ProxyObjectProvider::removeListener(this);
        mProxy->PositionProvider::removeListener(this);
        mProxy->MeshProvider::removeListener(this);
    }
    mProxy = ppo;
    mProxy->ProxyObjectProvider::addListener(this);
    mProxy->PositionProvider::addListener(this);
    mProxy->MeshProvider::addListener(this);
    checkDynamic();
}