~baltix/+junk/irrlicht-test

« back to all changes in this revision

Viewing changes to source/Irrlicht/CMeshSceneNode.h

  • Committer: Mantas Kriaučiūnas
  • Date: 2011-07-18 13:06:25 UTC
  • Revision ID: mantas@akl.lt-20110718130625-c5pvifp61e7kj1ol
Included whole irrlicht SVN libraries to work around launchpad recipe issue with quilt, see https://answers.launchpad.net/launchpad/+question/165193

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
 
2
// This file is part of the "Irrlicht Engine".
 
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
 
4
 
 
5
#ifndef __C_MESH_SCENE_NODE_H_INCLUDED__
 
6
#define __C_MESH_SCENE_NODE_H_INCLUDED__
 
7
 
 
8
#include "IMeshSceneNode.h"
 
9
#include "IMesh.h"
 
10
 
 
11
namespace irr
 
12
{
 
13
namespace scene
 
14
{
 
15
 
 
16
        class CMeshSceneNode : public IMeshSceneNode
 
17
        {
 
18
        public:
 
19
 
 
20
                //! constructor
 
21
                CMeshSceneNode(IMesh* mesh, ISceneNode* parent, ISceneManager* mgr,     s32 id,
 
22
                        const core::vector3df& position = core::vector3df(0,0,0),
 
23
                        const core::vector3df& rotation = core::vector3df(0,0,0),
 
24
                        const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
 
25
 
 
26
                //! destructor
 
27
                virtual ~CMeshSceneNode();
 
28
 
 
29
                //! frame
 
30
                virtual void OnRegisterSceneNode();
 
31
 
 
32
                //! renders the node.
 
33
                virtual void render();
 
34
 
 
35
                //! returns the axis aligned bounding box of this node
 
36
                virtual const core::aabbox3d<f32>& getBoundingBox() const;
 
37
 
 
38
                //! returns the material based on the zero based index i. To get the amount
 
39
                //! of materials used by this scene node, use getMaterialCount().
 
40
                //! This function is needed for inserting the node into the scene hirachy on a
 
41
                //! optimal position for minimizing renderstate changes, but can also be used
 
42
                //! to directly modify the material of a scene node.
 
43
                virtual video::SMaterial& getMaterial(u32 i);
 
44
                
 
45
                //! returns amount of materials used by this scene node.
 
46
                virtual u32 getMaterialCount() const;
 
47
 
 
48
                //! Writes attributes of the scene node.
 
49
                virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
 
50
 
 
51
                //! Reads attributes of the scene node.
 
52
                virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
 
53
 
 
54
                //! Returns type of the scene node
 
55
                virtual ESCENE_NODE_TYPE getType() const { return ESNT_MESH; }
 
56
 
 
57
                //! Sets a new mesh
 
58
                virtual void setMesh(IMesh* mesh);
 
59
 
 
60
                //! Returns the current mesh
 
61
                virtual IMesh* getMesh(void) { return Mesh; }
 
62
 
 
63
                //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
 
64
                /* In this way it is possible to change the materials a mesh causing all mesh scene nodes 
 
65
                referencing this mesh to change too. */
 
66
                virtual void setReadOnlyMaterials(bool readonly);
 
67
 
 
68
                //! Returns if the scene node should not copy the materials of the mesh but use them in a read only style
 
69
                virtual bool isReadOnlyMaterials() const;
 
70
 
 
71
                //! Creates a clone of this scene node and its children.
 
72
                virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0);
 
73
 
 
74
        protected:
 
75
 
 
76
                void copyMaterials();
 
77
 
 
78
                core::array<video::SMaterial> Materials;
 
79
                core::aabbox3d<f32> Box;
 
80
                video::SMaterial ReadOnlyMaterial;
 
81
 
 
82
                IMesh* Mesh;
 
83
 
 
84
                s32 PassCount;
 
85
                bool ReadOnlyMaterials;
 
86
        };
 
87
 
 
88
} // end namespace scene
 
89
} // end namespace irr
 
90
 
 
91
#endif
 
92