namespace Mf {
-class Camera;
+class Frustum;
struct OctreeNode;
aabb_.draw(); // temporary
}
- void drawIfVisible(Scalar alpha, const Camera& cam) const
+ void drawIfVisible(Scalar alpha, const Frustum& frustum) const
{
std::list<EntityP>::const_iterator it;
for (it = objects.begin(); it != objects.end(); ++it)
{
- (*it)->drawIfVisible(alpha, cam);
+ (*it)->drawIfVisible(alpha, frustum);
}
if (!objects.empty())
}
- bool isVisible(const Camera& cam) const
+ bool isVisible(const Frustum& frustum) const
{
- if (sphere_.isVisible(cam))
+ if (sphere_.isVisible(frustum))
{
- return aabb_.isVisible(cam);
+ return aabb_.isVisible(frustum);
}
return false;
void addChild(OctreeNodeP node, int index);
void draw(Scalar alpha, OctreeNodeP node);
- void drawIfVisible(Scalar alpha, const Camera& cam, OctreeNodeP node);
+ void drawIfVisible(Scalar alpha, const Frustum& frustum, OctreeNodeP node);
stlplus::ntree<OctreeNode> tree_;
public:
- inline void print(OctreeNodeP node)
+ void print(OctreeNodeP node)
{
- logDebug("-----");
- logDebug("depth to node: %d", tree_.depth(node));
- logDebug("size of node: %d", tree_.size(node));
+ //logDebug("-----");
+ //logDebug("depth to node: %d", tree_.depth(node));
+ //logDebug("size of node: %d", tree_.size(node));
}
- inline static OctreeP alloc(const OctreeNode& rootNode)
+ static OctreeP alloc(const OctreeNode& rootNode)
{
return OctreeP(new Octree(rootNode));
}
OctreeNodeP reinsert(EntityP entity, OctreeNodeP node);
- void drawIfVisible(Scalar alpha, const Camera& cam)
+ void drawIfVisible(Scalar alpha, const Frustum& frustum)
{
- drawIfVisible(alpha, cam, tree_.root());
+ drawIfVisible(alpha, frustum, tree_.root());
}
void sort();