#ifndef __C_SHPERE_SCENE_NODE_H_INCLUDED__
#define __C_SHPERE_SCENE_NODE_H_INCLUDED__
#include "IMeshSceneNode.h"
#include "IMesh.h"
namespace irr
{
namespace scene
{
class CSphereSceneNode : public IMeshSceneNode
{
public:
CSphereSceneNode(f32 size, u32 polyCountX, u32 polyCountY, 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 ~CSphereSceneNode();
virtual void OnRegisterSceneNode();
virtual void render();
virtual const core::aabbox3d<f32>& getBoundingBox() const;
virtual video::SMaterial& getMaterial(u32 i);
virtual u32 getMaterialCount() const;
virtual ESCENE_NODE_TYPE getType() const { return ESNT_SPHERE; }
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0);
virtual void setMesh(IMesh* mesh) {}
virtual IMesh* getMesh() { return Mesh; }
virtual void setReadOnlyMaterials(bool readonly) {}
virtual bool isReadOnlyMaterials() const { return false; }
private:
IMesh* Mesh;
core::aabbox3d<f32> Box;
f32 Radius;
u32 PolyCountX;
u32 PolyCountY;
};
}
}
#endif