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
master
hybrid 2008-02-25 23:15:16 +00:00
parent a278844150
commit 3977eb1ad5
3 changed files with 18 additions and 4 deletions

View File

@ -492,7 +492,7 @@ IMesh* CGeometryCreator::createSphereMesh(f32 radius, u32 polyCountX, u32 polyCo
buffer->Vertices.set_used((polyCountXPitch * polyCountY) + 2);
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 level = 0;

View File

@ -17,7 +17,7 @@ namespace scene
//! constructor
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)
: ISceneNode(parent, mgr, id, position, rotation, scale), Mesh(0),
: IMeshSceneNode(parent, mgr, id, position, rotation, scale), Mesh(0),
Radius(radius), PolyCountX(polyCountX), PolyCountY(polyCountY)
{
#ifdef _DEBUG

View File

@ -5,14 +5,14 @@
#ifndef __C_SHPERE_SCENE_NODE_H_INCLUDED__
#define __C_SHPERE_SCENE_NODE_H_INCLUDED__
#include "ISceneNode.h"
#include "IMeshSceneNode.h"
#include "IMesh.h"
namespace irr
{
namespace scene
{
class CSphereSceneNode : public ISceneNode
class CSphereSceneNode : public IMeshSceneNode
{
public:
@ -55,6 +55,20 @@ namespace scene
//! Creates a clone of this scene node and its children.
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:
IMesh* Mesh;