#ifndef __C_MESH_SCENE_NODE_H_INCLUDED__
#define __C_MESH_SCENE_NODE_H_INCLUDED__
#include "IMeshSceneNode.h"
#include "IMesh.h"
namespace irr
{
namespace scene
{
class CMeshSceneNode : public IMeshSceneNode
{
public:
CMeshSceneNode(IMesh* mesh, ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
virtual ~CMeshSceneNode();
virtual void OnRegisterSceneNode();
virtual void render();
virtual const core::aabbox3d<f32>& getBoundingBox() const;
virtual video::SMaterial& getMaterial(u32 i);
virtual u32 getMaterialCount() const;
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
virtual ESCENE_NODE_TYPE getType() const { return ESNT_MESH; }
virtual void setMesh(IMesh* mesh);
virtual IMesh* getMesh(void) { return Mesh; }
virtual void setReadOnlyMaterials(bool readonly);
virtual bool isReadOnlyMaterials() const;
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0);
protected:
void copyMaterials();
core::array<video::SMaterial> Materials;
core::aabbox3d<f32> Box;
video::SMaterial ReadOnlyMaterial;
IMesh* Mesh;
s32 PassCount;
bool ReadOnlyMaterials;
};
}
}
#endif