Another round of constness additions. Almost finished now.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@969 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2007-09-17 16:09:50 +00:00
parent 13750c0f40
commit 13b9851487
107 changed files with 456 additions and 497 deletions

View File

@ -24,6 +24,9 @@ namespace scene
//! COLLADA mesh writer for .dae and .xml files
EMWT_COLLADA = MAKE_IRR_ID('c','o','l','l'),
//! STL mesh writer for .stl files
EMWT_STL = MAKE_IRR_ID('s','t','l',0),
};

View File

@ -19,25 +19,25 @@ public:
virtual ~IOSOperator() {}
//! returns the current operation system version as string.
virtual const wchar_t* getOperationSystemVersion() = 0;
virtual const wchar_t* getOperationSystemVersion() const = 0;
//! copies text to the clipboard
virtual void copyToClipboard(const c8* text) = 0;
virtual void copyToClipboard(const c8* text) const = 0;
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
virtual c8* getTextFromClipboard() = 0;
virtual c8* getTextFromClipboard() const = 0;
//! gets the processor speed in megahertz
//! \param MHz: The integer variable to store the speed in.
//! \return Returns true if successful, false if not
virtual bool getProcessorSpeedMHz(irr::u32* MHz) = 0;
virtual bool getProcessorSpeedMHz(irr::u32* MHz) const = 0;
//! gets the total and available system RAM
//! \param Total: will contain the total system memory
//! \param Avail: will contain the available memory
//! \return Returns true if successful, false if not
virtual bool getSystemMemory(irr::u32* Total, irr::u32* Avail) = 0;
virtual bool getSystemMemory(irr::u32* Total, irr::u32* Avail) const = 0;
};

View File

@ -18,9 +18,6 @@ class IParticleAnimatedMeshSceneNodeEmitter : public IParticleEmitter
{
public:
//! destructor
virtual ~IParticleAnimatedMeshSceneNodeEmitter() {};
//! Set Mesh to emit particles from
virtual void setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node ) = 0;

View File

@ -18,9 +18,6 @@ class IParticleBoxEmitter : public IParticleEmitter
{
public:
//! destructor
virtual ~IParticleBoxEmitter() {};
//! Set the box shape
virtual void setBox( const core::aabbox3df& box ) = 0;

View File

@ -17,9 +17,6 @@ class IParticleCylinderEmitter : public IParticleEmitter
{
public:
//! destructor
virtual ~IParticleCylinderEmitter() {};
//! Set the center of the radius for the cylinder, at one end of the cylinder
virtual void setCenter( const core::vector3df& center ) = 0;

View File

@ -46,9 +46,6 @@ class IParticleEmitter : public virtual io::IAttributeExchangingObject
{
public:
//! destructor
virtual ~IParticleEmitter() {};
//! Prepares an array with new particles to emitt into the system
//! and returns how much new particles there are.
//! \param now: Current time.

View File

@ -24,11 +24,11 @@ public:
//! Sets the amount of time it takes for each particle to fade out.
virtual void setFadeOutTime( f32 fadeOutTime ) = 0;
//! Sets the targetColor, i.e.the color the particles will interpolate
//! Gets the targetColor, i.e. the color the particles will interpolate
//! to over time.
virtual const video::SColor& getTargetColor() const = 0;
//! Sets the amount of time it takes for each particle to fade out.
//! Gets the amount of time it takes for each particle to fade out.
virtual f32 getFadeOutTime() const = 0;
//! Get emitter type

View File

@ -18,9 +18,6 @@ class IParticleMeshEmitter : public IParticleEmitter
{
public:
//! destructor
virtual ~IParticleMeshEmitter() {};
//! Set Mesh to emit particles from
virtual void setMesh( IMesh* mesh ) = 0;

View File

@ -17,9 +17,6 @@ class IParticleRingEmitter : public IParticleEmitter
{
public:
//! destructor
virtual ~IParticleRingEmitter() {};
//! Set the center of the ring
virtual void setCenter( const core::vector3df& center ) = 0;

View File

@ -17,9 +17,6 @@ class IParticleSphereEmitter : public IParticleEmitter
{
public:
//! destructor
virtual ~IParticleSphereEmitter() {};
//! Set the center of the sphere for particle emissions
virtual void setCenter( const core::vector3df& center ) = 0;

View File

@ -20,9 +20,6 @@ namespace scene
{
public:
//! destructor
virtual ~IQ3LevelMesh() {};
//! releases a Mesh from the Q3 Loader
virtual void releaseMesh ( s32 index ) = 0;

View File

@ -17,7 +17,7 @@ namespace io
{
public:
virtual ~IReadFile() {};
virtual ~IReadFile() {}
//! Reads an amount of bytes from the file.
//! \param buffer: Pointer to buffer where to read bytes will be written to.
@ -35,11 +35,11 @@ namespace io
//! Returns size of file.
//! \return Returns the size of the file in bytes.
virtual long getSize() = 0;
virtual long getSize() const = 0;
//! Returns the current position in the file.
//! \return Returns the current position in the file in bytes.
virtual long getPos() = 0;
virtual long getPos() const = 0;
//! Returns name of file.
//! \return Returns the file name as zero terminated character string.

View File

@ -27,7 +27,7 @@ namespace scene
public:
//! destructor
virtual ~ISceneCollisionManager() {};
virtual ~ISceneCollisionManager() {}
//! Finds the collision point of a line and lots of triangles, if there is one.
//! \param ray: Line with witch collisions are tested.

View File

@ -150,7 +150,7 @@ namespace scene
public:
//! destructor
virtual ~ISceneManager() {};
virtual ~ISceneManager() {}
//! Returns pointer to an animateable mesh. Loads the file if not loaded already.
/**
@ -1121,7 +1121,7 @@ namespace scene
manager is rendering currently, because for example they registered for rendering
twice, once for transparent geometry and once for solid. When knowing what rendering
pass currently is active they can render the correct part of their geometry. */
virtual E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass() = 0;
virtual E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass() const = 0;
//! Returns the default scene node factory which can create all built in scene nodes
virtual ISceneNodeFactory* getDefaultSceneNodeFactory() = 0;
@ -1132,10 +1132,10 @@ namespace scene
virtual void registerSceneNodeFactory(ISceneNodeFactory* factoryToAdd) = 0;
//! Returns amount of registered scene node factories.
virtual s32 getRegisteredSceneNodeFactoryCount() = 0;
virtual u32 getRegisteredSceneNodeFactoryCount() const = 0;
//! Returns a scene node factory by index
virtual ISceneNodeFactory* getSceneNodeFactory(s32 index) = 0;
virtual ISceneNodeFactory* getSceneNodeFactory(u32 index) = 0;
//! Returns the default scene node animator factory which can create all built-in scene node animators
virtual ISceneNodeAnimatorFactory* getDefaultSceneNodeAnimatorFactory() = 0;
@ -1146,10 +1146,10 @@ namespace scene
virtual void registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd) = 0;
//! Returns amount of registered scene node animator factories.
virtual s32 getRegisteredSceneNodeAnimatorFactoryCount() = 0;
virtual u32 getRegisteredSceneNodeAnimatorFactoryCount() const = 0;
//! Returns a scene node animator factory by index
virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(s32 index) = 0;
virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(u32 index) = 0;
//! Returns a typename from a scene node type or null if not found
virtual const c8* getSceneNodeTypeName(ESCENE_NODE_TYPE type) = 0;
@ -1226,7 +1226,7 @@ namespace scene
virtual void setAmbientLight(const video::SColorf &ambientColor) = 0;
//! Returns ambient color of the scene
virtual video::SColorf getAmbientLight() = 0;
virtual const video::SColorf& getAmbientLight() const = 0;
};

View File

@ -32,7 +32,7 @@ namespace scene
//! the gravity. The implementation of this method is very fast,
//! no collision detection is done when invoking it.
//! \return Returns true if the scene node is falling, false if not.
virtual bool isFalling() = 0;
virtual bool isFalling() const = 0;
//! Sets the radius of the ellipsoid with which collision detection and
//! response is done. If you have got a scene node, and you are unsure about

View File

@ -43,22 +43,22 @@ namespace scene
virtual ISceneNodeAnimator* createSceneNodeAnimator(const c8* typeName, ISceneNode* target) = 0;
//! returns amount of scene node animator types this factory is able to create
virtual s32 getCreatableSceneNodeAnimatorTypeCount() = 0;
virtual u32 getCreatableSceneNodeAnimatorTypeCount() const = 0;
//! returns type of a createable scene node animator type
/** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and
getCreatableSceneNodeTypeCount() */
virtual ESCENE_NODE_ANIMATOR_TYPE getCreateableSceneNodeAnimatorType(s32 idx) = 0;
virtual ESCENE_NODE_ANIMATOR_TYPE getCreateableSceneNodeAnimatorType(u32 idx) const = 0;
//! returns type name of a createable scene node animator type
/** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and
getCreatableSceneNodeAnimatorTypeCount() */
virtual const c8* getCreateableSceneNodeAnimatorTypeName(s32 idx) = 0;
virtual const c8* getCreateableSceneNodeAnimatorTypeName(u32 idx) const = 0;
//! returns type name of a createable scene node animator type
/** \param type: Type of scene node animator.
\return: Returns name of scene node animator type if this factory can create the type, otherwise 0. */
virtual const c8* getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) = 0;
virtual const c8* getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const = 0;
};

View File

@ -42,22 +42,22 @@ namespace scene
virtual ISceneNode* addSceneNode(const c8* typeName, ISceneNode* parent=0) = 0;
//! returns amount of scene node types this factory is able to create
virtual s32 getCreatableSceneNodeTypeCount() = 0;
virtual u32 getCreatableSceneNodeTypeCount() const = 0;
//! returns type of a createable scene node type
/** \param idx: Index of scene node type in this factory. Must be a value between 0 and
getCreatableSceneNodeTypeCount() */
virtual ESCENE_NODE_TYPE getCreateableSceneNodeType(s32 idx) = 0;
virtual ESCENE_NODE_TYPE getCreateableSceneNodeType(u32 idx) const = 0;
//! returns type name of a createable scene node type by index
/** \param idx: Index of scene node type in this factory. Must be a value between 0 and
getCreatableSceneNodeTypeCount() */
virtual const c8* getCreateableSceneNodeTypeName(s32 idx) = 0;
virtual const c8* getCreateableSceneNodeTypeName(u32 idx) const = 0;
//! returns type name of a createable scene node type
/** \param type: Type of scene node.
\return: Returns name of scene node type if this factory can create the type, otherwise 0. */
virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) = 0;
virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) const = 0;
};

View File

@ -64,4 +64,3 @@ public:
#endif

View File

@ -35,13 +35,13 @@ namespace scene
//! Gets joint count.
//! \return Returns amount of joints in the skeletal animated mesh.
virtual s32 getJointCount() const = 0;
virtual u32 getJointCount() const = 0;
//! Gets the name of a joint.
//! \param number: Zero based index of joint. The last joint
//! has the number getJointCount()-1;
//! \return Returns name of joint and null if an error happened.
virtual const c8* getJointName(s32 number) const = 0;
virtual const c8* getJointName(u32 number) const = 0;
//! Gets a joint number from its name
//! \param name: Name of the joint.
@ -52,7 +52,7 @@ namespace scene
//! the animation is linked (not copied) based on joint names (so make sure they are unique)
//! \return Returns true if all joints in this mesh were matched up (empty names will not be matched, and it's case sensitive)
//! unmatched joints will not be animated
virtual bool useAnimationFrom(ISkinnedMesh *mesh) = 0;
virtual bool useAnimationFrom(const ISkinnedMesh *mesh) = 0;
//!Update Normals when Animating
//!False= Don't (default)
@ -72,7 +72,7 @@ namespace scene
virtual void recoverJointsFromMesh(core::array<IBoneSceneNode*> &JointChildSceneNodes) = 0;
//!Tranfers the joint data to the mesh
virtual void tranferJointsToMesh(core::array<IBoneSceneNode*> &JointChildSceneNodes) = 0;
virtual void transferJointsToMesh(const core::array<IBoneSceneNode*> &JointChildSceneNodes) = 0;
//!Creates an array of joints from this mesh
virtual void createJoints(core::array<IBoneSceneNode*> &JointChildSceneNodes,
@ -176,7 +176,7 @@ namespace scene
//Interface for the mesh loaders (finalize should lock these functions, and they should have some prefix like loader_
//these functions will use the needed arrays, set vaules, etc to help the loaders
//these functions will use the needed arrays, set values, etc to help the loaders
//! exposed for loaders: to add mesh buffers
virtual core::array<SSkinMeshBuffer*> &getMeshBuffers() = 0;
@ -184,12 +184,13 @@ namespace scene
//! exposed for loaders: joints list
virtual core::array<SJoint*> &getAllJoints() = 0;
//! exposed for loaders: joints list
virtual const core::array<SJoint*> &getAllJoints() const = 0;
//! loaders should call this after populating the mesh
virtual void finalize() = 0;
virtual SSkinMeshBuffer *createBuffer() = 0;
virtual SJoint *createJoint(SJoint *parent=0) = 0;
@ -206,5 +207,3 @@ namespace scene
#endif

View File

@ -54,7 +54,7 @@ namespace scene
: ISceneNode (parent, mgr, id, position, rotation, scale) {}
//! destructor
virtual ~ITerrainSceneNode() {};
virtual ~ITerrainSceneNode() {}
//! \return: Returns the bounding box of the entire terrain.
virtual const core::aabbox3d<f32>& getBoundingBox ( ) const = 0;
@ -63,7 +63,7 @@ namespace scene
virtual const core::aabbox3d<f32>& getBoundingBox (s32 patchX, s32 patchZ) const = 0;
//! Returns the number of indices currently in the meshbuffer for this scene node.
virtual u32 getIndexCount() = 0;
virtual u32 getIndexCount() const = 0;
//! Returns pointer to the mesh
virtual IMesh* getMesh() = 0;
@ -71,7 +71,7 @@ namespace scene
//! Gets the meshbuffer data based on a specified level of detail.
/** \param mb: A reference to an SMeshBuffer object
\param LOD: the level of detail you want the indices from. */
virtual void getMeshBufferForLOD(SMeshBufferLightMap& mb, s32 LOD) = 0;
virtual void getMeshBufferForLOD(SMeshBufferLightMap& mb, s32 LOD) const = 0;
//! Gets the indices for a specified patch at a specified Level of Detail.
/** \param indices: A reference to an array of u32 indices.
@ -87,7 +87,7 @@ namespace scene
//! Populates an array with the CurrentLOD of each patch.
/** \param LODs: A reference to a core::array<s32> to hold the values
\return: Returns the number of elements in the array */
virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs) = 0;
virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs) const = 0;
//! Manually sets the LOD of a patch
/** \param patchX: Patch x coordinate.
@ -96,10 +96,10 @@ namespace scene
virtual void setLODOfPatch( s32 patchX, s32 patchZ, s32 LOD ) = 0;
//! Returns center of terrain.
virtual core::vector3df getTerrainCenter() = 0;
virtual const core::vector3df& getTerrainCenter() const = 0;
//! Returns height of a point of the terrain.
virtual f32 getHeight( f32 x, f32 y ) = 0;
virtual f32 getHeight( f32 x, f32 y ) const = 0;
//! Sets the movement camera threshold.
/** It is used to determine when to recalculate

View File

@ -22,13 +22,13 @@ public:
/** This value does not start with 0 when the application starts.
For example in one implementation the value returned could be the
amount of milliseconds which have elapsed since the system was started. */
virtual u32 getRealTime() = 0;
virtual u32 getRealTime() const = 0;
//! Returns current virtual time in milliseconds.
/** This value starts with 0 and can be manipulated using setTime(), stopTimer(),
startTimer(), etc. This value depends on the set speed of the timer if the timer
is stopped, etc. If you need the system time, use getRealTime() */
virtual u32 getTime() = 0;
virtual u32 getTime() const = 0;
//! sets current virtual time
virtual void setTime(u32 time) = 0;
@ -53,10 +53,10 @@ public:
//! Returns current speed of the timer
/** The speed is the factor with which the time is running faster or slower then the
real system time. */
virtual f32 getSpeed() = 0;
virtual f32 getSpeed() const = 0;
//! Returns if the virtual timer is currently stopped
virtual bool isStopped() = 0;
virtual bool isStopped() const = 0;
//! Advances the virtual time
/** Makes the virtual timer update the time value based on the real

View File

@ -28,7 +28,7 @@ class ITriangleSelector : public virtual IReferenceCounted
public:
//! destructor
virtual ~ITriangleSelector() {};
virtual ~ITriangleSelector() {}
//! Returns amount of all available triangles in this selector
virtual s32 getTriangleCount() const = 0;
@ -42,7 +42,7 @@ public:
//! they are returned. Useful for example to scale all triangles down into an
//! ellipsoid space. If this pointer is null, no transformation will be done.
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::matrix4* transform=0) = 0;
s32& outTriangleCount, const core::matrix4* transform=0) const = 0;
//! Gets all triangles which lie within a specific bounding box.
//! Please note that unoptimized triangle selectors also may return triangles,
@ -58,7 +58,7 @@ public:
//! ellipsoid space. If this pointer is null, no transformation will be done.
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::aabbox3d<f32>& box,
const core::matrix4* transform=0) = 0;
const core::matrix4* transform=0) const = 0;
//! Gets all triangles which have or may have contact with a 3d line.
//! Please note that unoptimized triangle selectors also may return triangles,
@ -74,7 +74,7 @@ public:
//! ellipsoid space. If this pointer is null, no transformation will be done.
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform=0) = 0;
const core::matrix4* transform=0) const = 0;
};
} // end namespace scene

View File

@ -106,7 +106,7 @@ namespace video
/** Returns true if a feature is available
\param feature: A feature to query.
\return Returns true if the feature is available, false if not. */
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) = 0;
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const = 0;
//! Sets the view, world or projection transformation.
/* \param state: Transformation type to be set. Can be view, world or projection.
@ -114,7 +114,7 @@ namespace video
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) = 0;
//! Returns the transformation set by setTransform
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) = 0;
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const = 0;
//! Sets a material.
/** All 3d drawing functions will draw geometry using this material.
@ -150,7 +150,7 @@ namespace video
virtual ITexture* getTextureByIndex(u32 index) = 0;
//! Returns amount of textures currently loaded
virtual s32 getTextureCount() = 0;
virtual u32 getTextureCount() const = 0;
//! Renames a texture
virtual void renameTexture(ITexture* texture, const c8* newName) = 0;
@ -210,7 +210,7 @@ namespace video
in the engine and for example in picture edit programs. To avoid this
problem, you could use the makeColorKeyTexture method, which takes the position
of a pixel instead a color value. */
virtual void makeColorKeyTexture(video::ITexture* texture, video::SColor color) = 0;
virtual void makeColorKeyTexture(video::ITexture* texture, video::SColor color) const = 0;
//! Creates a 1bit alpha channel of the texture based of an color key position.
/** This makes the texture transparent at the regions where this color
@ -219,7 +219,7 @@ namespace video
\param colorKeyPixelPos: Position of a pixel with the color key color.
Every pixel with this color will become transparent as described above. */
virtual void makeColorKeyTexture(video::ITexture* texture,
core::position2d<s32> colorKeyPixelPos) = 0;
core::position2d<s32> colorKeyPixelPos) const = 0;
//! Creates a normal map from a height map texture.
/** If the target texture
@ -228,7 +228,7 @@ namespace video
material and similar materials.
\param texture: Texture whose alpha channel is modified.
\param amplitude: Constant value by which the height information is multiplied.*/
virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) = 0;
virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const = 0;
//! Sets a new render target.
/** This will only work if the driver
@ -545,22 +545,22 @@ namespace video
//! Returns the size of the screen or render window.
/** \return Size of screen or render window. */
virtual core::dimension2d<s32> getScreenSize() = 0;
virtual const core::dimension2d<s32>& getScreenSize() const = 0;
//! Returns the size of the current render target, or the screen size if the driver
//! doesnt support render to texture
/** \return Size of render target or screen/window */
virtual core::dimension2d<s32> getCurrentRenderTargetSize() = 0;
virtual const core::dimension2d<s32>& getCurrentRenderTargetSize() const = 0;
//! Returns current frames per second value.
/** \return Returns amount of frames per second drawn. **/
virtual s32 getFPS() = 0;
virtual s32 getFPS() const = 0;
//! Returns amount of primitives (mostly triangles) which were drawn in the last frame.
/** Together with getFPS() very useful method for statistics.
\return Amount of primitives drawn in the last frame. */
virtual u32 getPrimitiveCountDrawn( u32 param = 0 ) = 0;
virtual u32 getPrimitiveCountDrawn( u32 param = 0 ) const = 0;
//! Deletes all dynamic lights which were previously added with addDynamicLight().
virtual void deleteAllDynamicLights() = 0;
@ -571,22 +571,22 @@ namespace video
//! Returns the maximal amount of dynamic lights the device can handle
/** \return Maximal amount of dynamic lights. */
virtual u32 getMaximalDynamicLightAmount() = 0;
virtual u32 getMaximalDynamicLightAmount() const = 0;
//! Returns current amount of dynamic lights set
/** \return Current amount of dynamic lights set */
virtual u32 getDynamicLightCount() = 0;
virtual u32 getDynamicLightCount() const = 0;
//! Returns light data which was previously set by IVideoDriver::addDynamicLight().
/** \param idx: Zero based index of the light. Must be greater than 0 and smaller
than IVideoDriver()::getDynamicLightCount.
\return Light data. */
virtual const SLight& getDynamicLight(u32 idx) = 0;
virtual const SLight& getDynamicLight(u32 idx) const = 0;
//! Gets name of this video driver.
/** \return Returns the name of the video driver. Example: In case of the Direct3D8
driver, it would return "Direct3D 8.1". */
virtual const wchar_t* getName() = 0;
virtual const wchar_t* getName() const = 0;
//! Adds an external image loader to the engine.
/** This is useful if
@ -610,7 +610,7 @@ namespace video
/** (mostly vertices) which
the device is able to render with one drawIndexedTriangleList
call. */
virtual u32 getMaximalPrimitiveCount() = 0;
virtual u32 getMaximalPrimitiveCount() const = 0;
//! Enables or disables a texture creation flag.
/** This flag defines how
@ -627,7 +627,7 @@ namespace video
/** You can change this value using setTextureCreationMode().
\param flag: Texture creation flag.
\return Returns the current texture creation mode. */
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) = 0;
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const = 0;
//! Creates a software image from a file.
/** No hardware texture will
@ -709,7 +709,7 @@ namespace video
virtual IMaterialRenderer* getMaterialRenderer(u32 idx) = 0;
//! Returns amount of currently available material renderers.
virtual u32 getMaterialRendererCount() = 0;
virtual u32 getMaterialRendererCount() const = 0;
//! Returns name of the material renderer
/** This string can for example be used to test if a specific renderer already has
@ -717,7 +717,7 @@ namespace video
returned name will be also used when serializing Materials.
\param idx: Id of the material renderer. Can be a value of the E_MATERIAL_TYPE enum or a
value which was returned by addMaterialRenderer(). */
virtual const c8* getMaterialRendererName(u32 idx) = 0;
virtual const c8* getMaterialRendererName(u32 idx) const = 0;
//! Sets the name of a material renderer.
/** Will have no effect on built-in material renderers.

View File

@ -17,7 +17,7 @@ namespace io
{
public:
virtual ~IWriteFile() {};
virtual ~IWriteFile() {}
//! Writes an amount of bytes to the file.
//! \param buffer: Pointer to buffer of bytes to write.
@ -35,7 +35,7 @@ namespace io
//! Returns the current position in the file.
//! \return Returns the current position in the file in bytes.
virtual long getPos() = 0;
virtual long getPos() const = 0;
//! Returns name of file.
//! \return Returns the file name as zero terminated character string.

View File

@ -23,7 +23,7 @@ namespace io
public:
//! Destructor
virtual ~IXMLWriter() {};
virtual ~IXMLWriter() {}
//! Writes a xml 1.0 header like &lt;?xml version="1.0"?&gt;. This should
//! always be called before writing anything other, because also the

View File

@ -41,7 +41,7 @@ namespace irr
public:
//! destructor
virtual ~IrrlichtDevice() {};
virtual ~IrrlichtDevice() {}
//! Runs the device.
/** Also increments the virtual timer by calling ITimer::tick();. You can prevent this
@ -144,7 +144,7 @@ while(device->run())
// draw everything here
}
\endcode */
virtual bool isWindowActive() = 0;
virtual bool isWindowActive() const = 0;
//! Notifies the device that it should close itself.
/** IrrlichtDevice::run() will always return false after closeDevice() was called. */
@ -153,7 +153,7 @@ while(device->run())
//! Returns the version of the engine.
/** The returned string
will look like this: "1.2.3" or this: "1.2". */
virtual const c8* getVersion() = 0;
virtual const c8* getVersion() const = 0;
//! Sets a new event receiver to receive events.
virtual void setEventReceiver(IEventReceiver* receiver) = 0;

View File

@ -42,7 +42,7 @@ const char* const sBuiltInVertexTypeNames[] =
struct S3DVertex
{
//! default constructor
S3DVertex() {};
S3DVertex() {}
//! constructor
S3DVertex(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv)
@ -91,7 +91,7 @@ or other special materials.
struct S3DVertex2TCoords : S3DVertex
{
//! default constructor
S3DVertex2TCoords() : S3DVertex() {};
S3DVertex2TCoords() : S3DVertex() {}
//! constructor with two different texture coords, but no normal
S3DVertex2TCoords(f32 x, f32 y, f32 z, SColor c, f32 tu, f32 tv, f32 tu2, f32 tv2)
@ -157,7 +157,7 @@ struct S3DVertexTangents : S3DVertex
//! constructor
S3DVertexTangents(f32 x, f32 y, f32 z, f32 nx=0.0f, f32 ny=0.0f, f32 nz=0.0f, SColor c = 0xFFFFFFFF, f32 tu=0.0f, f32 tv=0.0f, f32 tanx=0.0f, f32 tany=0.0f, f32 tanz=0.0f, f32 bx=0.0f, f32 by=0.0f, f32 bz=0.0f)
: S3DVertex(x,y,z, nx,ny,nz, c, tu,tv), Tangent(tanx,tany,tanz), Binormal(bx,by,bz) { }
: S3DVertex(x,y,z, nx,ny,nz, c, tu,tv), Tangent(tanx,tany,tanz), Binormal(bx,by,bz) { }
//! constructor
S3DVertexTangents(const core::vector3df& pos, SColor c,

View File

@ -139,7 +139,6 @@ namespace scene
virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
{
return;
}

View File

@ -26,14 +26,12 @@ namespace scene
}
//! destructor
~SMesh()
virtual ~SMesh()
{
// drop buffers
for (u32 i=0; i<MeshBuffers.size(); ++i)
{
MeshBuffers[i]->drop();
}
};
}
//! returns amount of mesh buffers.
virtual u32 getMeshBufferCount() const

View File

@ -7,15 +7,13 @@
#include "IMeshBuffer.h"
#include "S3DVertex.h"
namespace irr
{
namespace scene
{
{
//! A mesh buffer able to choose between
//! S3DVertex2TCoords, S3DVertex and S3DVertexTangents at runtime
@ -44,9 +42,9 @@ struct SSkinMeshBuffer : public IMeshBuffer
{
switch (VertexType)
{
case video::EVT_2TCOORDS: return (video::S3DVertex*)&Vertices_2TCoords[index];
case video::EVT_TANGENTS: return (video::S3DVertex*)&Vertices_Tangents[index];
default: return &Vertices_Standard[index];
case video::EVT_2TCOORDS: return (video::S3DVertex*)&Vertices_2TCoords[index];
case video::EVT_TANGENTS: return (video::S3DVertex*)&Vertices_Tangents[index];
default: return &Vertices_Standard[index];
}
}
@ -54,9 +52,9 @@ struct SSkinMeshBuffer : public IMeshBuffer
{
switch (VertexType)
{
case video::EVT_2TCOORDS: return Vertices_2TCoords.const_pointer();
case video::EVT_TANGENTS: return Vertices_Tangents.const_pointer();
default: return Vertices_Standard.const_pointer();
case video::EVT_2TCOORDS: return Vertices_2TCoords.const_pointer();
case video::EVT_TANGENTS: return Vertices_Tangents.const_pointer();
default: return Vertices_Standard.const_pointer();
}
}
@ -64,9 +62,9 @@ struct SSkinMeshBuffer : public IMeshBuffer
{
switch (VertexType)
{
case video::EVT_2TCOORDS: return Vertices_2TCoords.pointer();
case video::EVT_TANGENTS: return Vertices_Tangents.pointer();
default: return Vertices_Standard.pointer();
case video::EVT_2TCOORDS: return Vertices_2TCoords.pointer();
case video::EVT_TANGENTS: return Vertices_Tangents.pointer();
default: return Vertices_Standard.pointer();
}
}
@ -74,9 +72,9 @@ struct SSkinMeshBuffer : public IMeshBuffer
{
switch (VertexType)
{
case video::EVT_2TCOORDS: return Vertices_2TCoords.size();
case video::EVT_TANGENTS: return Vertices_Tangents.size();
default: return Vertices_Standard.size();
case video::EVT_2TCOORDS: return Vertices_2TCoords.size();
case video::EVT_TANGENTS: return Vertices_Tangents.size();
default: return Vertices_Standard.size();
}
}
@ -207,12 +205,11 @@ struct SSkinMeshBuffer : public IMeshBuffer
virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) {}
//! append the meshbuffer to the current buffer
virtual void append(const IMeshBuffer* const other) {}
//ISkinnedMesh::SJoint *AttachedJoint;
core::matrix4 Transformation;
virtual void append(const IMeshBuffer* const other) {}
//ISkinnedMesh::SJoint *AttachedJoint;
core::matrix4 Transformation;
video::SMaterial Material;
video::E_VERTEX_TYPE VertexType;
@ -223,6 +220,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
core::aabbox3d<f32> BoundingBox;
};
} // end namespace scene
} // end namespace irr

View File

@ -52,7 +52,7 @@ namespace scene
};
//! Default Constructor
SViewFrustum() {};
SViewFrustum() {}
//! Copy Constructor
SViewFrustum(const SViewFrustum& other);

View File

@ -419,7 +419,7 @@ public:
//! Finds an element in linear time, which is very slow. Use
//! binary_search for faster finding. Only works if =operator is implemented.
//! binary_search for faster finding. Only works if ==operator is implemented.
//! \param element: Element to search for.
//! \return Returns position of the searched element if it was found,
//! otherwise -1 is returned.
@ -434,7 +434,7 @@ public:
//! Finds an element in linear time, which is very slow. Use
//! binary_search for faster finding. Only works if =operator is implemented.
//! binary_search for faster finding. Only works if ==operator is implemented.
//! \param element: Element to search for.
//! \return Returns position of the searched element if it was found,
//! otherwise -1 is returned.

View File

@ -267,12 +267,18 @@ public:
}
//! Direct access operator
T& operator [](const u32 index) const
T& operator [](const u32 index)
{
_IRR_DEBUG_BREAK_IF(index>=used) // bad index
return array[index];
}
//! Direct access operator
const T& operator [](const u32 index) const
{
_IRR_DEBUG_BREAK_IF(index>=used) // bad index
return array[index];
}

View File

@ -215,7 +215,7 @@ namespace io
public:
//! virtual destructor
virtual ~IFileReadCallBack() {};
virtual ~IFileReadCallBack() {}
//! Reads an amount of bytes from the file.
/** \param buffer: Pointer to buffer where to read bytes will be written to.
@ -224,7 +224,7 @@ namespace io
virtual int read(void* buffer, int sizeToRead) = 0;
//! Returns size of file in bytes
virtual long getSize() = 0;
virtual long getSize() const = 0;
};
//! Empty class to be used as parent class for IrrXMLReader.
@ -276,7 +276,7 @@ namespace io
public:
//! Destructor
virtual ~IIrrXMLReader() {};
virtual ~IIrrXMLReader() {}
//! Reads forward to the next xml node.
/** \return Returns false, if there was no further node. */

View File

@ -19,21 +19,21 @@ class line2d
{
public:
line2d() : start(0,0), end(1,1) {};
line2d(T xa, T ya, T xb, T yb) : start(xa, ya), end(xb, yb) {};
line2d(const vector2d<T>& start, const vector2d<T>& end) : start(start), end(end) {};
line2d(const line2d<T>& other) : start(other.start), end(other.end) {};
line2d() : start(0,0), end(1,1) {}
line2d(T xa, T ya, T xb, T yb) : start(xa, ya), end(xb, yb) {}
line2d(const vector2d<T>& start, const vector2d<T>& end) : start(start), end(end) {}
line2d(const line2d<T>& other) : start(other.start), end(other.end) {}
// operators
line2d<T> operator+(const vector2d<T>& point) const { return line2d<T>(start + point, end + point); };
line2d<T>& operator+=(const vector2d<T>& point) { start += point; end += point; return *this; };
line2d<T> operator+(const vector2d<T>& point) const { return line2d<T>(start + point, end + point); }
line2d<T>& operator+=(const vector2d<T>& point) { start += point; end += point; return *this; }
line2d<T> operator-(const vector2d<T>& point) const { return line2d<T>(start - point, end - point); };
line2d<T>& operator-=(const vector2d<T>& point) { start -= point; end -= point; return *this; };
line2d<T> operator-(const vector2d<T>& point) const { return line2d<T>(start - point, end - point); }
line2d<T>& operator-=(const vector2d<T>& point) { start -= point; end -= point; return *this; }
bool operator==(const line2d<T>& other) const { return (start==other.start && end==other.end) || (end==other.start && start==other.end);};
bool operator!=(const line2d<T>& other) const { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);};
bool operator==(const line2d<T>& other) const { return (start==other.start && end==other.end) || (end==other.start && start==other.end);}
bool operator!=(const line2d<T>& other) const { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);}
// functions
@ -43,11 +43,11 @@ class line2d
//! Returns length of line
//! \return Returns length of the line.
f64 getLength() const { return start.getDistanceFrom(end); };
f64 getLength() const { return start.getDistanceFrom(end); }
//! Returns squared length of the line
//! \return Returns squared length of line.
T getLengthSQ() const { return start.getDistanceFromSQ(end); };
T getLengthSQ() const { return start.getDistanceFromSQ(end); }
//! Returns middle of the line
vector2d<T> getMiddle() const
@ -57,7 +57,7 @@ class line2d
//! Returns the vector of the line.
//! \return Returns the vector of the line.
vector2d<T> getVector() const { return vector2d<T>(start.X - end.X, start.Y - end.Y); };
vector2d<T> getVector() const { return vector2d<T>(start.X - end.X, start.Y - end.Y); }
//! Tests if this line intersects with another line.
//! \param l: Other line to test intersection with.
@ -99,13 +99,13 @@ class line2d
//! Returns unit vector of the line.
//! \return Returns unit vector of this line.
vector2d<T> getUnitVector()
vector2d<T> getUnitVector() const
{
T len = (T)(1.0 / getLength());
return vector2d<T>((end.X - start.X) * len, (end.Y - start.Y) * len);
}
f64 getAngleWith(const line2d<T>& l)
f64 getAngleWith(const line2d<T>& l) const
{
vector2d<T> vect = getVector();
vector2d<T> vect2 = l.getVector();
@ -116,7 +116,7 @@ class line2d
//! right, or on the direction of the line
//! \return Returns 0 if the point is on the line
//! <0 if to the left, or >0 if to the right.
T getPointOrientation(const vector2d<T>& point)
T getPointOrientation(const vector2d<T>& point) const
{
return ( (end.X - start.X) * (point.Y - start.Y) -
(point.X - start.X) * (end.Y - start.Y) );
@ -124,7 +124,7 @@ class line2d
//! Returns if the given point is a member of the line
//! \return Returns true if
bool isPointOnLine(const vector2d<T>& point)
bool isPointOnLine(const vector2d<T>& point) const
{
T d = getPointOrientation(point);
return (d == 0 && point.isBetweenPoints(start, end));

View File

@ -21,20 +21,20 @@ class line3d
// Constructors
line3d() : start(0,0,0), end(1,1,1) {};
line3d(T xa, T ya, T za, T xb, T yb, T zb) : start(xa, ya, za), end(xb, yb, zb) {};
line3d(const vector3d<T>& start, const vector3d<T>& end) : start(start), end(end) {};
line3d() : start(0,0,0), end(1,1,1) {}
line3d(T xa, T ya, T za, T xb, T yb, T zb) : start(xa, ya, za), end(xb, yb, zb) {}
line3d(const vector3d<T>& start, const vector3d<T>& end) : start(start), end(end) {}
// operators
line3d<T> operator+(const vector3d<T>& point) const { return line3d<T>(start + point, end + point); };
line3d<T>& operator+=(const vector3d<T>& point) { start += point; end += point; return *this; };
line3d<T> operator+(const vector3d<T>& point) const { return line3d<T>(start + point, end + point); }
line3d<T>& operator+=(const vector3d<T>& point) { start += point; end += point; return *this; }
line3d<T> operator-(const vector3d<T>& point) const { return line3d<T>(start - point, end - point); };
line3d<T>& operator-=(const vector3d<T>& point) { start -= point; end -= point; return *this; };
line3d<T> operator-(const vector3d<T>& point) const { return line3d<T>(start - point, end - point); }
line3d<T>& operator-=(const vector3d<T>& point) { start -= point; end -= point; return *this; }
bool operator==(const line3d<T>& other) const { return (start==other.start && end==other.end) || (end==other.start && start==other.end);};
bool operator!=(const line3d<T>& other) const { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);};
bool operator==(const line3d<T>& other) const { return (start==other.start && end==other.end) || (end==other.start && start==other.end);}
bool operator!=(const line3d<T>& other) const { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);}
// functions
@ -44,11 +44,11 @@ class line3d
//! Returns length of line
//! \return Returns length of line.
T getLength() const { return start.getDistanceFrom(end); };
T getLength() const { return start.getDistanceFrom(end); }
//! Returns sqared length of line
//! \return Returns sqared length of line.
T getLengthSQ() const { return start.getDistanceFromSQ(end); };
T getLengthSQ() const { return start.getDistanceFromSQ(end); }
//! Returns middle of line
vector3d<T> getMiddle() const

View File

@ -102,11 +102,13 @@ class plane3d
//! \param linePoint2: Point 2 of the line.
//! \param outIntersection: Place to store the intersection point, if there is one.
//! \return Returns true if there was an intersection, false if there was not.
bool getIntersectionWithLimitedLine(const vector3d<T>& linePoint1,
const vector3d<T>& linePoint2, vector3d<T>& outIntersection) const
bool getIntersectionWithLimitedLine(
const vector3d<T>& linePoint1,
const vector3d<T>& linePoint2,
vector3d<T>& outIntersection) const
{
return ( getIntersectionWithLine(linePoint1, linePoint2 - linePoint1, outIntersection) &&
outIntersection.isBetweenPoints(linePoint1, linePoint2));
return (getIntersectionWithLine(linePoint1, linePoint2 - linePoint1, outIntersection) &&
outIntersection.isBetweenPoints(linePoint1, linePoint2));
}
//! Classifies the relation of a point to this plane.

View File

@ -21,24 +21,16 @@ namespace core
class position2d
{
public:
position2d(T x, T y)
: X(x), Y(y) {};
position2d()
: X(0), Y(0) {};
position2d() : X(0), Y(0) {}
position2d(T x, T y) : X(x), Y(y) {}
position2d(const position2d<T>& other)
: X(other.X), Y(other.Y) {};
: X(other.X), Y(other.Y) {}
bool operator == (const position2d<T>& other) const
{
return X == other.X && Y == other.Y;
}
bool operator != (const position2d<T>& other) const
{
return X != other.X || Y != other.Y;

View File

@ -21,10 +21,10 @@ class quaternion
public:
//! Default Constructor
quaternion();
quaternion() : X(0.0f), Y(0.0f), Z(0.0f), W(1.0f) {}
//! Constructor
quaternion(f32 X, f32 Y, f32 Z, f32 W);
quaternion(f32 x, f32 y, f32 z, f32 w) : X(x), Y(y), Z(z), W(w) { }
//! Constructor which converts euler angles (radians) to a quaternion
quaternion(f32 x, f32 y, f32 z);
@ -113,18 +113,6 @@ class quaternion
};
//! Default Constructor
inline quaternion::quaternion()
: X(0.0f), Y(0.0f), Z(0.0f), W(1.0f)
{
}
//! Constructor
inline quaternion::quaternion(f32 x, f32 y, f32 z, f32 w)
: X(x), Y(y), Z(z), W(w)
{
}
//! Constructor which converts euler angles to a quaternion
inline quaternion::quaternion(f32 x, f32 y, f32 z)
{

View File

@ -24,22 +24,19 @@ namespace core
{
public:
rect()
: UpperLeftCorner(0,0), LowerRightCorner(0,0) {};
rect() : UpperLeftCorner(0,0), LowerRightCorner(0,0) {}
rect(T x, T y, T x2, T y2)
: UpperLeftCorner(x,y), LowerRightCorner(x2,y2) {};
: UpperLeftCorner(x,y), LowerRightCorner(x2,y2) {}
rect(const position2d<T>& upperLeft, const position2d<T>& lowerRight)
: UpperLeftCorner(upperLeft), LowerRightCorner(lowerRight) {};
: UpperLeftCorner(upperLeft), LowerRightCorner(lowerRight) {}
rect(const rect<T>& other)
: UpperLeftCorner(other.UpperLeftCorner), LowerRightCorner(other.LowerRightCorner) {};
: UpperLeftCorner(other.UpperLeftCorner), LowerRightCorner(other.LowerRightCorner) {}
rect(const position2d<T>& pos, const dimension2d<T>& size)
: UpperLeftCorner(pos), LowerRightCorner(pos.X + size.Width, pos.Y + size.Height) {};
: UpperLeftCorner(pos), LowerRightCorner(pos.X + size.Width, pos.Y + size.Height) {}
rect<T> operator+(const position2d<T>& pos) const
@ -262,15 +259,13 @@ namespace core
}
position2d<T> UpperLeftCorner;
position2d<T> LowerRightCorner;
};
} // end namespace core
} // end namespace irr
#endif

View File

@ -19,29 +19,29 @@ class vector2d
{
public:
vector2d() : X(0), Y(0) {};
vector2d(T nx, T ny) : X(nx), Y(ny) {};
vector2d(const vector2d<T>& other) : X(other.X), Y(other.Y) {};
vector2d() : X(0), Y(0) {}
vector2d(T nx, T ny) : X(nx), Y(ny) {}
vector2d(const vector2d<T>& other) : X(other.X), Y(other.Y) {}
// operators
vector2d<T> operator-() const { return vector2d<T>(-X, -Y); }
vector2d<T> operator-() const { return vector2d<T>(-X, -Y); }
vector2d<T>& operator=(const vector2d<T>& other) { X = other.X; Y = other.Y; return *this; }
vector2d<T>& operator=(const vector2d<T>& other) { X = other.X; Y = other.Y; return *this; }
vector2d<T> operator+(const vector2d<T>& other) const { return vector2d<T>(X + other.X, Y + other.Y); }
vector2d<T>& operator+=(const vector2d<T>& other) { X+=other.X; Y+=other.Y; return *this; }
vector2d<T>& operator+=(const vector2d<T>& other) { X+=other.X; Y+=other.Y; return *this; }
vector2d<T> operator-(const vector2d<T>& other) const { return vector2d<T>(X - other.X, Y - other.Y); }
vector2d<T>& operator-=(const vector2d<T>& other) { X-=other.X; Y-=other.Y; return *this; }
vector2d<T>& operator-=(const vector2d<T>& other) { X-=other.X; Y-=other.Y; return *this; }
vector2d<T> operator*(const vector2d<T>& other) const { return vector2d<T>(X * other.X, Y * other.Y); }
vector2d<T>& operator*=(const vector2d<T>& other) { X*=other.X; Y*=other.Y; return *this; }
vector2d<T>& operator*=(const vector2d<T>& other) { X*=other.X; Y*=other.Y; return *this; }
vector2d<T> operator*(const T v) const { return vector2d<T>(X * v, Y * v); }
vector2d<T>& operator*=(const T v) { X*=v; Y*=v; return *this; }
vector2d<T> operator/(const vector2d<T>& other) const { return vector2d<T>(X / other.X, Y / other.Y); }
vector2d<T>& operator/=(const vector2d<T>& other) { X/=other.X; Y/=other.Y; return *this; }
vector2d<T>& operator/=(const vector2d<T>& other) { X/=other.X; Y/=other.Y; return *this; }
vector2d<T> operator/(const T v) const { return vector2d<T>(X / v, Y / v); }
vector2d<T>& operator/=(const T v) { X/=v; Y/=v; return *this; }

View File

@ -18,9 +18,9 @@ namespace core
{
public:
vector3d() : X(0), Y(0), Z(0) {};
vector3d(T nx, T ny, T nz) : X(nx), Y(ny), Z(nz) {};
vector3d(const vector3d<T>& other) : X(other.X), Y(other.Y), Z(other.Z) {};
vector3d() : X(0), Y(0), Z(0) {}
vector3d(T nx, T ny, T nz) : X(nx), Y(ny), Z(nz) {}
vector3d(const vector3d<T>& other) : X(other.X), Y(other.Y), Z(other.Z) {}
// operators

View File

@ -259,10 +259,10 @@ void CAnimatedMeshSceneNode::render()
m = Mesh->getMesh((s32)frame, 255, StartFrame, EndFrame);
else
{
ISkinnedMesh* skinnedMesh=(ISkinnedMesh*)Mesh;
ISkinnedMesh* skinnedMesh = reinterpret_cast<ISkinnedMesh*>(Mesh);
if (JointMode &2)//write to mesh
skinnedMesh->tranferJointsToMesh(JointChildSceneNodes);
skinnedMesh->transferJointsToMesh(JointChildSceneNodes);
else
skinnedMesh->animateMesh(frame, 1.0f);

View File

@ -511,7 +511,7 @@ bool CD3D8Driver::endScene( s32 windowId, core::rect<s32>* sourceRect )
//! queries the features of the driver, returns true if feature is available
bool CD3D8Driver::queryFeature(E_VIDEO_DRIVER_FEATURE feature)
bool CD3D8Driver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
{
switch (feature)
{
@ -1725,7 +1725,7 @@ void CD3D8Driver::addDynamicLight(const SLight& dl)
//! returns the maximal amount of dynamic lights the device can handle
u32 CD3D8Driver::getMaximalDynamicLightAmount()
u32 CD3D8Driver::getMaximalDynamicLightAmount() const
{
return Caps.MaxActiveLights;
}
@ -1749,7 +1749,7 @@ void CD3D8Driver::setAmbientLight(const SColorf& color)
//! \return Returns the name of the video driver. Example: In case of the DIRECT3D8
//! driver, it would return "Direct3D8.1".
const wchar_t* CD3D8Driver::getName()
const wchar_t* CD3D8Driver::getName() const
{
return L"Direct3D 8.1";
}
@ -1837,7 +1837,7 @@ void CD3D8Driver::drawStencilShadow(bool clearStencilBuffer, video::SColor leftU
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
u32 CD3D8Driver::getMaximalPrimitiveCount()
u32 CD3D8Driver::getMaximalPrimitiveCount() const
{
return Caps.MaxPrimitiveCount;
}
@ -1902,7 +1902,7 @@ E_DRIVER_TYPE CD3D8Driver::getDriverType() const
}
//! Returns the transformation set by setTransform
const core::matrix4& CD3D8Driver::getTransform(E_TRANSFORMATION_STATE state)
const core::matrix4& CD3D8Driver::getTransform(E_TRANSFORMATION_STATE state) const
{
return Matrices[state];
}

View File

@ -46,7 +46,7 @@ namespace video
virtual bool endScene( s32 windowId, core::rect<s32>* sourceRect=0 );
//! queries the features of the driver, returns true if feature is available
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature);
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const;
//! sets transformation
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat);
@ -99,7 +99,7 @@ namespace video
//! \return Returns the name of the video driver. Example: In case of the DIRECT3D8
//! driver, it would return "Direct3D8.1".
virtual const wchar_t* getName();
virtual const wchar_t* getName() const;
//! deletes all dynamic lights there are
virtual void deleteAllDynamicLights();
@ -108,7 +108,7 @@ namespace video
virtual void addDynamicLight(const SLight& light);
//! returns the maximal amount of dynamic lights the device can handle
virtual u32 getMaximalDynamicLightAmount();
virtual u32 getMaximalDynamicLightAmount() const;
//! Sets the dynamic ambient light color. The default color is
//! (0,0,0,0) which means it is dark.
@ -132,7 +132,7 @@ namespace video
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
virtual u32 getMaximalPrimitiveCount();
virtual u32 getMaximalPrimitiveCount() const;
//! Enables or disables a texture creation flag.
virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled);
@ -149,7 +149,7 @@ namespace video
virtual E_DRIVER_TYPE getDriverType() const;
//! Returns the transformation set by setTransform
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state);
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const;
//! Can be called by an IMaterialRenderer to make its work easier.
virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial,

View File

@ -523,7 +523,7 @@ bool CD3D9Driver::endScene( s32 windowId, core::rect<s32>* sourceRect )
//! queries the features of the driver, returns true if feature is available
bool CD3D9Driver::queryFeature(E_VIDEO_DRIVER_FEATURE feature)
bool CD3D9Driver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
{
switch (feature)
{
@ -1723,7 +1723,7 @@ void CD3D9Driver::addDynamicLight(const SLight& dl)
//! returns the maximal amount of dynamic lights the device can handle
u32 CD3D9Driver::getMaximalDynamicLightAmount()
u32 CD3D9Driver::getMaximalDynamicLightAmount() const
{
return Caps.MaxActiveLights;
}
@ -1747,7 +1747,7 @@ void CD3D9Driver::setAmbientLight(const SColorf& color)
//! \return Returns the name of the video driver. Example: In case of the DIRECT3D9
//! driver, it would return "Direct3D9.0".
const wchar_t* CD3D9Driver::getName()
const wchar_t* CD3D9Driver::getName() const
{
return L"Direct3D 9.0";
}
@ -1835,7 +1835,7 @@ void CD3D9Driver::drawStencilShadow(bool clearStencilBuffer, video::SColor leftU
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
u32 CD3D9Driver::getMaximalPrimitiveCount()
u32 CD3D9Driver::getMaximalPrimitiveCount() const
{
return Caps.MaxPrimitiveCount;
}
@ -1946,7 +1946,7 @@ E_DRIVER_TYPE CD3D9Driver::getDriverType() const
//! Returns the transformation set by setTransform
const core::matrix4& CD3D9Driver::getTransform(E_TRANSFORMATION_STATE state)
const core::matrix4& CD3D9Driver::getTransform(E_TRANSFORMATION_STATE state) const
{
return Matrices[state];
}

View File

@ -40,7 +40,7 @@ namespace video
virtual bool endScene( s32 windowId = 0, core::rect<s32>* sourceRect=0 );
//! queries the features of the driver, returns true if feature is available
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature);
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const;
//! sets transformation
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat);
@ -93,7 +93,7 @@ namespace video
//! \return Returns the name of the video driver. Example: In case of the DIRECT3D8
//! driver, it would return "Direct3D8.1".
virtual const wchar_t* getName();
virtual const wchar_t* getName() const;
//! deletes all dynamic lights there are
virtual void deleteAllDynamicLights();
@ -102,7 +102,7 @@ namespace video
virtual void addDynamicLight(const SLight& light);
//! returns the maximal amount of dynamic lights the device can handle
virtual u32 getMaximalDynamicLightAmount();
virtual u32 getMaximalDynamicLightAmount() const;
//! Sets the dynamic ambient light color. The default color is
//! (0,0,0,0) which means it is dark.
@ -126,7 +126,7 @@ namespace video
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
virtual u32 getMaximalPrimitiveCount();
virtual u32 getMaximalPrimitiveCount() const;
//! Enables or disables a texture creation flag.
virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled);
@ -147,7 +147,7 @@ namespace video
virtual E_DRIVER_TYPE getDriverType() const;
//! Returns the transformation set by setTransform
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state);
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const;
//! Sets a vertex shader constant.
virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1);

View File

@ -92,45 +92,45 @@ ISceneNodeAnimator* CDefaultSceneNodeAnimatorFactory::createSceneNodeAnimator(co
//! returns amount of scene node animator types this factory is able to create
s32 CDefaultSceneNodeAnimatorFactory::getCreatableSceneNodeAnimatorTypeCount()
u32 CDefaultSceneNodeAnimatorFactory::getCreatableSceneNodeAnimatorTypeCount() const
{
return ESNAT_COUNT;
}
//! returns type of a createable scene node animator type
ESCENE_NODE_ANIMATOR_TYPE CDefaultSceneNodeAnimatorFactory::getCreateableSceneNodeAnimatorType(s32 idx)
ESCENE_NODE_ANIMATOR_TYPE CDefaultSceneNodeAnimatorFactory::getCreateableSceneNodeAnimatorType(u32 idx) const
{
if (idx>=0 && idx<ESNAT_COUNT)
if (idx<ESNAT_COUNT)
return (ESCENE_NODE_ANIMATOR_TYPE)idx;
return ESNAT_UNKNOWN;
else
return ESNAT_UNKNOWN;
}
//! returns type name of a createable scene node animator type
const c8* CDefaultSceneNodeAnimatorFactory::getCreateableSceneNodeAnimatorTypeName(s32 idx)
const c8* CDefaultSceneNodeAnimatorFactory::getCreateableSceneNodeAnimatorTypeName(u32 idx) const
{
if (idx>=0 && idx<ESNAT_COUNT)
if (idx<ESNAT_COUNT)
return SceneNodeAnimatorTypeNames[idx];
return 0;
else
return 0;
}
//! returns type name of a createable scene node animator type
const c8* CDefaultSceneNodeAnimatorFactory::getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type)
const c8* CDefaultSceneNodeAnimatorFactory::getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const
{
// for this factory: index == type
if (type>=0 && type<ESNAT_COUNT)
if (type<ESNAT_COUNT)
return SceneNodeAnimatorTypeNames[type];
return 0;
else
return 0;
}
ESCENE_NODE_ANIMATOR_TYPE CDefaultSceneNodeAnimatorFactory::getTypeFromName(const c8* name)
ESCENE_NODE_ANIMATOR_TYPE CDefaultSceneNodeAnimatorFactory::getTypeFromName(const c8* name) const
{
for ( int i=0; SceneNodeAnimatorTypeNames[i]; ++i)
for ( u32 i=0; SceneNodeAnimatorTypeNames[i]; ++i)
if (!strcmp(name, SceneNodeAnimatorTypeNames[i]) )
return (ESCENE_NODE_ANIMATOR_TYPE)i;

View File

@ -37,26 +37,26 @@ namespace scene
virtual ISceneNodeAnimator* createSceneNodeAnimator(const char* typeName, ISceneNode* target);
//! returns amount of scene node animator types this factory is able to create
virtual s32 getCreatableSceneNodeAnimatorTypeCount();
virtual u32 getCreatableSceneNodeAnimatorTypeCount() const;
//! returns type of a createable scene node animator type
/** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and
getCreatableSceneNodeTypeCount() */
virtual ESCENE_NODE_ANIMATOR_TYPE getCreateableSceneNodeAnimatorType(s32 idx);
virtual ESCENE_NODE_ANIMATOR_TYPE getCreateableSceneNodeAnimatorType(u32 idx) const;
//! returns type name of a createable scene node animator type
/** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and
getCreatableSceneNodeAnimatorTypeCount() */
virtual const c8* getCreateableSceneNodeAnimatorTypeName(s32 idx);
virtual const c8* getCreateableSceneNodeAnimatorTypeName(u32 idx) const;
//! returns type name of a createable scene node animator type
/** \param type: Type of scene node animator.
\return: Returns name of scene node animator type if this factory can create the type, otherwise 0. */
virtual const c8* getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type);
virtual const c8* getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const;
private:
ESCENE_NODE_ANIMATOR_TYPE getTypeFromName(const c8* name);
ESCENE_NODE_ANIMATOR_TYPE getTypeFromName(const c8* name) const;
ISceneManager* Manager;
};

View File

@ -116,36 +116,36 @@ ISceneNode* CDefaultSceneNodeFactory::addSceneNode(const c8* typeName, ISceneNod
//! returns amount of scene node types this factory is able to create
s32 CDefaultSceneNodeFactory::getCreatableSceneNodeTypeCount()
u32 CDefaultSceneNodeFactory::getCreatableSceneNodeTypeCount() const
{
return SupportedSceneNodeTypes.size();
}
//! returns type of a createable scene node type
ESCENE_NODE_TYPE CDefaultSceneNodeFactory::getCreateableSceneNodeType(s32 idx)
ESCENE_NODE_TYPE CDefaultSceneNodeFactory::getCreateableSceneNodeType(u32 idx) const
{
if (idx>=0 && idx<(s32)SupportedSceneNodeTypes.size())
if (idx<SupportedSceneNodeTypes.size())
return SupportedSceneNodeTypes[idx].Type;
return ESNT_UNKNOWN;
else
return ESNT_UNKNOWN;
}
//! returns type name of a createable scene node type
const c8* CDefaultSceneNodeFactory::getCreateableSceneNodeTypeName(s32 idx)
const c8* CDefaultSceneNodeFactory::getCreateableSceneNodeTypeName(u32 idx) const
{
if (idx>=0 && idx<(s32)SupportedSceneNodeTypes.size())
if (idx<SupportedSceneNodeTypes.size())
return SupportedSceneNodeTypes[idx].TypeName.c_str();
return 0;
else
return 0;
}
//! returns type name of a createable scene node type
const c8* CDefaultSceneNodeFactory::getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type)
const c8* CDefaultSceneNodeFactory::getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) const
{
for (unsigned int i=0; i<SupportedSceneNodeTypes.size(); ++i)
for (u32 i=0; i<SupportedSceneNodeTypes.size(); ++i)
if (SupportedSceneNodeTypes[i].Type == type)
return SupportedSceneNodeTypes[i].TypeName.c_str();
@ -153,9 +153,9 @@ const c8* CDefaultSceneNodeFactory::getCreateableSceneNodeTypeName(ESCENE_NODE_T
}
ESCENE_NODE_TYPE CDefaultSceneNodeFactory::getTypeFromName(const c8* name)
ESCENE_NODE_TYPE CDefaultSceneNodeFactory::getTypeFromName(const c8* name) const
{
for (unsigned int i=0; i<SupportedSceneNodeTypes.size(); ++i)
for (u32 i=0; i<SupportedSceneNodeTypes.size(); ++i)
if (SupportedSceneNodeTypes[i].TypeName == name)
return SupportedSceneNodeTypes[i].Type;

View File

@ -37,26 +37,26 @@ namespace scene
virtual ISceneNode* addSceneNode(const c8* typeName, ISceneNode* parent=0);
//! returns amount of scene node types this factory is able to create
virtual s32 getCreatableSceneNodeTypeCount();
virtual u32 getCreatableSceneNodeTypeCount() const;
//! returns type name of a createable scene node type by index
/** \param idx: Index of scene node type in this factory. Must be a value between 0 and
getCreatableSceneNodeTypeCount() */
virtual const c8* getCreateableSceneNodeTypeName(s32 idx);
uetCreatableSceneNodeTypeCount() */
virtual const c8* getCreateableSceneNodeTypeName(u32 idx) const;
//! returns type of a createable scene node type
/** \param idx: Index of scene node type in this factory. Must be a value between 0 and
getCreatableSceneNodeTypeCount() */
virtual ESCENE_NODE_TYPE getCreateableSceneNodeType(s32 idx);
virtual ESCENE_NODE_TYPE getCreateableSceneNodeType(u32 idx) const;
//! returns type name of a createable scene node type
/** \param idx: Type of scene node.
\return: Returns name of scene node type if this factory can create the type, otherwise 0. */
virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type);
virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) const;
private:
ESCENE_NODE_TYPE getTypeFromName(const c8* name);
ESCENE_NODE_TYPE getTypeFromName(const c8* name) const;
struct SSceneNodeTypePair
{

View File

@ -14,7 +14,6 @@ namespace video
{
//! constructor
CDepthBuffer::CDepthBuffer(const core::dimension2d<s32>& size)
: Buffer(0), Size(0,0)
@ -73,7 +72,7 @@ void CDepthBuffer::setSize(const core::dimension2d<s32>& size)
//! returns the size of the zbuffer
const core::dimension2d<s32>& CDepthBuffer::getSize()
const core::dimension2d<s32>& CDepthBuffer::getSize() const
{
return Size;
}

View File

@ -29,7 +29,7 @@ namespace video
virtual void setSize(const core::dimension2d<s32>& size);
//! returns the size of the zbuffer
virtual const core::dimension2d<s32>& getSize();
virtual const core::dimension2d<s32>& getSize() const;
//! locks the zbuffer
virtual fp24* lock();

View File

@ -20,35 +20,35 @@ CFPSCounter::CFPSCounter()
//! returns current fps
s32 CFPSCounter::getFPS()
s32 CFPSCounter::getFPS() const
{
return FPS;
}
//! returns current primitive count
u32 CFPSCounter::getPrimitive()
u32 CFPSCounter::getPrimitive() const
{
return Primitive;
}
//! returns average primitive count of last period
u32 CFPSCounter::getPrimitiveAverage()
u32 CFPSCounter::getPrimitiveAverage() const
{
return PrimitiveAverage;
}
//! returns accumulated primitive count since start
u32 CFPSCounter::getPrimitiveTotal()
u32 CFPSCounter::getPrimitiveTotal() const
{
return PrimitiveTotal;
}
//! to be called every frame
void CFPSCounter::registerFrame(u32 now, u32 primitivesDrawn )
void CFPSCounter::registerFrame(u32 now, u32 primitivesDrawn)
{
++FramesCounted;
PrimitiveTotal += primitivesDrawn;

View File

@ -19,16 +19,16 @@ public:
CFPSCounter();
//! returns current fps
s32 getFPS();
s32 getFPS() const;
//! returns primitive count
u32 getPrimitive();
u32 getPrimitive() const;
//! returns average primitive count of last period
u32 getPrimitiveAverage();
u32 getPrimitiveAverage() const;
//! returns accumulated primitive count since start
u32 getPrimitiveTotal();
u32 getPrimitiveTotal() const;
//! to be called every frame
void registerFrame(u32 now, u32 primitive);

View File

@ -1000,7 +1000,7 @@ void CIrrDeviceLinux::closeDevice()
//! returns if window is active. if not, nothing need to be drawn
bool CIrrDeviceLinux::isWindowActive()
bool CIrrDeviceLinux::isWindowActive() const
{
return WindowActive;
}

View File

@ -69,7 +69,7 @@ namespace irr
virtual void setWindowCaption(const wchar_t* text);
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive();
virtual bool isWindowActive() const;
//! presents a surface in the client area
virtual void present(video::IImage* surface, s32 windowId = 0, core::rect<s32>* src=0 );

View File

@ -388,7 +388,7 @@ void CIrrDeviceSDL::setResizeAble(bool resize)
//! returns if window is active. if not, nothing need to be drawn
bool CIrrDeviceSDL::isWindowActive()
bool CIrrDeviceSDL::isWindowActive() const
{
return WindowActive;
}

View File

@ -48,7 +48,7 @@ namespace irr
virtual void setWindowCaption(const wchar_t* text);
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive();
virtual bool isWindowActive() const;
//! presents a surface in the client area
virtual void present(video::IImage* surface, s32 windowId = 0, core::rect<s32>* src=0);

View File

@ -118,7 +118,7 @@ ITimer* CIrrDeviceStub::getTimer()
//! Returns the version of the engine.
const char* CIrrDeviceStub::getVersion()
const char* CIrrDeviceStub::getVersion() const
{
return IRRLICHT_SDK_VERSION;
}

View File

@ -77,7 +77,7 @@ namespace irr
virtual ITimer* getTimer();
//! Returns the version of the engine.
virtual const char* getVersion();
virtual const char* getVersion() const;
//! send the event to the right receiver
virtual void postEventFromUser(const SEvent& event);

View File

@ -681,7 +681,7 @@ void CIrrDeviceWin32::closeDevice()
//! returns if window is active. if not, nothing need to be drawn
bool CIrrDeviceWin32::isWindowActive()
bool CIrrDeviceWin32::isWindowActive() const
{
bool ret = (GetActiveWindow() == HWnd);
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;

View File

@ -47,7 +47,7 @@ namespace irr
virtual void setWindowCaption(const wchar_t* text);
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive();
virtual bool isWindowActive() const;
//! presents a surface in the client area
virtual void present(video::IImage* surface, s32 windowId = 0, core::rect<s32>* src=0 );

View File

@ -84,7 +84,7 @@ bool CLimitReadFile::seek(long finalPos, bool relativeMovement)
//! returns size of file
long CLimitReadFile::getSize()
long CLimitReadFile::getSize() const
{
return AreaSize;
}
@ -92,7 +92,7 @@ long CLimitReadFile::getSize()
//! returns where in the file we are.
long CLimitReadFile::getPos()
long CLimitReadFile::getPos() const
{
return File->getPos() - AreaStart;
}

View File

@ -38,10 +38,10 @@ namespace io
virtual bool seek(long finalPos, bool relativeMovement = false);
//! returns size of file
virtual long getSize();
virtual long getSize() const;
//! returns where in the file we are.
virtual long getPos();
virtual long getPos() const;
//! returns name of file
virtual const c8* getFileName() const;

View File

@ -76,7 +76,7 @@ bool CMemoryReadFile::seek(long finalPos, bool relativeMovement)
//! returns size of file
long CMemoryReadFile::getSize()
long CMemoryReadFile::getSize() const
{
return Len;
}
@ -84,7 +84,7 @@ long CMemoryReadFile::getSize()
//! returns where in the file we are.
long CMemoryReadFile::getPos()
long CMemoryReadFile::getPos() const
{
return Pos;
}

View File

@ -34,10 +34,10 @@ namespace io
virtual bool seek(long finalPos, bool relativeMovement = false);
//! returns size of file
virtual long getSize();
virtual long getSize() const;
//! returns where in the file we are.
virtual long getPos();
virtual long getPos() const;
//! returns name of file
virtual const c8* getFileName() const;

View File

@ -39,7 +39,7 @@ s32 CMetaTriangleSelector::getTriangleCount() const
//! Gets all triangles.
void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::matrix4* transform)
s32& outTriangleCount, const core::matrix4* transform) const
{
s32 outWritten = 0;
@ -58,7 +58,7 @@ void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 array
//! Gets all triangles which lie within a specific bounding box.
void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::aabbox3d<f32>& box,
const core::matrix4* transform)
const core::matrix4* transform) const
{
s32 outWritten = 0;
@ -78,7 +78,7 @@ void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 array
//! Gets all triangles which have or may have contact with a 3d line.
void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform)
const core::matrix4* transform) const
{
s32 outWritten = 0;

View File

@ -29,17 +29,17 @@ public:
//! Gets all triangles.
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::matrix4* transform=0);
s32& outTriangleCount, const core::matrix4* transform=0) const;
//! Gets all triangles which lie within a specific bounding box.
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::aabbox3d<f32>& box,
const core::matrix4* transform=0);
const core::matrix4* transform=0) const;
//! Gets all triangles which have or may have contact with a 3d line.
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform=0);
const core::matrix4* transform=0) const;
//! Adds a triangle selector to the collection of triangle selectors
//! in this metaTriangleSelector.

View File

@ -182,7 +182,7 @@ bool CNullDriver::endScene( s32 windowId, core::rect<s32>* sourceRect )
//! queries the features of the driver, returns true if feature is available
bool CNullDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature)
bool CNullDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
{
return false;
}
@ -196,7 +196,7 @@ void CNullDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4
//! Returns the transformation set by setTransform
const core::matrix4& CNullDriver::getTransform(E_TRANSFORMATION_STATE state)
const core::matrix4& CNullDriver::getTransform(E_TRANSFORMATION_STATE state) const
{
return TransformationMatrix;
}
@ -245,7 +245,7 @@ ITexture* CNullDriver::getTextureByIndex(u32 i)
//! Returns amount of textures currently loaded
s32 CNullDriver::getTextureCount()
u32 CNullDriver::getTextureCount() const
{
return Textures.size();
}
@ -676,21 +676,21 @@ void CNullDriver::draw2DPolygon(core::position2d<s32> center,
//! returns screen size
core::dimension2d<s32> CNullDriver::getScreenSize()
const core::dimension2d<s32>& CNullDriver::getScreenSize() const
{
return ScreenSize;
}
//! returns the current render target size,
//! or the screen size if render targets are not implemented
core::dimension2d<s32> CNullDriver::getCurrentRenderTargetSize()
const core::dimension2d<s32>& CNullDriver::getCurrentRenderTargetSize() const
{
return ScreenSize;
}
// returns current frames per second value
s32 CNullDriver::getFPS()
s32 CNullDriver::getFPS() const
{
return FPSCounter.getFPS();
}
@ -699,7 +699,7 @@ s32 CNullDriver::getFPS()
//! returns amount of primitives (mostly triangles) were drawn in the last frame.
//! very useful method for statistics.
u32 CNullDriver::getPrimitiveCountDrawn( u32 param )
u32 CNullDriver::getPrimitiveCountDrawn( u32 param ) const
{
return (0 == param) ? FPSCounter.getPrimitive() : (1 == param) ? FPSCounter.getPrimitiveAverage() : FPSCounter.getPrimitiveTotal();
}
@ -717,7 +717,7 @@ void CNullDriver::setAmbientLight(const SColorf& color)
//! \return Returns the name of the video driver. Example: In case of the DIRECT3D8
//! driver, it would return "Direct3D8".
const wchar_t* CNullDriver::getName()
const wchar_t* CNullDriver::getName() const
{
return L"Irrlicht NullDevice";
}
@ -758,7 +758,7 @@ void CNullDriver::addDynamicLight(const SLight& light)
//! returns the maximal amount of dynamic lights the device can handle
u32 CNullDriver::getMaximalDynamicLightAmount()
u32 CNullDriver::getMaximalDynamicLightAmount() const
{
return 0;
}
@ -766,7 +766,7 @@ u32 CNullDriver::getMaximalDynamicLightAmount()
//! Returns current amount of dynamic lights set
//! \return Current amount of dynamic lights set
u32 CNullDriver::getDynamicLightCount()
u32 CNullDriver::getDynamicLightCount() const
{
return Lights.size();
}
@ -776,7 +776,7 @@ u32 CNullDriver::getDynamicLightCount()
//! \param idx: Zero based index of the light. Must be greater than 0 and smaller
//! than IVideoDriver()::getDynamicLightCount.
//! \return Light data.
const SLight& CNullDriver::getDynamicLight(u32 idx)
const SLight& CNullDriver::getDynamicLight(u32 idx) const
{
if ( idx < Lights.size() )
return Lights[idx];
@ -786,7 +786,7 @@ const SLight& CNullDriver::getDynamicLight(u32 idx)
//! Creates an 1bit alpha channel of the texture based of an color key.
void CNullDriver::makeColorKeyTexture(video::ITexture* texture, video::SColor color)
void CNullDriver::makeColorKeyTexture(video::ITexture* texture, video::SColor color) const
{
if (!texture)
return;
@ -858,7 +858,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture, video::SColor co
//! Creates an 1bit alpha channel of the texture based of an color key position.
void CNullDriver::makeColorKeyTexture(video::ITexture* texture,
core::position2d<s32> colorKeyPixelPos)
core::position2d<s32> colorKeyPixelPos) const
{
if (!texture)
return;
@ -928,7 +928,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture,
//! Creates a normal map from a height map texture.
//! \param amplitude: Constant value by which the height information is multiplied.
void CNullDriver::makeNormalMapTexture(video::ITexture* texture, f32 amplitude)
void CNullDriver::makeNormalMapTexture(video::ITexture* texture, f32 amplitude) const
{
if (!texture)
return;
@ -1046,16 +1046,16 @@ void CNullDriver::makeNormalMapTexture(video::ITexture* texture, f32 amplitude)
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
u32 CNullDriver::getMaximalPrimitiveCount()
u32 CNullDriver::getMaximalPrimitiveCount() const
{
return 0xFFFFFFFF;
}
//! checks triangle count and print warning if wrong
bool CNullDriver::checkPrimitiveCount(u32 prmCount)
bool CNullDriver::checkPrimitiveCount(u32 prmCount) const
{
u32 m = getMaximalPrimitiveCount();
const u32 m = getMaximalPrimitiveCount();
if (prmCount > m)
{
@ -1088,7 +1088,7 @@ void CNullDriver::setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enab
//! Returns if a texture creation flag is enabled or disabled.
bool CNullDriver::getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag)
bool CNullDriver::getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const
{
return (TextureCreationFlags & flag)!=0;
}
@ -1412,21 +1412,21 @@ IMaterialRenderer* CNullDriver::getMaterialRenderer(u32 idx)
{
if ( idx < MaterialRenderers.size() )
return MaterialRenderers[idx].Renderer;
return 0;
else
return 0;
}
//! Returns amount of currently available material renderers.
u32 CNullDriver::getMaterialRendererCount()
u32 CNullDriver::getMaterialRendererCount() const
{
return MaterialRenderers.size();
}
//! Returns name of the material renderer
const char* CNullDriver::getMaterialRendererName(u32 idx)
const char* CNullDriver::getMaterialRendererName(u32 idx) const
{
if ( idx < MaterialRenderers.size() )
return MaterialRenderers[idx].Name.c_str();

View File

@ -45,7 +45,7 @@ namespace video
virtual bool endScene( s32 windowId = 0, core::rect<s32>* sourceRect=0 );
//! queries the features of the driver, returns true if feature is available
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature);
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const;
//! sets transformation
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat);
@ -63,7 +63,7 @@ namespace video
virtual ITexture* getTextureByIndex(u32 index);
//! Returns amount of textures currently loaded
virtual s32 getTextureCount();
virtual u32 getTextureCount() const;
//! Renames a texture
virtual void renameTexture(ITexture* texture, const c8* newName);
@ -179,17 +179,17 @@ namespace video
f32 density=0.01f, bool pixelFog=false, bool rangeFog=false);
//! returns screen size
virtual core::dimension2d<s32> getScreenSize();
virtual const core::dimension2d<s32>& getScreenSize() const;
//! returns screen size
virtual core::dimension2d<s32> getCurrentRenderTargetSize();
virtual const core::dimension2d<s32>& getCurrentRenderTargetSize() const;
// returns current frames per second value
virtual s32 getFPS();
virtual s32 getFPS() const;
//! returns amount of primitives (mostly triangles) were drawn in the last frame.
//! very useful method for statistics.
virtual u32 getPrimitiveCountDrawn( u32 param = 0 );
virtual u32 getPrimitiveCountDrawn( u32 param = 0 ) const;
//! deletes all dynamic lights there are
virtual void deleteAllDynamicLights();
@ -198,11 +198,11 @@ namespace video
virtual void addDynamicLight(const SLight& light);
//! returns the maximal amount of dynamic lights the device can handle
virtual u32 getMaximalDynamicLightAmount();
virtual u32 getMaximalDynamicLightAmount() const;
//! \return Returns the name of the video driver. Example: In case of the DIRECT3D8
//! driver, it would return "Direct3D8.1".
virtual const wchar_t* getName();
virtual const wchar_t* getName() const;
//! Sets the dynamic ambient light color. The default color is
//! (0,0,0,0) which means it is dark.
@ -231,13 +231,13 @@ namespace video
//! Returns current amount of dynamic lights set
//! \return Current amount of dynamic lights set
virtual u32 getDynamicLightCount();
virtual u32 getDynamicLightCount() const;
//! Returns light data which was previously set with IVideDriver::addDynamicLight().
//! \param idx: Zero based index of the light. Must be greater than 0 and smaller
//! than IVideoDriver()::getDynamicLightCount.
//! \return Light data.
virtual const SLight& getDynamicLight(u32 idx);
virtual const SLight& getDynamicLight(u32 idx) const;
//! Removes a texture from the texture cache and deletes it, freeing lot of
//! memory.
@ -251,25 +251,25 @@ namespace video
virtual ITexture* createRenderTargetTexture(const core::dimension2d<s32>& size, const c8* name);
//! Creates an 1bit alpha channel of the texture based of an color key.
virtual void makeColorKeyTexture(video::ITexture* texture, video::SColor color);
virtual void makeColorKeyTexture(video::ITexture* texture, video::SColor color) const;
//! Creates an 1bit alpha channel of the texture based of an color key position.
virtual void makeColorKeyTexture(video::ITexture* texture, core::position2d<s32> colorKeyPixelPos);
virtual void makeColorKeyTexture(video::ITexture* texture, core::position2d<s32> colorKeyPixelPos) const;
//! Creates a normal map from a height map texture.
//! \param amplitude: Constant value by which the height information is multiplied.
virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f);
virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const;
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
virtual u32 getMaximalPrimitiveCount();
virtual u32 getMaximalPrimitiveCount() const;
//! Enables or disables a texture creation flag.
virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled);
//! Returns if a texture creation flag is enabled or disabled.
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag);
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const;
//! Creates a software image from a file.
virtual IImage* createImageFromFile(const char* filename);
@ -303,7 +303,7 @@ namespace video
virtual E_DRIVER_TYPE getDriverType() const;
//! Returns the transformation set by setTransform
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state);
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const;
//! Returns pointer to the IGPUProgrammingServices interface.
virtual IGPUProgrammingServices* getGPUProgrammingServices();
@ -336,10 +336,10 @@ namespace video
virtual IMaterialRenderer* getMaterialRenderer(u32 idx);
//! Returns amount of currently available material renderers.
virtual u32 getMaterialRendererCount();
virtual u32 getMaterialRendererCount() const;
//! Returns name of the material renderer
virtual const char* getMaterialRendererName(u32 idx);
virtual const char* getMaterialRendererName(u32 idx) const;
//! Adds a new material renderer to the VideoDriver, based on a high level shading
//! language. Currently only HLSL in D3D9 is supported.
@ -433,7 +433,7 @@ namespace video
virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const char* name);
//! checks triangle count and print warning if wrong
bool checkPrimitiveCount(u32 prmcnt);
bool checkPrimitiveCount(u32 prmcnt) const;
// adds a material renderer and drops it afterwards. To be used for internal creation
s32 addAndDropMaterialRenderer(IMaterialRenderer* m);
@ -445,7 +445,7 @@ namespace video
void printVersion();
//! normal map lookup 32 bit version
inline f32 nml32(int x, int y, int pitch, int height, s32 *p)
inline f32 nml32(int x, int y, int pitch, int height, s32 *p) const
{
if (x < 0) x = pitch-1; if (x >= pitch) x = 0;
if (y < 0) y = height-1; if (y >= height) y = 0;
@ -453,7 +453,7 @@ namespace video
}
//! normal map lookup 16 bit version
inline f32 nml16(int x, int y, int pitch, int height, s16 *p)
inline f32 nml16(int x, int y, int pitch, int height, s16 *p) const
{
if (x < 0) x = pitch-1; if (x >= pitch) x = 0;
if (y < 0) y = height-1; if (y >= height) y = 0;

View File

@ -22,28 +22,26 @@ namespace irr
// constructor
COSOperator::COSOperator(const c8* osVersion)
{
OperatingSystem = osVersion;
}
COSOperator::COSOperator(const c8* osVersion) : OperatingSystem(osVersion)
{ }
//! returns the current operating system version as string.
const wchar_t* COSOperator::getOperationSystemVersion()
const wchar_t* COSOperator::getOperationSystemVersion() const
{
return OperatingSystem.c_str();
}
//! copies text to the clipboard
void COSOperator::copyToClipboard(const c8* text)
void COSOperator::copyToClipboard(const c8* text) const
{
if (strlen(text)==0)
return;
// Windows version
#if defined(_IRR_WINDOWS_API_)
if (!OpenClipboard(0) || text == 0)
if (!OpenClipboard(NULL) || text == 0)
return;
EmptyClipboard();
@ -72,7 +70,7 @@ void COSOperator::copyToClipboard(const c8* text)
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
c8* COSOperator::getTextFromClipboard()
c8* COSOperator::getTextFromClipboard() const
{
#if defined(_IRR_WINDOWS_API_)
if (!OpenClipboard(NULL))
@ -97,7 +95,7 @@ c8* COSOperator::getTextFromClipboard()
}
bool COSOperator::getProcessorSpeedMHz(irr::u32* MHz)
bool COSOperator::getProcessorSpeedMHz(irr::u32* MHz) const
{
#if defined(_IRR_WINDOWS_API_)
LONG Error;
@ -139,7 +137,7 @@ bool COSOperator::getProcessorSpeedMHz(irr::u32* MHz)
#endif
}
bool COSOperator::getSystemMemory(irr::u32* Total, irr::u32* Avail)
bool COSOperator::getSystemMemory(irr::u32* Total, irr::u32* Avail) const
{
#if defined(_IRR_WINDOWS_API_)
MEMORYSTATUS MemoryStatus;

View File

@ -19,29 +19,26 @@ public:
// constructor
COSOperator(const c8* osversion);
//! destructor
virtual ~COSOperator() {};
//! returns the current operation system version as string.
virtual const wchar_t* getOperationSystemVersion();
virtual const wchar_t* getOperationSystemVersion() const;
//! copies text to the clipboard
virtual void copyToClipboard(const c8* text);
virtual void copyToClipboard(const c8* text) const;
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
virtual c8* getTextFromClipboard();
virtual c8* getTextFromClipboard() const;
//! gets the processor speed in megahertz
//! \param Mhz:
//! \return Returns true if successful, false if not
virtual bool getProcessorSpeedMHz(irr::u32* MHz);
virtual bool getProcessorSpeedMHz(irr::u32* MHz) const;
//! gets the total and available system RAM in kB
//! \param Total: will contain the total system memory
//! \param Avail: will contain the available memory
//! \return Returns true if successful, false if not
virtual bool getSystemMemory(irr::u32* Total, irr::u32* Avail);
virtual bool getSystemMemory(irr::u32* Total, irr::u32* Avail) const;
private:

View File

@ -431,7 +431,7 @@ bool COpenGLDriver::beginScene(bool backBuffer, bool zBuffer, SColor color)
//! Returns the transformation set by setTransform
const core::matrix4& COpenGLDriver::getTransform(E_TRANSFORMATION_STATE state)
const core::matrix4& COpenGLDriver::getTransform(E_TRANSFORMATION_STATE state) const
{
return Matrices[state];
}
@ -1649,7 +1649,7 @@ void COpenGLDriver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh
//! \return Returns the name of the video driver. Example: In case of the Direct3D8
//! driver, it would return "Direct3D8.1".
const wchar_t* COpenGLDriver::getName()
const wchar_t* COpenGLDriver::getName() const
{
return Name.c_str();
}
@ -1757,7 +1757,7 @@ void COpenGLDriver::addDynamicLight(const SLight& light)
//! returns the maximal amount of dynamic lights the device can handle
u32 COpenGLDriver::getMaximalDynamicLightAmount()
u32 COpenGLDriver::getMaximalDynamicLightAmount() const
{
return MaxLights;
}
@ -2179,7 +2179,7 @@ ITexture* COpenGLDriver::createRenderTargetTexture(const core::dimension2d<s32>&
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
u32 COpenGLDriver::getMaximalPrimitiveCount()
u32 COpenGLDriver::getMaximalPrimitiveCount() const
{
return 65535;// TODO: Fix all loaders to auto-split and then return the correct value: MaxIndices;
}

View File

@ -110,7 +110,7 @@ namespace video
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
//! queries the features of the driver, returns true if feature is available
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature)
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
{
return COpenGLExtensionHandler::queryFeature(feature);
}
@ -175,7 +175,7 @@ namespace video
//! \return Returns the name of the video driver. Example: In case of the Direct3D8
//! driver, it would return "Direct3D8.1".
virtual const wchar_t* getName();
virtual const wchar_t* getName() const;
//! deletes all dynamic lights there are
virtual void deleteAllDynamicLights();
@ -184,7 +184,7 @@ namespace video
virtual void addDynamicLight(const SLight& light);
//! returns the maximal amount of dynamic lights the device can handle
virtual u32 getMaximalDynamicLightAmount();
virtual u32 getMaximalDynamicLightAmount() const;
//! Sets the dynamic ambient light color. The default color is
//! (0,0,0,0) which means it is dark.
@ -220,7 +220,7 @@ namespace video
virtual E_DRIVER_TYPE getDriverType() const;
//! Returns the transformation set by setTransform
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state);
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const;
//! Can be called by an IMaterialRenderer to make its work easier.
virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastmaterial,
@ -267,7 +267,7 @@ namespace video
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
virtual u32 getMaximalPrimitiveCount();
virtual u32 getMaximalPrimitiveCount() const;
virtual ITexture* createRenderTargetTexture(const core::dimension2d<s32>& size, const c8* name);

View File

@ -99,7 +99,7 @@ private:
IAnimatedMeshSceneNode* Node;
IAnimatedMesh* AnimatedMesh;
IMesh* BaseMesh;
const IMesh* BaseMesh;
s32 TotalVertices;
u32 MBCount;
s32 MBNumber;

View File

@ -98,7 +98,7 @@ public:
private:
IMesh* Mesh;
const IMesh* Mesh;
s32 TotalVertices;
u32 MBCount;
s32 MBNumber;

View File

@ -56,7 +56,7 @@ bool CReadFile::seek(long finalPos, bool relativeMovement)
//! returns size of file
long CReadFile::getSize()
long CReadFile::getSize() const
{
return FileSize;
}
@ -64,7 +64,7 @@ long CReadFile::getSize()
//! returns where in the file we are.
long CReadFile::getPos()
long CReadFile::getPos() const
{
return ftell(File);
}

View File

@ -36,7 +36,7 @@ namespace io
virtual bool seek(long finalPos, bool relativeMovement = false);
//! returns size of file
virtual long getSize();
virtual long getSize() const;
//! returns if file is open
virtual bool isOpen() const
@ -45,7 +45,7 @@ namespace io
}
//! returns where in the file we are.
virtual long getPos();
virtual long getPos() const;
//! returns name of file
virtual const c8* getFileName() const;

View File

@ -82,6 +82,18 @@
#include "CB3DMeshFileLoader.h"
#endif
#ifdef _IRR_COMPILE_WITH_COLLADA_WRITER_
#include "CColladaMeshWriter.h"
#endif
#ifdef _IRR_COMPILE_WITH_IRR_WRITER_
#include "CIrrMeshWriter.h"
#endif
#ifdef _IRR_COMPILE_WITH_STL_WRITER_
#include "CSTLMeshWriter.h"
#endif
#include "CCubeSceneNode.h"
#include "CSphereSceneNode.h"
#include "CAnimatedMeshSceneNode.h"
@ -121,9 +133,6 @@
#include "CQuake3ShaderSceneNode.h"
#include "CColladaMeshWriter.h"
#include "CIrrMeshWriter.h"
//! Enable debug features
#define SCENEMANAGER_DEBUG
@ -944,9 +953,9 @@ const core::aabbox3d<f32>& CSceneManager::getBoundingBox() const
//! returns if node is culled
bool CSceneManager::isCulled(ISceneNode* node)
bool CSceneManager::isCulled(const ISceneNode* node)
{
ICameraSceneNode* cam = getActiveCamera();
const ICameraSceneNode* cam = getActiveCamera();
if (!cam)
return false;
@ -1604,7 +1613,7 @@ io::IAttributes* CSceneManager::getParameters()
//! Returns current render pass.
E_SCENE_NODE_RENDER_PASS CSceneManager::getSceneNodeRenderPass()
E_SCENE_NODE_RENDER_PASS CSceneManager::getSceneNodeRenderPass() const
{
return CurrentRendertime;
}
@ -1649,16 +1658,16 @@ void CSceneManager::registerSceneNodeFactory(ISceneNodeFactory* factoryToAdd)
//! Returns amount of registered scene node factories.
s32 CSceneManager::getRegisteredSceneNodeFactoryCount()
u32 CSceneManager::getRegisteredSceneNodeFactoryCount() const
{
return SceneNodeFactoryList.size();
}
//! Returns a scene node factory by index
ISceneNodeFactory* CSceneManager::getSceneNodeFactory(s32 index)
ISceneNodeFactory* CSceneManager::getSceneNodeFactory(u32 index)
{
if (index>=0 && index<(int)SceneNodeFactoryList.size())
if (index<SceneNodeFactoryList.size())
return SceneNodeFactoryList[index];
return 0;
@ -1683,16 +1692,16 @@ void CSceneManager::registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory*
//! Returns amount of registered scene node animator factories.
s32 CSceneManager::getRegisteredSceneNodeAnimatorFactoryCount()
u32 CSceneManager::getRegisteredSceneNodeAnimatorFactoryCount() const
{
return SceneNodeAnimatorFactoryList.size();
}
//! Returns a scene node animator factory by index
ISceneNodeAnimatorFactory* CSceneManager::getSceneNodeAnimatorFactory(s32 index)
ISceneNodeAnimatorFactory* CSceneManager::getSceneNodeAnimatorFactory(u32 index)
{
if (index>=0 && index<(int)SceneNodeAnimatorFactoryList.size())
if (index<SceneNodeAnimatorFactoryList.size())
return SceneNodeAnimatorFactoryList[index];
return 0;
@ -2130,11 +2139,11 @@ ISceneNode* CSceneManager::addSceneNode(const char* sceneNodeTypeName, ISceneNod
//! Returns a typename from a scene node animator type or null if not found
const c8* CSceneManager::getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type)
const c8* CSceneManager::getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const
{
const char* name = 0;
for (int i=0; !name && i<(int)SceneNodeAnimatorFactoryList.size(); ++i)
for (u32 i=0; !name && i<SceneNodeAnimatorFactoryList.size(); ++i)
name = SceneNodeAnimatorFactoryList[i]->getCreateableSceneNodeAnimatorTypeName(type);
return name;
@ -2176,7 +2185,7 @@ void CSceneManager::setAmbientLight(const video::SColorf &ambientColor)
//! Returns ambient color of the scene
video::SColorf CSceneManager::getAmbientLight()
const video::SColorf& CSceneManager::getAmbientLight() const
{
return AmbientLight;
}
@ -2191,6 +2200,8 @@ IMeshWriter* CSceneManager::createMeshWriter(EMESH_WRITER_TYPE type)
return new CIrrMeshWriter(Driver, FileSystem);
case EMWT_COLLADA:
return new CColladaMeshWriter(Driver, FileSystem);
case EMWT_STL:
return new CSTLMeshWriter(this);
}
return 0;

View File

@ -365,7 +365,7 @@ namespace scene
virtual io::IAttributes* getParameters();
//! Returns current render pass.
virtual E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass();
virtual E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass() const;
//! Creates a new scene manager.
virtual ISceneManager* createNewSceneManager(bool cloneContent);
@ -382,10 +382,10 @@ namespace scene
virtual void registerSceneNodeFactory(ISceneNodeFactory* factoryToAdd);
//! Returns amount of registered scene node factories.
virtual s32 getRegisteredSceneNodeFactoryCount();
virtual u32 getRegisteredSceneNodeFactoryCount() const;
//! Returns a scene node factory by index
virtual ISceneNodeFactory* getSceneNodeFactory(s32 index);
virtual ISceneNodeFactory* getSceneNodeFactory(u32 index);
//! Returns a typename from a scene node type or null if not found
virtual const c8* getSceneNodeTypeName(ESCENE_NODE_TYPE type);
@ -400,10 +400,10 @@ namespace scene
virtual void registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd);
//! Returns amount of registered scene node animator factories.
virtual s32 getRegisteredSceneNodeAnimatorFactoryCount();
virtual u32 getRegisteredSceneNodeAnimatorFactoryCount() const;
//! Returns a scene node animator factory by index
virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(s32 index);
virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(u32 index);
//! Saves the current scene into a file.
//! \param filename: Name of the file .
@ -432,15 +432,15 @@ namespace scene
virtual void setAmbientLight(const video::SColorf &ambientColor);
//! Returns ambient color of the scene
virtual video::SColorf getAmbientLight();
virtual const video::SColorf& getAmbientLight() const;
private:
//! Returns a typename from a scene node animator type or null if not found
virtual const c8* getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type);
virtual const c8* getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const;
//! returns if node is culled
bool isCulled(ISceneNode* node);
bool isCulled(const ISceneNode* node);
//! clears the deletion list
void clearDeletionList();

View File

@ -47,7 +47,7 @@ CSceneNodeAnimatorCollisionResponse::~CSceneNodeAnimatorCollisionResponse()
//! Returns if the attached scene node is falling, which means that
//! there is no blocking wall from the scene node in the direction of
//! the gravity.
bool CSceneNodeAnimatorCollisionResponse::isFalling()
bool CSceneNodeAnimatorCollisionResponse::isFalling() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return Falling;

View File

@ -38,7 +38,7 @@ namespace scene
//! Returns if the attached scene node is falling, which means that
//! there is no blocking wall from the scene node in the direction of
//! the gravity.
virtual bool isFalling();
virtual bool isFalling() const;
//! Sets the radius of the ellipsoid with which collision detection and
//! response is done.

View File

@ -498,16 +498,16 @@ E_ANIMATED_MESH_TYPE CSkinnedMesh::getMeshType() const
//! Gets joint count.
s32 CSkinnedMesh::getJointCount() const
u32 CSkinnedMesh::getJointCount() const
{
return AllJoints.size();
}
//! Gets the name of a joint.
const c8* CSkinnedMesh::getJointName(s32 number) const
const c8* CSkinnedMesh::getJointName(u32 number) const
{
if ((u32)number >= AllJoints.size())
if (number >= AllJoints.size())
return 0;
return AllJoints[number]->Name.c_str();
}
@ -578,7 +578,7 @@ void CSkinnedMesh::setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
//! uses animation from another mesh
bool CSkinnedMesh::useAnimationFrom(ISkinnedMesh *mesh)
bool CSkinnedMesh::useAnimationFrom(const ISkinnedMesh *mesh)
{
bool unmatched=false;
@ -637,6 +637,12 @@ core::array<CSkinnedMesh::SJoint*> &CSkinnedMesh::getAllJoints()
}
const core::array<CSkinnedMesh::SJoint*> &CSkinnedMesh::getAllJoints() const
{
return AllJoints;
}
void CSkinnedMesh::CalculateGlobalMatrixes(SJoint *Joint,SJoint *ParentJoint)
{
if (!Joint && ParentJoint) // bit of protection from endless loops
@ -1185,7 +1191,7 @@ void CSkinnedMesh::recoverJointsFromMesh(core::array<IBoneSceneNode*> &JointChil
}
}
void CSkinnedMesh::tranferJointsToMesh(core::array<IBoneSceneNode*> &JointChildSceneNodes)
void CSkinnedMesh::transferJointsToMesh(const core::array<IBoneSceneNode*> &JointChildSceneNodes)
{
for (u32 i=0;i<AllJoints.size();++i)
{

View File

@ -72,16 +72,16 @@ namespace scene
virtual E_ANIMATED_MESH_TYPE getMeshType() const;
//! Gets joint count.
virtual s32 getJointCount() const;
virtual u32 getJointCount() const;
//! Gets the name of a joint.
virtual const c8* getJointName(s32 number) const;
virtual const c8* getJointName(u32 number) const;
//! Gets a joint number from its name
virtual s32 getJointNumber(const c8* name) const;
//! uses animation from another mesh
virtual bool useAnimationFrom(ISkinnedMesh *mesh);
virtual bool useAnimationFrom(const ISkinnedMesh *mesh);
//! Update Normals when Animating
//! False= Don't (default)
@ -95,7 +95,7 @@ namespace scene
virtual void recoverJointsFromMesh(core::array<IBoneSceneNode*> &JointChildSceneNodes);
//! Tranfers the joint data to the mesh
virtual void tranferJointsToMesh(core::array<IBoneSceneNode*> &JointChildSceneNodes);
virtual void transferJointsToMesh(const core::array<IBoneSceneNode*> &JointChildSceneNodes);
//! Creates an array of joints from this mesh
virtual void createJoints(core::array<IBoneSceneNode*> &JointChildSceneNodes, IAnimatedMeshSceneNode* AnimatedMeshSceneNode, ISceneManager* SceneManager);
@ -117,6 +117,9 @@ namespace scene
//! alternative method for adding joints
virtual core::array<SJoint*> &getAllJoints();
//! alternative method for adding joints
virtual const core::array<SJoint*> &getAllJoints() const;
//! loaders should call this after populating the mesh
virtual void finalize();

View File

@ -168,7 +168,7 @@ bool CSoftwareDriver::endScene( s32 windowId, core::rect<s32>* sourceRect )
//! queries the features of the driver, returns true if feature is available
bool CSoftwareDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature)
bool CSoftwareDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
{
switch (feature)
{
@ -840,7 +840,7 @@ void CSoftwareDriver::draw2DRectangle(const core::rect<s32>& pos,
//! \return Returns the name of the video driver. Example: In case of the Direct3D8
//! driver, it would return "Direct3D8.1".
const wchar_t* CSoftwareDriver::getName()
const wchar_t* CSoftwareDriver::getName() const
{
return L"Irrlicht Software Device 1.0";
}
@ -887,7 +887,7 @@ IImage* CSoftwareDriver::createScreenShot()
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
u32 CSoftwareDriver::getMaximalPrimitiveCount()
u32 CSoftwareDriver::getMaximalPrimitiveCount() const
{
return 0x00800000;
}

View File

@ -28,7 +28,7 @@ namespace video
virtual bool endScene( s32 windowId = 0, core::rect<s32>* sourceRect=0 );
//! queries the features of the driver, returns true if feature is available
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature);
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const;
//! sets transformation
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat);
@ -80,7 +80,7 @@ namespace video
//! \return Returns the name of the video driver. Example: In case of the Direct3D8
//! driver, it would return "Direct3D8.1".
virtual const wchar_t* getName();
virtual const wchar_t* getName() const;
//! Returns type of video driver
virtual E_DRIVER_TYPE getDriverType() const;
@ -100,7 +100,7 @@ namespace video
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
virtual u32 getMaximalPrimitiveCount();
virtual u32 getMaximalPrimitiveCount() const;
protected:

View File

@ -280,7 +280,7 @@ void CSoftwareDriver2::setCurrentShader()
//! queries the features of the driver, returns true if feature is available
bool CSoftwareDriver2::queryFeature(E_VIDEO_DRIVER_FEATURE feature)
bool CSoftwareDriver2::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
{
switch (feature)
{
@ -1399,7 +1399,7 @@ void CSoftwareDriver2::deleteAllDynamicLights()
}
//! returns the maximal amount of dynamic lights the device can handle
u32 CSoftwareDriver2::getMaximalDynamicLightAmount()
u32 CSoftwareDriver2::getMaximalDynamicLightAmount() const
{
return 8;
}
@ -1826,7 +1826,7 @@ void CSoftwareDriver2::draw3DLine(const core::vector3df& start,
//! \return Returns the name of the video driver. Example: In case of the DirectX8
//! driver, it would return "Direct3D8.1".
const wchar_t* CSoftwareDriver2::getName()
const wchar_t* CSoftwareDriver2::getName() const
{
#ifdef BURNINGVIDEO_RENDERER_BEAUTIFUL
return L"burnings video 0.38b";
@ -1846,7 +1846,7 @@ E_DRIVER_TYPE CSoftwareDriver2::getDriverType() const
}
//! Returns the transformation set by setTransform
const core::matrix4& CSoftwareDriver2::getTransform(E_TRANSFORMATION_STATE state)
const core::matrix4& CSoftwareDriver2::getTransform(E_TRANSFORMATION_STATE state) const
{
return Transformation[state].m;
}
@ -1888,7 +1888,7 @@ ITexture* CSoftwareDriver2::createDeviceDependentTexture(IImage* surface, const
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
u32 CSoftwareDriver2::getMaximalPrimitiveCount()
u32 CSoftwareDriver2::getMaximalPrimitiveCount() const
{
return 0x00800000;
}

View File

@ -30,7 +30,7 @@ namespace video
virtual bool endScene( s32 windowId = 0, core::rect<s32>* sourceRect=0 );
//! queries the features of the driver, returns true if feature is available
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature);
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const;
//! sets transformation
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat);
@ -61,7 +61,7 @@ namespace video
virtual void addDynamicLight(const SLight& light);
//! returns the maximal amount of dynamic lights the device can handle
virtual u32 getMaximalDynamicLightAmount();
virtual u32 getMaximalDynamicLightAmount() const;
//! Sets the dynamic ambient light color. The default color is
//! (0,0,0,0) which means it is dark.
@ -96,13 +96,13 @@ namespace video
//! \return Returns the name of the video driver. Example: In case of the DirectX8
//! driver, it would return "Direct3D8.1".
virtual const wchar_t* getName();
virtual const wchar_t* getName() const;
//! Returns type of video driver
virtual E_DRIVER_TYPE getDriverType() const;
//! Returns the transformation set by setTransform
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state);
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const;
//! Creates a render target texture.
virtual ITexture* createRenderTargetTexture(const core::dimension2d<s32>& size, const c8* name);
@ -116,7 +116,7 @@ namespace video
//! Returns the maximum amount of primitives (mostly vertices) which
//! the device is able to render with one drawIndexedTriangleList
//! call.
virtual u32 getMaximalPrimitiveCount();
virtual u32 getMaximalPrimitiveCount() const;
protected:

View File

@ -708,7 +708,7 @@ namespace scene
//! Gets the meshbuffer data based on a specified Level of Detail.
//! \param mb: A reference to an SMeshBuffer object
//! \param LOD: The Level Of Detail you want the indices from.
void CTerrainSceneNode::getMeshBufferForLOD(SMeshBufferLightMap& mb, s32 LOD )
void CTerrainSceneNode::getMeshBufferForLOD(SMeshBufferLightMap& mb, s32 LOD ) const
{
if (!Mesh.getMeshBufferCount())
return;
@ -778,7 +778,7 @@ namespace scene
//! the CurrentLOD. If the CurrentLOD is set to -1, meaning it's not shown,
//! then it will retrieve the triangles at the highest LOD ( 0 ).
//! \return: Number if indices put into the buffer.
s32 CTerrainSceneNode::getIndicesForPatch(core::array<u32>& indices, s32 patchX, s32 patchZ, s32 LOD )
s32 CTerrainSceneNode::getIndicesForPatch(core::array<u32>& indices, s32 patchX, s32 patchZ, s32 LOD)
{
if ( patchX < 0 || patchX > TerrainData.PatchCount - 1 || patchZ < 0 || patchZ > TerrainData.PatchCount - 1 )
return -1;
@ -854,7 +854,7 @@ namespace scene
//! Populates an array with the CurrentLOD of each patch.
//! \param LODs: A reference to a core::array<s32> to hold the values
//! \return Returns the number of elements in the array
s32 CTerrainSceneNode::getCurrentLODOfPatches(core::array<s32>& LODs)
s32 CTerrainSceneNode::getCurrentLODOfPatches(core::array<s32>& LODs) const
{
s32 numLODs;
LODs.clear ( );
@ -931,7 +931,7 @@ namespace scene
//! used to get the indices when generating index data for patches at varying levels of detail.
u32 CTerrainSceneNode::getIndex(const s32& PatchX, const s32& PatchZ,
const s32& PatchIndex, u32 vX, u32 vZ)
const s32& PatchIndex, u32 vX, u32 vZ) const
{
// top border
if (vZ == 0)
@ -1226,7 +1226,7 @@ namespace scene
//! Gets the height
f32 CTerrainSceneNode::getHeight( f32 x, f32 z )
f32 CTerrainSceneNode::getHeight( f32 x, f32 z ) const
{
if (!Mesh.getMeshBufferCount())
return 0;

View File

@ -49,7 +49,7 @@ namespace scene
const core::vector3df& rotation = core::vector3df(0.0f, 0.0f, 0.0f),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
~CTerrainSceneNode();
virtual ~CTerrainSceneNode();
//! Initializes the terrain data. Loads the vertices from the heightMapFile.
virtual bool loadHeightMap(io::IReadFile* file,
@ -135,7 +135,7 @@ namespace scene
virtual const core::aabbox3d<f32>& getBoundingBox(s32 patchX, s32 patchZ) const;
//! Return the number of indices currently used to draw the scene node.
virtual u32 getIndexCount() { return IndicesToRender; }
virtual u32 getIndexCount() const { return IndicesToRender; }
//! Returns the mesh
virtual IMesh* getMesh() { return &Mesh; }
@ -143,7 +143,7 @@ namespace scene
//! Gets the meshbuffer data based on a specified Level of Detail.
//! \param mb: A reference to an SMeshBufferLightMap object
//! \param LOD: The Level Of Detail you want the indices from.
virtual void getMeshBufferForLOD(SMeshBufferLightMap& mb, s32 LOD );
virtual void getMeshBufferForLOD(SMeshBufferLightMap& mb, s32 LOD ) const;
//! Gets the indices for a specified patch at a specified Level of Detail.
//! \param indices: A reference to an array of u32 indices.
@ -159,7 +159,7 @@ namespace scene
//! Populates an array with the CurrentLOD of each patch.
//! \param LODs: A reference to a core::array<s32> to hold the values
//! \return Returns the number of elements in the array
virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs);
virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs) const;
//! Manually sets the LOD of a patch
//! \param patchX: Patch x coordinate.
@ -168,13 +168,13 @@ namespace scene
virtual void setLODOfPatch( s32 patchX, s32 patchZ, s32 LOD );
//! Returns center of terrain.
virtual core::vector3df getTerrainCenter()
virtual const core::vector3df& getTerrainCenter() const
{
return TerrainData.Center;
}
//! Returns center of terrain.
virtual f32 getHeight( f32 x, f32 y );
virtual f32 getHeight( f32 x, f32 y ) const;
//! Sets the movement camera threshold which is used to determine when to recalculate
//! indices for the scene node. The default value is 10.0f.
@ -284,7 +284,7 @@ namespace scene
virtual void preRenderIndicesCalculations();
//! get indices when generating index data for patches at varying levels of detail.
u32 getIndex(const s32& PatchX, const s32& PatchZ, const s32& PatchIndex, u32 vX, u32 vZ);
u32 getIndex(const s32& PatchX, const s32& PatchZ, const s32& PatchIndex, u32 vX, u32 vZ) const;
//! calculate smooth normals
void calculateNormals(SMeshBufferLightMap* pMeshBuffer );
@ -328,12 +328,11 @@ namespace scene
f32 TCoordScale2;
core::stringc HeightmapFile;
io::IFileSystem* FileSystem;
};
} // end namespace scene
} // end namespace irr
#endif // __C_TERRAIN_SCENE_NODE_H__

View File

@ -73,7 +73,7 @@ void CTerrainTriangleSelector::setTriangleData(ITerrainSceneNode* node, s32 LOD)
//! Gets all triangles.
void CTerrainTriangleSelector::getTriangles ( core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::matrix4* transform )
s32& outTriangleCount, const core::matrix4* transform ) const
{
s32 count = TrianglePatches.TotalTriangles;
@ -108,7 +108,7 @@ void CTerrainTriangleSelector::getTriangles ( core::triangle3df* triangles, s32
//! Gets all triangles which lie within a specific bounding box.
void CTerrainTriangleSelector::getTriangles ( core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::aabbox3d<f32>& box,
const core::matrix4* transform)
const core::matrix4* transform) const
{
s32 count = TrianglePatches.TotalTriangles;
@ -144,7 +144,7 @@ void CTerrainTriangleSelector::getTriangles ( core::triangle3df* triangles, s32
//! Gets all triangles which have or may have contact with a 3d line.
void CTerrainTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform)
const core::matrix4* transform) const
{
s32 count = TrianglePatches.TotalTriangles;

View File

@ -39,16 +39,16 @@ public:
//! Gets all triangles.
void getTriangles ( core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
const core::matrix4* transform = 0 );
const core::matrix4* transform = 0 ) const;
//! Gets all triangles which lie within a specific bounding box.
void getTriangles ( core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
const core::aabbox3d<f32>& box, const core::matrix4* transform = 0 );
const core::aabbox3d<f32>& box, const core::matrix4* transform = 0 ) const;
//! Gets all triangles which have or may have contact with a 3d line.
virtual void getTriangles ( core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform = 0 );
const core::matrix4* transform = 0 ) const;
//! Returns amount of all available triangles in this selector
virtual s32 getTriangleCount ( ) const;

View File

@ -24,7 +24,7 @@ namespace irr
/** This value does not start with 0 when the application starts.
For example in one implementation the value returned could be the
amount of milliseconds which have elapsed since the system was started. */
virtual u32 getRealTime()
virtual u32 getRealTime() const
{
return os::Timer::getRealTime();
}
@ -33,7 +33,7 @@ namespace irr
/** This value starts with 0 and can be manipulated using setTime(), stopTimer(),
startTimer(), etc. This value depends on the set speed of the timer if the timer
is stopped, etc. If you need the system time, use getRealTime() */
virtual u32 getTime()
virtual u32 getTime() const
{
return os::Timer::getTime();
}
@ -73,13 +73,13 @@ namespace irr
//! Returns current speed of the timer
/** The speed is the factor with which the time is running faster or slower then the
real system time. */
virtual f32 getSpeed()
virtual f32 getSpeed() const
{
return os::Timer::getSpeed();
}
//! Returns if game timer is currently stopped
virtual bool isStopped()
virtual bool isStopped() const
{
bool ret = os::Timer::isStopped();
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
@ -99,3 +99,4 @@ namespace irr
} // end namespace
#endif

View File

@ -93,18 +93,10 @@ CTriangleSelector::CTriangleSelector(core::aabbox3d<f32> box, ISceneNode* node)
}
//! destructor
CTriangleSelector::~CTriangleSelector()
{
}
//! Gets all triangles.
void CTriangleSelector::getTriangles(core::triangle3df* triangles,
s32 arraySize, s32& outTriangleCount,
const core::matrix4* transform)
s32 arraySize, s32& outTriangleCount,
const core::matrix4* transform) const
{
s32 cnt = Triangles.size();
if (cnt > arraySize)
@ -113,7 +105,7 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles,
core::matrix4 mat;
if (transform)
mat = (*transform);
mat = *transform;
if (SceneNode)
mat *= SceneNode->getAbsoluteTransformation();
@ -133,9 +125,9 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles,
//! Gets all triangles which lie within a specific bounding box.
void CTriangleSelector::getTriangles(core::triangle3df* triangles,
s32 arraySize, s32& outTriangleCount,
const core::aabbox3d<f32>& box,
const core::matrix4* transform)
s32 arraySize, s32& outTriangleCount,
const core::aabbox3d<f32>& box,
const core::matrix4* transform) const
{
// return all triangles
getTriangles(triangles, arraySize, outTriangleCount, transform);
@ -143,9 +135,10 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles,
//! Gets all triangles which have or may have contact with a 3d line.
void CTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform)
void CTriangleSelector::getTriangles(core::triangle3df* triangles,
s32 arraySize, s32& outTriangleCount,
const core::line3d<f32>& line,
const core::matrix4* transform) const
{
// return all triangles
getTriangles(triangles, arraySize, outTriangleCount, transform);

View File

@ -30,20 +30,18 @@ public:
//! Constructs a selector based on a bounding box
CTriangleSelector(core::aabbox3d<f32> box, ISceneNode* node);
~CTriangleSelector();
//! Gets all triangles.
void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
const core::matrix4* transform=0);
const core::matrix4* transform=0) const;
//! Gets all triangles which lie within a specific bounding box.
void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
const core::aabbox3d<f32>& box, const core::matrix4* transform=0);
const core::aabbox3d<f32>& box, const core::matrix4* transform=0) const;
//! Gets all triangles which have or may have contact with a 3d line.
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform=0);
const core::matrix4* transform=0) const;
//! Returns amount of all available triangles in this selector
virtual s32 getTriangleCount() const;

View File

@ -65,7 +65,7 @@ bool CWriteFile::seek(long finalPos, bool relativeMovement)
//! returns where in the file we are.
long CWriteFile::getPos()
long CWriteFile::getPos() const
{
return ftell(File);
}

View File

@ -34,7 +34,7 @@ namespace io
virtual bool seek(long finalPos, bool relativeMovement = false);
//! Returns the current position in the file.
virtual long getPos();
virtual long getPos() const;
//! Returns name of file.
virtual const c8* getFileName() const;

View File

@ -35,7 +35,7 @@ namespace io
}
//! Returns size of file in bytes
virtual long getSize()
virtual long getSize() const
{
return ReadFile->getSize();
}

View File

@ -300,7 +300,7 @@ bool CXMeshFileLoader::load(io::IReadFile* file)
u32 id = Weight.vertex_id;
if (id>verticesLink.size())
if (id>=verticesLink.size())
{
os::Printer::log("X loader: Weight id out of range", ELL_WARNING);
id=0;
@ -308,7 +308,6 @@ bool CXMeshFileLoader::load(io::IReadFile* file)
Weight.vertex_id=verticesLink[id];
Weight.buffer_id=verticesLinkBuffer[id];
}
}
}

Some files were not shown because too many files have changed in this diff Show More