nuclear@2: #ifndef SNODE_H_ nuclear@2: #define SNODE_H_ nuclear@2: nuclear@2: #include nuclear@2: #include "object.h" nuclear@2: #include "vmath/vmath.h" nuclear@2: nuclear@2: class SceneNode { nuclear@2: private: nuclear@2: Vector3 pos; nuclear@2: Quaternion rot; nuclear@2: Vector3 scale; nuclear@2: nuclear@2: std::vector obj; nuclear@2: nuclear@2: SceneNode *parent; nuclear@2: std::vector children; nuclear@2: nuclear@2: Matrix4x4 node_xform, xform; nuclear@2: nuclear@2: public: nuclear@2: void add_child(SceneNode *node); nuclear@2: bool remove_child(SceneNode *node); nuclear@2: nuclear@2: int get_num_children() const; nuclear@2: SceneNode *get_child(int idx) const; nuclear@2: nuclear@2: void set_position(const Vector3 &pos); nuclear@2: void set_rotation(const Quaternion &rot); nuclear@2: void set_scaling(const Vector3 &scale); nuclear@2: nuclear@2: const Vector3 &get_node_position() const; nuclear@2: const Quaternion &get_node_rotation() const; nuclear@2: const Vector3 &get_node_scaling() const; nuclear@2: nuclear@2: Vector3 get_position() const; nuclear@2: Quaternion get_rotation() const; nuclear@2: Vector3 get_scaling() const; nuclear@2: nuclear@2: void update_node(long msec = 0); nuclear@2: void update(long msec = 0); nuclear@2: nuclear@2: bool intersect(const Ray &ray, RayHit *hit) const; nuclear@2: }; nuclear@2: nuclear@2: #endif // SNODE_H_