Ejemplo n.º 1
0
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);
        }
    }
}
Ejemplo n.º 2
0
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"
    );
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
 /// Constructor for single object data
 explicit AggregateBoundingInfo(const BoundingSphere3f& obj_bounds)
  : centerOffset(obj_bounds.center()),
    centerBoundsRadius(0),
    maxObjectRadius(obj_bounds.radius())
 {}