Commit 3977eb1a authored by hybrid's avatar hybrid

Give access to the sphere mesh of the scene node.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1259 dfc29bdd-3216-0410-991c-e03cc46cb475
parent a2788441
...@@ -492,7 +492,7 @@ IMesh* CGeometryCreator::createSphereMesh(f32 radius, u32 polyCountX, u32 polyCo ...@@ -492,7 +492,7 @@ IMesh* CGeometryCreator::createSphereMesh(f32 radius, u32 polyCountX, u32 polyCo
buffer->Vertices.set_used((polyCountXPitch * polyCountY) + 2); buffer->Vertices.set_used((polyCountXPitch * polyCountY) + 2);
buffer->Indices.set_used((polyCountX * polyCountY) * 6); buffer->Indices.set_used((polyCountX * polyCountY) * 6);
video::SColor clr(100, 255,255,255); const video::SColor clr(100, 255,255,255);
u32 i=0; u32 i=0;
u32 level = 0; u32 level = 0;
......
...@@ -17,7 +17,7 @@ namespace scene ...@@ -17,7 +17,7 @@ namespace scene
//! constructor //! constructor
CSphereSceneNode::CSphereSceneNode(f32 radius, u32 polyCountX, u32 polyCountY, ISceneNode* parent, ISceneManager* mgr, s32 id, CSphereSceneNode::CSphereSceneNode(f32 radius, u32 polyCountX, u32 polyCountY, ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position, const core::vector3df& rotation, const core::vector3df& scale) const core::vector3df& position, const core::vector3df& rotation, const core::vector3df& scale)
: ISceneNode(parent, mgr, id, position, rotation, scale), Mesh(0), : IMeshSceneNode(parent, mgr, id, position, rotation, scale), Mesh(0),
Radius(radius), PolyCountX(polyCountX), PolyCountY(polyCountY) Radius(radius), PolyCountX(polyCountX), PolyCountY(polyCountY)
{ {
#ifdef _DEBUG #ifdef _DEBUG
......
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
#ifndef __C_SHPERE_SCENE_NODE_H_INCLUDED__ #ifndef __C_SHPERE_SCENE_NODE_H_INCLUDED__
#define __C_SHPERE_SCENE_NODE_H_INCLUDED__ #define __C_SHPERE_SCENE_NODE_H_INCLUDED__
#include "ISceneNode.h" #include "IMeshSceneNode.h"
#include "IMesh.h" #include "IMesh.h"
namespace irr namespace irr
{ {
namespace scene namespace scene
{ {
class CSphereSceneNode : public ISceneNode class CSphereSceneNode : public IMeshSceneNode
{ {
public: public:
...@@ -55,6 +55,20 @@ namespace scene ...@@ -55,6 +55,20 @@ namespace scene
//! Creates a clone of this scene node and its children. //! Creates a clone of this scene node and its children.
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0); virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0);
//! The mesh cannot be changed
virtual void setMesh(IMesh* mesh) {}
//! Returns the current mesh
virtual IMesh* getMesh() { return Mesh; }
//! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
/* In this way it is possible to change the materials a mesh causing all mesh scene nodes
referencing this mesh to change too. */
virtual void setReadOnlyMaterials(bool readonly) {}
//! Returns if the scene node should not copy the materials of the mesh but use them in a read only style
virtual bool isReadOnlyMaterials() const { return false; }
private: private:
IMesh* Mesh; IMesh* Mesh;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment