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