Example #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();
}
void CBRLocationServiceCache::processBoundsUpdated(const UUID& uuid, bool agg, const BoundingSphere3f& newval) {
    Lock lck(mMutex);

    ObjectDataMap::iterator it = mObjects.find(uuid);
    if (it == mObjects.end()) return;

    it->second.bounds = newval;

    BoundingSphere3f old_region = it->second.region;
    it->second.region = BoundingSphere3f(newval.center(), 0.f);
    float32 old_maxSize = it->second.maxSize;
    it->second.maxSize = newval.radius();

    if (!agg) {
        for(ListenerSet::iterator listen_it = mListeners.begin(); listen_it != mListeners.end(); listen_it++) {
            (*listen_it)->locationRegionUpdated(uuid, old_region, it->second.region);
            (*listen_it)->locationMaxSizeUpdated(uuid, old_maxSize, it->second.maxSize);
        }
    }
}
void CBRLocationServiceCache::objectAdded(const UUID& uuid, bool islocal, bool agg, const TimedMotionVector3f& loc, const TimedMotionQuaternion& orient, const BoundingSphere3f& bounds, const String& mesh, const String& phy, const String& zernike) {
    ObjectData data;
    data.location = loc;
    data.orientation = orient;
    data.bounds = bounds;
    data.region = BoundingSphere3f(bounds.center(), 0.f);
    data.maxSize = bounds.radius();
    data.mesh = mesh;
    data.physics = phy;
    data.zernike = zernike;
    data.isLocal = islocal;
    data.exists = true;
    data.tracking = 0;
    data.isAggregate = agg;

    mStrand->post(
        std::tr1::bind(
            &CBRLocationServiceCache::processObjectAdded, this,
            uuid, data
        ),
        "CBRLocationServiceCache::processObjectAdded"
    );
}
void CBRLocationServiceCache::processObjectAdded(const UUID& uuid, bool islocal, bool agg, const TimedMotionVector3f& loc, const TimedMotionQuaternion& orient, const BoundingSphere3f& bounds, const String& mesh, const String& phy) {
    Lock lck(mMutex);

    if (mObjects.find(uuid) != mObjects.end())
        return;

    ObjectData data;
    data.location = loc;
    data.orientation = orient;
    data.bounds = bounds;
    data.region = BoundingSphere3f(bounds.center(), 0.f);
    data.maxSize = bounds.radius();
    data.mesh = mesh;
    data.physics = phy;
    data.isLocal = islocal;
    data.exists = true;
    data.tracking = 0;
    data.isAggregate = agg;
    mObjects[uuid] = data;

    if (!agg)
        for(ListenerSet::iterator it = mListeners.begin(); it != mListeners.end(); it++)
            (*it)->locationConnected(uuid, islocal, loc, data.region, data.maxSize);
}
Example #5
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();
}
 /// Constructor for single object data
 explicit AggregateBoundingInfo(const BoundingSphere3f& obj_bounds)
  : centerOffset(obj_bounds.center()),
    centerBoundsRadius(0),
    maxObjectRadius(obj_bounds.radius())
 {}