|
|
@@ -36,16 +36,29 @@ Intersection PointOctreeQuery::TestOctant(const BoundingBox& box, bool inside)
|
|
|
|
|
|
void PointOctreeQuery::TestDrawables(const PODVector<Drawable*>& drawables, bool inside)
|
|
|
{
|
|
|
- for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
+ if (inside)
|
|
|
{
|
|
|
- Drawable* drawable = *i;
|
|
|
-
|
|
|
- if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
+ for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
{
|
|
|
- if (inside || drawable->GetWorldBoundingBox().IsInside(point_))
|
|
|
+ Drawable* drawable = *i;
|
|
|
+
|
|
|
+ if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
result_.Push(drawable);
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
+ {
|
|
|
+ Drawable* drawable = *i;
|
|
|
+
|
|
|
+ if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
+ {
|
|
|
+ if (drawable->GetWorldBoundingBox().IsInside(point_))
|
|
|
+ result_.Push(drawable);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Intersection SphereOctreeQuery::TestOctant(const BoundingBox& box, bool inside)
|
|
|
@@ -58,16 +71,29 @@ Intersection SphereOctreeQuery::TestOctant(const BoundingBox& box, bool inside)
|
|
|
|
|
|
void SphereOctreeQuery::TestDrawables(const PODVector<Drawable*>& drawables, bool inside)
|
|
|
{
|
|
|
- for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
+ if (inside)
|
|
|
{
|
|
|
- Drawable* drawable = *i;
|
|
|
-
|
|
|
- if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
+ for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
{
|
|
|
- if (inside || sphere_.IsInsideFast(drawable->GetWorldBoundingBox()))
|
|
|
+ Drawable* drawable = *i;
|
|
|
+
|
|
|
+ if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
result_.Push(drawable);
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
+ {
|
|
|
+ Drawable* drawable = *i;
|
|
|
+
|
|
|
+ if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
+ {
|
|
|
+ if (sphere_.IsInsideFast(drawable->GetWorldBoundingBox()))
|
|
|
+ result_.Push(drawable);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Intersection BoxOctreeQuery::TestOctant(const BoundingBox& box, bool inside)
|
|
|
@@ -80,16 +106,29 @@ Intersection BoxOctreeQuery::TestOctant(const BoundingBox& box, bool inside)
|
|
|
|
|
|
void BoxOctreeQuery::TestDrawables(const PODVector<Drawable*>& drawables, bool inside)
|
|
|
{
|
|
|
- for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
+ if (inside)
|
|
|
{
|
|
|
- Drawable* drawable = *i;
|
|
|
-
|
|
|
- if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
+ for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
{
|
|
|
- if (inside || box_.IsInsideFast(drawable->GetWorldBoundingBox()))
|
|
|
+ Drawable* drawable = *i;
|
|
|
+
|
|
|
+ if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
result_.Push(drawable);
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
+ {
|
|
|
+ Drawable* drawable = *i;
|
|
|
+
|
|
|
+ if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
+ {
|
|
|
+ if (box_.IsInsideFast(drawable->GetWorldBoundingBox()))
|
|
|
+ result_.Push(drawable);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Intersection FrustumOctreeQuery::TestOctant(const BoundingBox& box, bool inside)
|
|
|
@@ -102,14 +141,27 @@ Intersection FrustumOctreeQuery::TestOctant(const BoundingBox& box, bool inside)
|
|
|
|
|
|
void FrustumOctreeQuery::TestDrawables(const PODVector<Drawable*>& drawables, bool inside)
|
|
|
{
|
|
|
- for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
+ if (inside)
|
|
|
{
|
|
|
- Drawable* drawable = *i;
|
|
|
-
|
|
|
- if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
+ for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
{
|
|
|
- if (inside || frustum_.IsInsideFast(drawable->GetWorldBoundingBox()))
|
|
|
+ Drawable* drawable = *i;
|
|
|
+
|
|
|
+ if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
result_.Push(drawable);
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for (PODVector<Drawable*>::ConstIterator i = drawables.Begin(); i != drawables.End(); ++i)
|
|
|
+ {
|
|
|
+ Drawable* drawable = *i;
|
|
|
+
|
|
|
+ if ((drawable->GetDrawableFlags() & drawableFlags_) && drawable->IsVisible() && (drawable->GetViewMask() & viewMask_))
|
|
|
+ {
|
|
|
+ if (frustum_.IsInsideFast(drawable->GetWorldBoundingBox()))
|
|
|
+ result_.Push(drawable);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|