nuclear@0: #ifndef OBJECT_H_ nuclear@0: #define OBJECT_H_ nuclear@0: nuclear@0: #include nuclear@0: #include "xform_node.h" nuclear@0: #include "mesh.h" nuclear@0: #include "material.h" nuclear@0: nuclear@15: namespace goatgfx { nuclear@15: nuclear@0: enum DrawMode { nuclear@0: DRAW_DEFAULT, nuclear@0: DRAW_WIREFRAME, nuclear@0: DRAW_VERTICES nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: class Object : public XFormNode { nuclear@0: private: nuclear@0: Mesh *mesh; ///< no ownership, just keeping the pointer around nuclear@0: static DrawMode draw_mode; nuclear@0: nuclear@0: bool setup_bones(long msec) const; nuclear@0: nuclear@0: public: nuclear@0: Material material; nuclear@0: nuclear@0: Object(); nuclear@0: nuclear@0: /// destroy this object and all the hierarchy of objects hanging below it nuclear@0: void destroy_all(); nuclear@0: nuclear@0: void set_mesh(Mesh *m); nuclear@0: Mesh *get_mesh(); nuclear@0: const Mesh *get_mesh() const; nuclear@0: nuclear@0: /// get all the meshes of the subtree rooted in this object @{ nuclear@0: std::list get_all_meshes(); nuclear@0: std::list get_all_meshes() const; nuclear@0: /// @} nuclear@0: nuclear@0: AABox get_aabbox() const; nuclear@0: Sphere get_bsphere() const; nuclear@0: nuclear@0: void draw(long msec = 0) const; nuclear@0: nuclear@0: bool intersect(const Ray &ray, HitPoint *hit = 0) const; nuclear@0: nuclear@0: /// this is mostly for tools, to allow drawing only the wireframe or vertices nuclear@0: static DrawMode set_draw_mode(DrawMode mode); nuclear@0: }; nuclear@0: nuclear@15: } // namespace goatgfx nuclear@15: nuclear@0: #endif // OBJECT_H_