/* Copyright 2003-2005 ROBLOX Corporation, All Rights Reserved */ #pragma once #include "rbx/Debug.h" #include "Util/IndexedMesh.h" #include "Primitive.h" #include namespace RBX { class Edge; class Joint; class Clump; class PrimIterator; class Clump : public boost::noncopyable , public IndexedMesh { private: template inline void visitPrimitivesImpl(Func func, Primitive* p) { func(p); for (int i = 0; i < p->numChildren(); ++i) { Primitive* child = p->getTypedChild(i); if (!Clump::isClumpRootPrimitive(child)) { visitPrimitivesImpl(func, child); } } } public: Clump(); ~Clump(); Clump* getRootClump() {return getRoot();} const Clump* getRootClump() const {return getRoot();} Primitive* getClumpPrimitive() {return rbx_static_cast(getLower());} const Primitive* getConstClumpPrimitive() const {return rbx_static_cast(getConstLower());} static Clump* getPrimitiveClump(Primitive* p); static const Clump* getConstPrimitiveClump(const Primitive* p); static bool isClumpRootPrimitive(const Primitive* p); void loadMotors(G3D::Array& load, bool nonAnimatedOnly); void loadConstMotors(G3D::Array& load, bool nonAnimatedOnly) const; template inline void visitPrimitives(Func func) { Primitive* p = getClumpPrimitive(); RBXASSERT(p); visitPrimitivesImpl(func, p); } }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// } // namespace