Esempio n. 1
0
///////////////////////////////////////////////////////////////
//
// CSpatialDatabaseImpl::SphereQuery
//
// Return the list of entities that intersect the sphere
//
///////////////////////////////////////////////////////////////
void CSpatialDatabaseImpl::SphereQuery ( CElementResult& outResult, const CSphere& sphere )
{
    // Do any pending updates first
    FlushUpdateQueue ();

    if ( !IsValidSphere ( sphere ) )
        return;

    // Make a box from the sphere
    CBox box ( sphere.vecPosition, fabsf ( sphere.fRadius ) );
    // Make everything 2D for now
    box.vecMin.fZ = SPATIAL_2D_Z;
    box.vecMax.fZ = SPATIAL_2D_Z;

    // Find all entiites which overlap the box
    m_Tree.Search( &box.vecMin.fX, &box.vecMax.fX, outResult );

#ifdef SPATIAL_DATABASE_DEBUG_OUTPUTA
    OutputDebugLine ( SString ( "SpatialDatabase::SphereQuery %d results for %2.0f,%2.0f,%2.0f  %2.2f"
                                ,outResult.size ()
                                ,sphere.vecPosition.fX
                                ,sphere.vecPosition.fY
                                ,sphere.vecPosition.fZ
                                ,sphere.fRadius
                              ) );
#endif
}
Esempio n. 2
0
///////////////////////////////////////////////////////////////
//
// CSpatialDatabaseImpl::AllQuery
//
// Return the list of all entities
//
///////////////////////////////////////////////////////////////
void CSpatialDatabaseImpl::AllQuery ( CElementResult& outResult )
{
    // Do any pending updates first
    FlushUpdateQueue ();

    // Copy results from map to output
    outResult.clear ();
    for ( std::map < CElement*, SEntityInfo >::iterator it = m_InfoMap.begin (); it != m_InfoMap.end (); ++it )
        outResult.push_back ( it->first );
}
Esempio n. 3
0
void
ContentHostIncremental::EnsureDeprecatedTextureHostIncremental(ISurfaceAllocator* aAllocator,
                                                     const TextureInfo& aTextureInfo,
                                                     const nsIntRect& aBufferRect)
{
  mUpdateList.AppendElement(new TextureCreationRequest(aTextureInfo,
                                                       aBufferRect));
  mDeAllocator = aAllocator;
  FlushUpdateQueue();
}
Esempio n. 4
0
bool
ContentHostIncremental::CreatedIncrementalTexture(ISurfaceAllocator* aAllocator,
                                                  const TextureInfo& aTextureInfo,
                                                  const nsIntRect& aBufferRect)
{
  mUpdateList.AppendElement(new TextureCreationRequest(aTextureInfo,
                                                       aBufferRect));
  mDeAllocator = aAllocator;
  FlushUpdateQueue();
  return true;
}
Esempio n. 5
0
void
ContentHostIncremental::UpdateIncremental(TextureIdentifier aTextureId,
                                          SurfaceDescriptor& aSurface,
                                          const nsIntRegion& aUpdated,
                                          const nsIntRect& aBufferRect,
                                          const nsIntPoint& aBufferRotation)
{
  mUpdateList.AppendElement(new TextureUpdateRequest(mDeAllocator,
                                                     aTextureId,
                                                     aSurface,
                                                     aUpdated,
                                                     aBufferRect,
                                                     aBufferRotation));
  FlushUpdateQueue();
}
///////////////////////////////////////////////////////////////
//
// CClientSpatialDatabaseImpl::SphereQuery
//
// Return the list of entities that intersect the sphere
//
///////////////////////////////////////////////////////////////
void CClientSpatialDatabaseImpl::SphereQuery ( CClientEntityResult& outResult, const CSphere& sphere )
{
    // Do any pending updates first
    FlushUpdateQueue ();

    if ( !IsValidSphere ( sphere ) )
        return;

    // Make a box from the sphere
    CBox box ( sphere.vecPosition, fabsf ( sphere.fRadius ) );
    // Make everything 2D for now
    box.vecMin.fZ = SPATIAL_2D_Z;
    box.vecMax.fZ = SPATIAL_2D_Z;

    // Find all entiites which overlap the box
    m_Tree.Search( &box.vecMin.fX, &box.vecMax.fX, outResult );
}