73 lines
1.6 KiB
C++
73 lines
1.6 KiB
C++
#ifndef BLUECORE_SCENE_NODE_H
|
|
#define BLUECORE_SCENE_NODE_H
|
|
|
|
#include "Camera.h"
|
|
#include "RenderQueue.h"
|
|
#include "RigidBodySimulation.h"
|
|
#include "ModelManager.h"
|
|
|
|
#include "Utilities/Referenced.h"
|
|
#include "Utilities/Named.h"
|
|
#include "Utilities/Log.h"
|
|
#include "Utilities/Activated.h"
|
|
#include "Math/Transformation.h"
|
|
|
|
#include <iostream>
|
|
#include <list>
|
|
|
|
namespace BlueCore
|
|
{
|
|
|
|
class SceneNode : public Referenced, public Named, public Activated
|
|
{
|
|
|
|
public:
|
|
|
|
typedef std::list< ref_ptr<SceneNode> > SceneNodeList;
|
|
|
|
protected:
|
|
|
|
SceneNode *_Parent;
|
|
SceneNodeList _Children;
|
|
Transformation _RelativeTransformation;
|
|
Transformation _AbsoluteTransformation;
|
|
|
|
ref_ptr<RigidBody> _RigidBody;
|
|
ref_ptr<Model> _Model;
|
|
|
|
public:
|
|
|
|
SceneNode();
|
|
SceneNode(const std::string &name);
|
|
virtual ~SceneNode();
|
|
|
|
SceneNode *getParent() const;
|
|
const SceneNodeList &getChildren() const;
|
|
|
|
void setRigidBody (RigidBody* body);
|
|
RigidBody* getRigidBody ();
|
|
|
|
void setModel (Model* body);
|
|
Model* getModel ();
|
|
|
|
void attach(SceneNode *node);
|
|
void detach(SceneNode *node);
|
|
void detachAll();
|
|
void detachFromParent();
|
|
|
|
virtual void update(Scalar time);
|
|
virtual void queue (RenderQueue *queue, Camera *camera);
|
|
|
|
const Transformation& getRelativeTransformation();
|
|
const Transformation& getAbsoluteTransformation();
|
|
|
|
void setRelativeTranslation (const Vector3 &translation);
|
|
void setRelativeRotation (const Quaternion &rotation);
|
|
|
|
virtual void updateAbsoluteTransformation();
|
|
};
|
|
|
|
} // namespace BlueCore
|
|
|
|
#endif
|