mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
Delete lots of unused features (#48)
This commit is contained in:
@ -1,58 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __E_SCENE_NODE_ANIMATOR_TYPES_H_INCLUDED__
|
||||
#define __E_SCENE_NODE_ANIMATOR_TYPES_H_INCLUDED__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! An enumeration for all types of built-in scene node animators
|
||||
enum ESCENE_NODE_ANIMATOR_TYPE
|
||||
{
|
||||
//! Fly circle scene node animator
|
||||
ESNAT_FLY_CIRCLE = 0,
|
||||
|
||||
//! Fly straight scene node animator
|
||||
ESNAT_FLY_STRAIGHT,
|
||||
|
||||
//! Follow spline scene node animator
|
||||
ESNAT_FOLLOW_SPLINE,
|
||||
|
||||
//! Rotation scene node animator
|
||||
ESNAT_ROTATION,
|
||||
|
||||
//! Texture scene node animator
|
||||
ESNAT_TEXTURE,
|
||||
|
||||
//! Deletion scene node animator
|
||||
ESNAT_DELETION,
|
||||
|
||||
//! Collision response scene node animator
|
||||
ESNAT_COLLISION_RESPONSE,
|
||||
|
||||
//! FPS camera animator
|
||||
ESNAT_CAMERA_FPS,
|
||||
|
||||
//! Maya camera animator
|
||||
ESNAT_CAMERA_MAYA,
|
||||
|
||||
//! Amount of built-in scene node animators
|
||||
ESNAT_COUNT,
|
||||
|
||||
//! Unknown scene node animator
|
||||
ESNAT_UNKNOWN,
|
||||
|
||||
//! This enum is never used, it only forces the compiler to compile this enumeration to 32 bit.
|
||||
ESNAT_FORCE_32_BIT = 0x7fffffff
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -21,42 +21,9 @@ namespace scene
|
||||
//! of type CSceneManager (note that ISceneManager is not(!) an ISceneNode)
|
||||
ESNT_SCENE_MANAGER = MAKE_IRR_ID('s','m','n','g'),
|
||||
|
||||
//! simple cube scene node
|
||||
ESNT_CUBE = MAKE_IRR_ID('c','u','b','e'),
|
||||
|
||||
//! Sphere scene node
|
||||
ESNT_SPHERE = MAKE_IRR_ID('s','p','h','r'),
|
||||
|
||||
//! Text Scene Node
|
||||
ESNT_TEXT = MAKE_IRR_ID('t','e','x','t'),
|
||||
|
||||
//! Billboard text scene node
|
||||
ESNT_BILLBOARD_TEXT = MAKE_IRR_ID('b','t','x','t'),
|
||||
|
||||
//! Water Surface Scene Node
|
||||
ESNT_WATER_SURFACE = MAKE_IRR_ID('w','a','t','r'),
|
||||
|
||||
//! Terrain Scene Node
|
||||
ESNT_TERRAIN = MAKE_IRR_ID('t','e','r','r'),
|
||||
|
||||
//! Sky Box Scene Node
|
||||
ESNT_SKY_BOX = MAKE_IRR_ID('s','k','y','_'),
|
||||
|
||||
//! Sky Dome Scene Node
|
||||
ESNT_SKY_DOME = MAKE_IRR_ID('s','k','y','d'),
|
||||
|
||||
//! Shadow Volume Scene Node
|
||||
ESNT_SHADOW_VOLUME = MAKE_IRR_ID('s','h','d','w'),
|
||||
|
||||
//! Octree Scene Node
|
||||
ESNT_OCTREE = MAKE_IRR_ID('o','c','t','r'),
|
||||
|
||||
//! Mesh Scene Node
|
||||
ESNT_MESH = MAKE_IRR_ID('m','e','s','h'),
|
||||
|
||||
//! Light Scene Node
|
||||
ESNT_LIGHT = MAKE_IRR_ID('l','g','h','t'),
|
||||
|
||||
//! Empty Scene Node
|
||||
ESNT_EMPTY = MAKE_IRR_ID('e','m','t','y'),
|
||||
|
||||
@ -72,26 +39,6 @@ namespace scene
|
||||
//! Animated Mesh Scene Node
|
||||
ESNT_ANIMATED_MESH = MAKE_IRR_ID('a','m','s','h'),
|
||||
|
||||
//! Particle System Scene Node
|
||||
ESNT_PARTICLE_SYSTEM = MAKE_IRR_ID('p','t','c','l'),
|
||||
|
||||
//! Quake3 Shader Scene Node
|
||||
ESNT_Q3SHADER_SCENE_NODE = MAKE_IRR_ID('q','3','s','h'),
|
||||
|
||||
//! Quake3 Model Scene Node ( has tag to link to )
|
||||
ESNT_MD3_SCENE_NODE = MAKE_IRR_ID('m','d','3','_'),
|
||||
|
||||
//! Volume Light Scene Node
|
||||
ESNT_VOLUME_LIGHT = MAKE_IRR_ID('v','o','l','l'),
|
||||
|
||||
//! Maya Camera Scene Node
|
||||
/** Legacy, for loading version <= 1.4.x .irr files */
|
||||
ESNT_CAMERA_MAYA = MAKE_IRR_ID('c','a','m','M'),
|
||||
|
||||
//! First Person Shooter Camera
|
||||
/** Legacy, for loading version <= 1.4.x .irr files */
|
||||
ESNT_CAMERA_FPS = MAKE_IRR_ID('c','a','m','F'),
|
||||
|
||||
//! Unknown scene node
|
||||
ESNT_UNKNOWN = MAKE_IRR_ID('u','n','k','n'),
|
||||
|
||||
|
@ -1,79 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_ANIMATED_MESH_MD2_H_INCLUDED__
|
||||
#define __I_ANIMATED_MESH_MD2_H_INCLUDED__
|
||||
|
||||
#include "IAnimatedMesh.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Types of standard md2 animations
|
||||
enum EMD2_ANIMATION_TYPE
|
||||
{
|
||||
EMAT_STAND = 0,
|
||||
EMAT_RUN,
|
||||
EMAT_ATTACK,
|
||||
EMAT_PAIN_A,
|
||||
EMAT_PAIN_B,
|
||||
EMAT_PAIN_C,
|
||||
EMAT_JUMP,
|
||||
EMAT_FLIP,
|
||||
EMAT_SALUTE,
|
||||
EMAT_FALLBACK,
|
||||
EMAT_WAVE,
|
||||
EMAT_POINT,
|
||||
EMAT_CROUCH_STAND,
|
||||
EMAT_CROUCH_WALK,
|
||||
EMAT_CROUCH_ATTACK,
|
||||
EMAT_CROUCH_PAIN,
|
||||
EMAT_CROUCH_DEATH,
|
||||
EMAT_DEATH_FALLBACK,
|
||||
EMAT_DEATH_FALLFORWARD,
|
||||
EMAT_DEATH_FALLBACKSLOW,
|
||||
EMAT_BOOM,
|
||||
|
||||
//! Not an animation, but amount of animation types.
|
||||
EMAT_COUNT
|
||||
};
|
||||
|
||||
//! Interface for using some special functions of MD2 meshes
|
||||
class IAnimatedMeshMD2 : public IAnimatedMesh
|
||||
{
|
||||
public:
|
||||
|
||||
//! Get frame loop data for a default MD2 animation type.
|
||||
/** \param l The EMD2_ANIMATION_TYPE to get the frames for.
|
||||
\param outBegin The returned beginning frame for animation type specified.
|
||||
\param outEnd The returned ending frame for the animation type specified.
|
||||
\param outFPS The number of frames per second, this animation should be played at.
|
||||
\return beginframe, endframe and frames per second for a default MD2 animation type. */
|
||||
virtual void getFrameLoop(EMD2_ANIMATION_TYPE l, s32& outBegin,
|
||||
s32& outEnd, s32& outFPS) const = 0;
|
||||
|
||||
//! Get frame loop data for a special MD2 animation type, identified by name.
|
||||
/** \param name Name of the animation.
|
||||
\param outBegin The returned beginning frame for animation type specified.
|
||||
\param outEnd The returned ending frame for the animation type specified.
|
||||
\param outFPS The number of frames per second, this animation should be played at.
|
||||
\return beginframe, endframe and frames per second for a special MD2 animation type. */
|
||||
virtual bool getFrameLoop(const c8* name,
|
||||
s32& outBegin, s32& outEnd, s32& outFPS) const = 0;
|
||||
|
||||
//! Get amount of md2 animations in this file.
|
||||
virtual s32 getAnimationCount() const = 0;
|
||||
|
||||
//! Get name of md2 animation.
|
||||
/** \param nr: Zero based index of animation. */
|
||||
virtual const c8* getAnimationName(s32 nr) const = 0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -1,278 +0,0 @@
|
||||
// Copyright (C) 2007-2012 Nikolaus Gebhardt / Thomas Alten
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_ANIMATED_MESH_MD3_H_INCLUDED__
|
||||
#define __I_ANIMATED_MESH_MD3_H_INCLUDED__
|
||||
|
||||
#include "IAnimatedMesh.h"
|
||||
#include "IQ3Shader.h"
|
||||
#include "quaternion.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
enum eMD3Models
|
||||
{
|
||||
EMD3_HEAD = 0,
|
||||
EMD3_UPPER,
|
||||
EMD3_LOWER,
|
||||
EMD3_WEAPON,
|
||||
EMD3_NUMMODELS
|
||||
};
|
||||
|
||||
//! Animation list
|
||||
enum EMD3_ANIMATION_TYPE
|
||||
{
|
||||
// Animations for both lower and upper parts of the player
|
||||
EMD3_BOTH_DEATH_1 = 0,
|
||||
EMD3_BOTH_DEAD_1,
|
||||
EMD3_BOTH_DEATH_2,
|
||||
EMD3_BOTH_DEAD_2,
|
||||
EMD3_BOTH_DEATH_3,
|
||||
EMD3_BOTH_DEAD_3,
|
||||
|
||||
// Animations for the upper part
|
||||
EMD3_TORSO_GESTURE,
|
||||
EMD3_TORSO_ATTACK_1,
|
||||
EMD3_TORSO_ATTACK_2,
|
||||
EMD3_TORSO_DROP,
|
||||
EMD3_TORSO_RAISE,
|
||||
EMD3_TORSO_STAND_1,
|
||||
EMD3_TORSO_STAND_2,
|
||||
|
||||
// Animations for the lower part
|
||||
EMD3_LEGS_WALK_CROUCH,
|
||||
EMD3_LEGS_WALK,
|
||||
EMD3_LEGS_RUN,
|
||||
EMD3_LEGS_BACK,
|
||||
EMD3_LEGS_SWIM,
|
||||
EMD3_LEGS_JUMP_1,
|
||||
EMD3_LEGS_LAND_1,
|
||||
EMD3_LEGS_JUMP_2,
|
||||
EMD3_LEGS_LAND_2,
|
||||
EMD3_LEGS_IDLE,
|
||||
EMD3_LEGS_IDLE_CROUCH,
|
||||
EMD3_LEGS_TURN,
|
||||
|
||||
//! Not an animation, but amount of animation types.
|
||||
EMD3_ANIMATION_COUNT
|
||||
};
|
||||
|
||||
struct SMD3AnimationInfo
|
||||
{
|
||||
//! First frame
|
||||
s32 first;
|
||||
//! Last frame
|
||||
s32 num;
|
||||
//! Looping frames
|
||||
s32 looping;
|
||||
//! Frames per second
|
||||
s32 fps;
|
||||
};
|
||||
|
||||
|
||||
// byte-align structures
|
||||
#include "irrpack.h"
|
||||
|
||||
//! this holds the header info of the MD3 file
|
||||
struct SMD3Header
|
||||
{
|
||||
c8 headerID[4]; //id of file, always "IDP3"
|
||||
s32 Version; //this is a version number, always 15
|
||||
s8 fileName[68];//sometimes left Blank... 65 chars, 32bit aligned == 68 chars
|
||||
s32 numFrames; //number of KeyFrames
|
||||
s32 numTags; //number of 'tags' per frame
|
||||
s32 numMeshes; //number of meshes/skins
|
||||
s32 numMaxSkins;//maximum number of unique skins used in md3 file. artefact md2
|
||||
s32 frameStart; //starting position of frame-structur
|
||||
s32 tagStart; //starting position of tag-structures
|
||||
s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures
|
||||
s32 fileSize;
|
||||
} PACK_STRUCT;
|
||||
|
||||
//! this holds the header info of an MD3 mesh section
|
||||
struct SMD3MeshHeader
|
||||
{
|
||||
c8 meshID[4]; //id, must be IDP3
|
||||
c8 meshName[68]; //name of mesh 65 chars, 32 bit aligned == 68 chars
|
||||
|
||||
s32 numFrames; //number of meshframes in mesh
|
||||
s32 numShader; //number of skins in mesh
|
||||
s32 numVertices; //number of vertices
|
||||
s32 numTriangles; //number of Triangles
|
||||
|
||||
s32 offset_triangles; //starting position of Triangle data, relative to start of Mesh_Header
|
||||
s32 offset_shaders; //size of header
|
||||
s32 offset_st; //starting position of texvector data, relative to start of Mesh_Header
|
||||
s32 vertexStart; //starting position of vertex data,relative to start of Mesh_Header
|
||||
s32 offset_end;
|
||||
} PACK_STRUCT;
|
||||
|
||||
|
||||
//! Compressed Vertex Data
|
||||
struct SMD3Vertex
|
||||
{
|
||||
s16 position[3];
|
||||
u8 normal[2];
|
||||
} PACK_STRUCT;
|
||||
|
||||
//! Texture Coordinate
|
||||
struct SMD3TexCoord
|
||||
{
|
||||
f32 u;
|
||||
f32 v;
|
||||
} PACK_STRUCT;
|
||||
|
||||
//! Triangle Index
|
||||
struct SMD3Face
|
||||
{
|
||||
s32 Index[3];
|
||||
} PACK_STRUCT;
|
||||
|
||||
|
||||
// Default alignment
|
||||
#include "irrunpack.h"
|
||||
|
||||
//! Holding Frame Data for a Mesh
|
||||
struct SMD3MeshBuffer : public IReferenceCounted
|
||||
{
|
||||
SMD3MeshHeader MeshHeader;
|
||||
|
||||
core::stringc Shader;
|
||||
core::array < s32 > Indices;
|
||||
core::array < SMD3Vertex > Vertices;
|
||||
core::array < SMD3TexCoord > Tex;
|
||||
};
|
||||
|
||||
//! hold a tag info for connecting meshes
|
||||
/** Basically its an alternate way to describe a transformation. */
|
||||
struct SMD3QuaternionTag
|
||||
{
|
||||
virtual ~SMD3QuaternionTag()
|
||||
{
|
||||
position.X = 0.f;
|
||||
}
|
||||
|
||||
// construct for searching
|
||||
SMD3QuaternionTag( const core::stringc& name )
|
||||
: Name ( name ) {}
|
||||
|
||||
// construct from a position and euler angles in degrees
|
||||
SMD3QuaternionTag ( const core::vector3df &pos, const core::vector3df &angle )
|
||||
: position(pos), rotation(angle * core::DEGTORAD) {}
|
||||
|
||||
// set to matrix
|
||||
void setto ( core::matrix4 &m )
|
||||
{
|
||||
rotation.getMatrix ( m, position );
|
||||
}
|
||||
|
||||
bool operator == ( const SMD3QuaternionTag &other ) const
|
||||
{
|
||||
return Name == other.Name;
|
||||
}
|
||||
|
||||
core::stringc Name;
|
||||
core::vector3df position;
|
||||
core::quaternion rotation;
|
||||
};
|
||||
|
||||
//! holds a associative list of named quaternions
|
||||
struct SMD3QuaternionTagList
|
||||
{
|
||||
SMD3QuaternionTagList()
|
||||
{
|
||||
Container.setAllocStrategy(core::ALLOC_STRATEGY_SAFE);
|
||||
}
|
||||
|
||||
virtual ~SMD3QuaternionTagList() {}
|
||||
|
||||
SMD3QuaternionTag* get(const core::stringc& name)
|
||||
{
|
||||
SMD3QuaternionTag search ( name );
|
||||
s32 index = Container.linear_search ( search );
|
||||
if ( index >= 0 )
|
||||
return &Container[index];
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 size () const
|
||||
{
|
||||
return Container.size();
|
||||
}
|
||||
|
||||
void set_used(u32 new_size)
|
||||
{
|
||||
s32 diff = (s32) new_size - (s32) Container.allocated_size();
|
||||
if ( diff > 0 )
|
||||
{
|
||||
SMD3QuaternionTag e("");
|
||||
for ( s32 i = 0; i < diff; ++i )
|
||||
Container.push_back(e);
|
||||
}
|
||||
}
|
||||
|
||||
const SMD3QuaternionTag& operator[](u32 index) const
|
||||
{
|
||||
return Container[index];
|
||||
}
|
||||
|
||||
SMD3QuaternionTag& operator[](u32 index)
|
||||
{
|
||||
return Container[index];
|
||||
}
|
||||
|
||||
void push_back(const SMD3QuaternionTag& other)
|
||||
{
|
||||
Container.push_back(other);
|
||||
}
|
||||
|
||||
private:
|
||||
core::array < SMD3QuaternionTag > Container;
|
||||
};
|
||||
|
||||
|
||||
//! Holding Frames Buffers and Tag Infos
|
||||
struct SMD3Mesh: public IReferenceCounted
|
||||
{
|
||||
SMD3Mesh ()
|
||||
{
|
||||
MD3Header.numFrames = 0;
|
||||
}
|
||||
|
||||
virtual ~SMD3Mesh()
|
||||
{
|
||||
for (u32 i=0; i<Buffer.size(); ++i)
|
||||
Buffer[i]->drop();
|
||||
}
|
||||
|
||||
core::stringc Name;
|
||||
core::array<SMD3MeshBuffer*> Buffer;
|
||||
SMD3QuaternionTagList TagList;
|
||||
SMD3Header MD3Header;
|
||||
};
|
||||
|
||||
|
||||
//! Interface for using some special functions of MD3 meshes
|
||||
class IAnimatedMeshMD3 : public IAnimatedMesh
|
||||
{
|
||||
public:
|
||||
|
||||
//! tune how many frames you want to render in between.
|
||||
virtual void setInterpolationShift(u32 shift, u32 loopMode) =0;
|
||||
|
||||
//! get the tag list of the mesh.
|
||||
virtual SMD3QuaternionTagList* getTagList(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) =0;
|
||||
|
||||
//! get the original md3 mesh.
|
||||
virtual SMD3Mesh* getOriginalMesh() =0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -7,15 +7,12 @@
|
||||
|
||||
#include "ISceneNode.h"
|
||||
#include "IBoneSceneNode.h"
|
||||
#include "IAnimatedMeshMD2.h"
|
||||
#include "IAnimatedMeshMD3.h"
|
||||
#include "IAnimatedMesh.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
class IShadowVolumeSceneNode;
|
||||
|
||||
enum E_JOINT_UPDATE_ON_RENDER
|
||||
{
|
||||
//! do nothing
|
||||
@ -88,31 +85,6 @@ namespace scene
|
||||
/** \return Frames per second played. */
|
||||
virtual f32 getAnimationSpeed() const =0;
|
||||
|
||||
/** The shadow can be rendered using the ZPass or the zfail
|
||||
method. ZPass is a little bit faster because the shadow volume
|
||||
creation is easier, but with this method there occur ugly
|
||||
looking artifacts when the camera is inside the shadow volume.
|
||||
These error do not occur with the ZFail method, but it can
|
||||
have trouble with clipping to the far-plane (it usually works
|
||||
well in OpenGL and fails with other drivers).
|
||||
\param shadowMesh: Optional custom mesh for shadow volume.
|
||||
\param id: Id of the shadow scene node. This id can be used to
|
||||
identify the node later.
|
||||
\param zfailmethod: If set to true, the shadow will use the
|
||||
zfail method, if not, zpass is used.
|
||||
\param infinity: Value used by the shadow volume algorithm to
|
||||
scale the shadow volume. For zfail shadow volumes on some drivers
|
||||
only suppport finite shadows, so camera zfar must be larger than
|
||||
shadow back cap,which is depending on the infinity parameter).
|
||||
Infinity value also scales by the scaling factors of the model.
|
||||
If shadows don't show up with zfail then try reducing infinity.
|
||||
If shadows are cut-off then try increasing infinity.
|
||||
\return Pointer to the created shadow scene node. This pointer
|
||||
should not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0,
|
||||
s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f) = 0;
|
||||
|
||||
//! Get a pointer to a joint in the mesh (if the mesh is a bone based mesh).
|
||||
/** With this method it is possible to attach scene nodes to
|
||||
joints for example possible to attach a weapon to the left hand
|
||||
@ -137,31 +109,6 @@ namespace scene
|
||||
/** \return Amount of joints in the mesh. */
|
||||
virtual u32 getJointCount() const = 0;
|
||||
|
||||
//! Starts a default MD2 animation.
|
||||
/** With this method it is easily possible to start a Run,
|
||||
Attack, Die or whatever animation, if the mesh contained in
|
||||
this scene node is an md2 mesh. Otherwise, nothing happens.
|
||||
\param anim: An MD2 animation type, which should be played, for
|
||||
example EMAT_STAND for the standing animation.
|
||||
\return True if successful, and false if not, for example if
|
||||
the mesh in the scene node is not a md2 mesh. */
|
||||
virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) = 0;
|
||||
|
||||
//! Starts a special MD2 animation.
|
||||
/** With this method it is easily possible to start a Run,
|
||||
Attack, Die or whatever animation, if the mesh contained in
|
||||
this scene node is an md2 mesh. Otherwise, nothing happens.
|
||||
This method uses a character string to identify the animation.
|
||||
If the animation is a standard md2 animation, you might want to
|
||||
start this animation with the EMD2_ANIMATION_TYPE enumeration
|
||||
instead.
|
||||
\param animationName: Name of the animation which should be
|
||||
played.
|
||||
\return Returns true if successful, and false if not, for
|
||||
example if the mesh in the scene node is not an md2 mesh, or no
|
||||
animation with this name could be found. */
|
||||
virtual bool setMD2Animation(const c8* animationName) = 0;
|
||||
|
||||
//! Returns the currently displayed frame number.
|
||||
virtual f32 getFrameNr() const = 0;
|
||||
//! Returns the current start frame number.
|
||||
@ -198,9 +145,6 @@ namespace scene
|
||||
//! Returns the current mesh
|
||||
virtual IAnimatedMesh* getMesh(void) = 0;
|
||||
|
||||
//! Get the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh, or the absolutetransformation if it's a normal scenenode
|
||||
virtual const SMD3QuaternionTag* getMD3TagTransformation( const core::stringc & tagname) = 0;
|
||||
|
||||
//! Set how the joints should be updated on render
|
||||
virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode)=0;
|
||||
|
||||
|
@ -1,78 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED__
|
||||
#define __I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED__
|
||||
|
||||
#include "IBillboardSceneNode.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace gui
|
||||
{
|
||||
class IGUIFont;
|
||||
}
|
||||
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A billboard text scene node.
|
||||
/** Acts like a billboard which displays the currently set text.
|
||||
Due to the exclusion of RTTI in Irrlicht we have to avoid multiple
|
||||
inheritance. Hence, changes to the ITextSceneNode interface have
|
||||
to be copied here manually.
|
||||
*/
|
||||
class IBillboardTextSceneNode : public IBillboardSceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
IBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0,0,0))
|
||||
: IBillboardSceneNode(parent, mgr, id, position) {}
|
||||
|
||||
//! Sets the size of the billboard.
|
||||
virtual void setSize(const core::dimension2d<f32>& size) = 0;
|
||||
|
||||
//! Returns the size of the billboard.
|
||||
virtual const core::dimension2d<f32>& getSize() const = 0;
|
||||
|
||||
//! Set the color of all vertices of the billboard
|
||||
/** \param overallColor: the color to set */
|
||||
virtual void setColor(const video::SColor & overallColor) = 0;
|
||||
|
||||
//! Set the color of the top and bottom vertices of the billboard
|
||||
/** \param topColor: the color to set the top vertices
|
||||
\param bottomColor: the color to set the bottom vertices */
|
||||
virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor) = 0;
|
||||
|
||||
//! Gets the color of the top and bottom vertices of the billboard
|
||||
/** \param topColor: stores the color of the top vertices
|
||||
\param bottomColor: stores the color of the bottom vertices */
|
||||
virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) const = 0;
|
||||
|
||||
//! sets the text string
|
||||
virtual void setText(const wchar_t* text) = 0;
|
||||
|
||||
//! get the text string
|
||||
virtual const wchar_t* getText() const = 0;
|
||||
|
||||
//! sets the color of the text
|
||||
//! You can use setColor instead which does the same
|
||||
virtual void setTextColor(video::SColor color)
|
||||
{
|
||||
setColor(color);
|
||||
}
|
||||
|
||||
//! Get the font used to draw the text
|
||||
virtual gui::IGUIFont* getFont() const = 0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,209 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_GEOMETRY_CREATOR_H_INCLUDED__
|
||||
#define __I_GEOMETRY_CREATOR_H_INCLUDED__
|
||||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "IMesh.h"
|
||||
#include "IImage.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
class SMaterial;
|
||||
}
|
||||
|
||||
namespace scene
|
||||
{
|
||||
|
||||
enum ECUBE_MESH_TYPE
|
||||
{
|
||||
//! Single buffer with 12 different vertices, normals are average of adjacent planes
|
||||
//! Order for outgoing (front-face) normals of planes would be: NEG_Z, POS_X, POS_Z, NEG_X, POS_Y, NEG_Y
|
||||
ECMT_1BUF_12VTX_NA,
|
||||
|
||||
//! One buffer per side, each with 4 vertices, normals are perpendicular to sides
|
||||
//! Note: You probably will have to scale down your texture uv's to avoid white lines at borders
|
||||
// as this mesh sets them to 0,1 values. We can't do that when creating the mesh as it
|
||||
// depends on texture resolution which we don't know at that point.
|
||||
ECMT_6BUF_4VTX_NP
|
||||
};
|
||||
|
||||
//! Helper class for creating geometry on the fly.
|
||||
/** You can get an instance of this class through ISceneManager::getGeometryCreator() */
|
||||
class IGeometryCreator : public IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Creates a simple cube mesh.
|
||||
/**
|
||||
\param size Dimensions of the cube.
|
||||
\param type One of ECUBE_MESH_TYPE. So you can chose between cubes with single material or independent materials per side.
|
||||
\return Generated mesh.
|
||||
*/
|
||||
virtual IMesh* createCubeMesh(const core::vector3df& size=core::vector3df(5.f,5.f,5.f), ECUBE_MESH_TYPE type = ECMT_1BUF_12VTX_NA) const =0;
|
||||
|
||||
//! Create a pseudo-random mesh representing a hilly terrain.
|
||||
/**
|
||||
\param tileSize The size of each tile.
|
||||
\param tileCount The number of tiles in each dimension.
|
||||
\param material The material to apply to the mesh.
|
||||
\param hillHeight The maximum height of the hills.
|
||||
\param countHills The number of hills along each dimension.
|
||||
\param textureRepeatCount The number of times to repeat the material texture along each dimension.
|
||||
\return Generated mesh.
|
||||
*/
|
||||
virtual IMesh* createHillPlaneMesh(
|
||||
const core::dimension2d<f32>& tileSize,
|
||||
const core::dimension2d<u32>& tileCount,
|
||||
video::SMaterial* material, f32 hillHeight,
|
||||
const core::dimension2d<f32>& countHills,
|
||||
const core::dimension2d<f32>& textureRepeatCount) const =0;
|
||||
|
||||
//! Create a simple rectangular textured plane mesh.
|
||||
/**
|
||||
\param tileSize The size of each tile.
|
||||
\param tileCount The number of tiles in each dimension.
|
||||
\param material The material to apply to the mesh.
|
||||
\param textureRepeatCount The number of times to repeat the material texture along each dimension.
|
||||
\return Generated mesh.
|
||||
*/
|
||||
IMesh* createPlaneMesh(
|
||||
const core::dimension2d<f32>& tileSize,
|
||||
const core::dimension2d<u32>& tileCount=core::dimension2du(1,1),
|
||||
video::SMaterial* material=0,
|
||||
const core::dimension2df& textureRepeatCount=core::dimension2df(1.f,1.f)) const
|
||||
{
|
||||
return createHillPlaneMesh(tileSize, tileCount, material, 0.f, core::dimension2df(), textureRepeatCount);
|
||||
}
|
||||
|
||||
//! Create a geoplane.
|
||||
/**
|
||||
\param radius Radius of the plane
|
||||
\param rows How many rows to place
|
||||
\param columns How many columns to place
|
||||
\return Generated mesh.
|
||||
*/
|
||||
virtual IMesh* createGeoplaneMesh(f32 radius = 5.f,
|
||||
u32 rows = 16, u32 columns = 16) const =0;
|
||||
|
||||
//! Create a terrain mesh from an image representing a heightfield.
|
||||
/**
|
||||
\param texture The texture to apply to the terrain.
|
||||
\param heightmap An image that will be interpreted as a heightmap. The
|
||||
brightness (average color) of each pixel is interpreted as a height,
|
||||
with a 255 brightness pixel producing the maximum height.
|
||||
\param stretchSize The size that each pixel will produce, i.e. a
|
||||
512x512 heightmap
|
||||
and a stretchSize of (10.f, 20.f) will produce a mesh of size
|
||||
5120.f x 10240.f
|
||||
\param maxHeight The maximum height of the terrain.
|
||||
\param driver The current video driver.
|
||||
\param defaultVertexBlockSize (to be documented)
|
||||
\param debugBorders (to be documented)
|
||||
\return Generated mesh.
|
||||
*/
|
||||
virtual IMesh* createTerrainMesh(video::IImage* texture,
|
||||
video::IImage* heightmap,
|
||||
const core::dimension2d<f32>& stretchSize,
|
||||
f32 maxHeight, video::IVideoDriver* driver,
|
||||
const core::dimension2d<u32>& defaultVertexBlockSize,
|
||||
bool debugBorders=false) const =0;
|
||||
|
||||
//! Create an arrow mesh, composed of a cylinder and a cone.
|
||||
/**
|
||||
\param tesselationCylinder Number of quads composing the cylinder.
|
||||
\param tesselationCone Number of triangles composing the cone's roof.
|
||||
\param height Total height of the arrow
|
||||
\param cylinderHeight Total height of the cylinder, should be lesser
|
||||
than total height
|
||||
\param widthCylinder Diameter of the cylinder
|
||||
\param widthCone Diameter of the cone's base, should be not smaller
|
||||
than the cylinder's diameter
|
||||
\param colorCylinder color of the cylinder
|
||||
\param colorCone color of the cone
|
||||
\return Generated mesh.
|
||||
*/
|
||||
virtual IMesh* createArrowMesh(const u32 tesselationCylinder = 4,
|
||||
const u32 tesselationCone = 8, const f32 height = 1.f,
|
||||
const f32 cylinderHeight = 0.6f, const f32 widthCylinder = 0.05f,
|
||||
const f32 widthCone = 0.3f, const video::SColor colorCylinder = 0xFFFFFFFF,
|
||||
const video::SColor colorCone = 0xFFFFFFFF) const =0;
|
||||
|
||||
|
||||
//! Create a sphere mesh.
|
||||
/**
|
||||
\param radius Radius of the sphere
|
||||
\param polyCountX Number of quads used for the horizontal tiling
|
||||
\param polyCountY Number of quads used for the vertical tiling
|
||||
\return Generated mesh.
|
||||
*/
|
||||
virtual IMesh* createSphereMesh(f32 radius = 5.f,
|
||||
u32 polyCountX = 16, u32 polyCountY = 16) const =0;
|
||||
|
||||
//! Create a cylinder mesh.
|
||||
/**
|
||||
\param radius Radius of the cylinder.
|
||||
\param length Length of the cylinder.
|
||||
\param tesselation Number of quads around the circumference of the cylinder.
|
||||
\param color The color of the cylinder.
|
||||
\param closeTop If true, close the ends of the cylinder, otherwise leave them open.
|
||||
\param oblique X-offset (shear) of top compared to bottom.
|
||||
\param normalType When 0 side normals are radial from origin. Note that origin is at the bottom.
|
||||
When 1 side normals are flat along top/bottom polygons.
|
||||
NOTE: To get normals which are perpendicular to the side of an oblique
|
||||
cylinder, don't use the oblique parameter. Instead set normalType to 1
|
||||
and create a cylinder with oblique set to 0. Then use
|
||||
IMeshManipulator::transform with a shear matrix on the returned mesh.
|
||||
You get a shear matrix for an identical effect of this oblique parameter when you
|
||||
set the 4th element of an identity matrix to (oblique/length).
|
||||
\return Generated mesh.
|
||||
*/
|
||||
virtual IMesh* createCylinderMesh(f32 radius, f32 length,
|
||||
u32 tesselation,
|
||||
const video::SColor& color=video::SColor(0xffffffff),
|
||||
bool closeTop=true, f32 oblique=0.f, u32 normalType=0) const =0;
|
||||
|
||||
//! Create a cone mesh.
|
||||
/**
|
||||
\param radius Radius of the cone.
|
||||
\param length Length of the cone.
|
||||
\param tesselation Number of quads around the circumference of the cone.
|
||||
\param colorTop The color of the top of the cone.
|
||||
\param colorBottom The color of the bottom of the cone.
|
||||
\param oblique (to be documented)
|
||||
\return Generated mesh.
|
||||
*/
|
||||
virtual IMesh* createConeMesh(f32 radius, f32 length, u32 tesselation,
|
||||
const video::SColor& colorTop=video::SColor(0xffffffff),
|
||||
const video::SColor& colorBottom=video::SColor(0xffffffff),
|
||||
f32 oblique=0.f) const =0;
|
||||
|
||||
//! Create a volume light mesh.
|
||||
/**
|
||||
\param subdivideU Horizontal patch count.
|
||||
\param subdivideV Vertical patch count.
|
||||
\param footColor Color at the bottom of the light.
|
||||
\param tailColor Color at the mid of the light.
|
||||
\param lpDistance Virtual distance of the light point for normals.
|
||||
\param lightDim Dimensions of the light.
|
||||
\return Generated mesh.
|
||||
*/
|
||||
virtual IMesh* createVolumeLightMesh(
|
||||
const u32 subdivideU=32, const u32 subdivideV=32,
|
||||
const video::SColor footColor = 0xffffffff,
|
||||
const video::SColor tailColor = 0xffffffff,
|
||||
const f32 lpDistance = 8.f,
|
||||
const core::vector3df& lightDim = core::vector3df(1.f,1.2f,1.f)) const =0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif // __I_GEOMETRY_CREATOR_H_INCLUDED__
|
||||
|
@ -1,62 +0,0 @@
|
||||
// Written by Colin MacDonald - all rights assigned to Nikolaus Gebhardt
|
||||
// Copyright (C) 2008-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_LIGHT_MANAGER_H_INCLUDED__
|
||||
#define __I_LIGHT_MANAGER_H_INCLUDED__
|
||||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
class ILightSceneNode;
|
||||
|
||||
//! ILightManager provides an interface for user applications to manipulate the list of lights in the scene.
|
||||
/** The light list can be trimmed or re-ordered before device/ hardware
|
||||
lights are created, and/or individual lights can be switched on and off
|
||||
before or after each scene node is rendered. It is assumed that the
|
||||
ILightManager implementation will store any data that it wishes to
|
||||
retain, i.e. the ISceneManager to which it is assigned, the lightList,
|
||||
the current render pass, and the current scene node. */
|
||||
class ILightManager : public IReferenceCounted
|
||||
{
|
||||
public:
|
||||
//! Called after the scene's light list has been built, but before rendering has begun.
|
||||
/** As actual device/hardware lights are not created until the
|
||||
ESNRP_LIGHT render pass, this provides an opportunity for the
|
||||
light manager to trim or re-order the light list, before any
|
||||
device/hardware lights have actually been created.
|
||||
\param lightList: the Scene Manager's light list, which
|
||||
the light manager may modify. This reference will remain valid
|
||||
until OnPostRender().
|
||||
*/
|
||||
virtual void OnPreRender(core::array<ISceneNode*> & lightList) = 0;
|
||||
|
||||
//! Called after the last scene node is rendered.
|
||||
/** After this call returns, the lightList passed to OnPreRender() becomes invalid. */
|
||||
virtual void OnPostRender(void) = 0;
|
||||
|
||||
//! Called before a render pass begins
|
||||
/** \param renderPass: the render pass that's about to begin */
|
||||
virtual void OnRenderPassPreRender(E_SCENE_NODE_RENDER_PASS renderPass) = 0;
|
||||
|
||||
//! Called after the render pass specified in OnRenderPassPreRender() ends
|
||||
/** \param[in] renderPass: the render pass that has finished */
|
||||
virtual void OnRenderPassPostRender(E_SCENE_NODE_RENDER_PASS renderPass) = 0;
|
||||
|
||||
//! Called before the given scene node is rendered
|
||||
/** \param[in] node: the scene node that's about to be rendered */
|
||||
virtual void OnNodePreRender(ISceneNode* node) = 0;
|
||||
|
||||
//! Called after the the node specified in OnNodePreRender() has been rendered
|
||||
/** \param[in] node: the scene node that has just been rendered */
|
||||
virtual void OnNodePostRender(ISceneNode* node) = 0;
|
||||
};
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
@ -1,87 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_LIGHT_SCENE_NODE_H_INCLUDED__
|
||||
#define __I_LIGHT_SCENE_NODE_H_INCLUDED__
|
||||
|
||||
#include "ISceneNode.h"
|
||||
#include "SLight.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Scene node which is a dynamic light.
|
||||
/** You can switch the light on and off by making it visible or not. It can be
|
||||
animated by ordinary scene node animators. If the light type is directional or
|
||||
spot, the direction of the light source is defined by the rotation of the scene
|
||||
node (assuming (0,0,1) as the local direction of the light).
|
||||
*/
|
||||
class ILightSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
ILightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0,0,0))
|
||||
: ISceneNode(parent, mgr, id, position) {}
|
||||
|
||||
//! Sets the light data associated with this ILightSceneNode
|
||||
/** \param light The new light data. */
|
||||
virtual void setLightData(const video::SLight& light) = 0;
|
||||
|
||||
//! Gets the light data associated with this ILightSceneNode
|
||||
/** \return The light data. */
|
||||
virtual const video::SLight& getLightData() const = 0;
|
||||
|
||||
//! Gets the light data associated with this ILightSceneNode
|
||||
/** \return The light data. */
|
||||
virtual video::SLight& getLightData() = 0;
|
||||
|
||||
//! Sets if the node should be visible or not.
|
||||
/** All children of this node won't be visible either, when set
|
||||
to true.
|
||||
\param isVisible If the node shall be visible. */
|
||||
virtual void setVisible(bool isVisible) = 0;
|
||||
|
||||
//! Sets the light's radius of influence.
|
||||
/** Outside this radius the light won't lighten geometry and cast no
|
||||
shadows. Setting the radius will also influence the attenuation, setting
|
||||
it to (0,1/radius,0). If you want to override this behavior, set the
|
||||
attenuation after the radius.
|
||||
NOTE: On OpenGL only the attenuation is set, there's no hard range.
|
||||
\param radius The new radius. */
|
||||
virtual void setRadius(f32 radius) = 0;
|
||||
|
||||
//! Gets the light's radius of influence.
|
||||
/** \return The current radius. */
|
||||
virtual f32 getRadius() const = 0;
|
||||
|
||||
//! Sets the light type.
|
||||
/** \param type The new type. */
|
||||
virtual void setLightType(video::E_LIGHT_TYPE type) = 0;
|
||||
|
||||
//! Gets the light type.
|
||||
/** \return The current light type. */
|
||||
virtual video::E_LIGHT_TYPE getLightType() const = 0;
|
||||
|
||||
//! Sets whether this light casts shadows.
|
||||
/** Enabling this flag won't automatically cast shadows, the meshes
|
||||
will still need shadow scene nodes attached. But one can enable or
|
||||
disable distinct lights for shadow casting for performance reasons.
|
||||
\param shadow True if this light shall cast shadows. */
|
||||
virtual void enableCastShadow(bool shadow=true) = 0;
|
||||
|
||||
//! Check whether this light casts shadows.
|
||||
/** \return True if light would cast shadows, else false. */
|
||||
virtual bool getCastShadow() const = 0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "path.h"
|
||||
#include "IMeshTextureLoader.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
@ -29,14 +28,10 @@ class IMeshLoader : public virtual IReferenceCounted
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
IMeshLoader() : TextureLoader(0) {}
|
||||
IMeshLoader() {}
|
||||
|
||||
//! Destructor
|
||||
virtual ~IMeshLoader()
|
||||
{
|
||||
if ( TextureLoader )
|
||||
TextureLoader->drop();
|
||||
}
|
||||
virtual ~IMeshLoader() {}
|
||||
|
||||
//! Returns true if the file might be loaded by this class.
|
||||
/** This decision should be based on the file extension (e.g. ".cob")
|
||||
@ -51,35 +46,6 @@ public:
|
||||
If you no longer need the mesh, you should call IAnimatedMesh::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh* createMesh(io::IReadFile* file) = 0;
|
||||
|
||||
//! Set a new texture loader which this meshloader can use when searching for textures.
|
||||
/** NOTE: Not all meshloaders do support this interface. Meshloaders which
|
||||
support it will return a non-null value in getMeshTextureLoader from the start. Setting a
|
||||
texture-loader to a meshloader which doesn't support it won't help.
|
||||
\param textureLoader The textureloader to use. When set to NULL the mesh will not load any textures.
|
||||
*/
|
||||
virtual void setMeshTextureLoader(IMeshTextureLoader* textureLoader)
|
||||
{
|
||||
if ( textureLoader != TextureLoader )
|
||||
{
|
||||
if ( textureLoader )
|
||||
textureLoader->grab();
|
||||
if ( TextureLoader )
|
||||
TextureLoader->drop();
|
||||
TextureLoader = textureLoader;
|
||||
}
|
||||
}
|
||||
|
||||
//! Get the texture loader used when this meshloader searches for textures.
|
||||
/** NOTE: not all meshloaders support this interface so this can return NULL.
|
||||
*/
|
||||
virtual IMeshTextureLoader* getMeshTextureLoader() const
|
||||
{
|
||||
return TextureLoader;
|
||||
}
|
||||
|
||||
protected:
|
||||
IMeshTextureLoader* TextureLoader;
|
||||
};
|
||||
|
||||
|
||||
|
@ -12,7 +12,6 @@ namespace irr
|
||||
namespace scene
|
||||
{
|
||||
|
||||
class IShadowVolumeSceneNode;
|
||||
class IMesh;
|
||||
|
||||
|
||||
@ -38,31 +37,6 @@ public:
|
||||
/** \return Pointer to mesh which is displayed by this node. */
|
||||
virtual IMesh* getMesh(void) = 0;
|
||||
|
||||
/** The shadow can be rendered using the ZPass or the zfail
|
||||
method. ZPass is a little bit faster because the shadow volume
|
||||
creation is easier, but with this method there occur ugly
|
||||
looking artifacts when the camera is inside the shadow volume.
|
||||
These error do not occur with the ZFail method, but it can
|
||||
have trouble with clipping to the far-plane (it usually works
|
||||
well in OpenGL and fails with other drivers).
|
||||
\param shadowMesh: Optional custom mesh for shadow volume.
|
||||
\param id: Id of the shadow scene node. This id can be used to
|
||||
identify the node later.
|
||||
\param zfailmethod: If set to true, the shadow will use the
|
||||
zfail method, if not, zpass is used.
|
||||
\param infinity: Value used by the shadow volume algorithm to
|
||||
scale the shadow volume. For zfail shadow volumes on some drivers
|
||||
only suppport finite shadows, so camera zfar must be larger than
|
||||
shadow back cap,which is depending on the infinity parameter).
|
||||
Infinity value also scales by the scaling factors of the model.
|
||||
If shadows don't show up with zfail then try reducing infinity.
|
||||
If shadows are cut-off then try increasing infinity.
|
||||
\return Pointer to the created shadow scene node. This pointer
|
||||
should not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0,
|
||||
s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f) = 0;
|
||||
|
||||
//! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
|
||||
/** In this way it is possible to change the materials of a mesh
|
||||
causing all mesh scene nodes referencing this mesh to change, too.
|
||||
|
@ -1,65 +0,0 @@
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef IRR_I_MESH_TEXTURE_LOADER_H_INCLUDED__
|
||||
#define IRR_I_MESH_TEXTURE_LOADER_H_INCLUDED__
|
||||
|
||||
#include "path.h"
|
||||
#include "IReferenceCounted.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace video
|
||||
{
|
||||
class ITexture;
|
||||
}
|
||||
namespace io
|
||||
{
|
||||
class IReadFile;
|
||||
}
|
||||
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Finding and loading textures inside meshloaders.
|
||||
/** A texture loader can search for a texture in several paths.
|
||||
For example relative to a given texture-path, relative to the current
|
||||
working directory or relative to a mesh- and/or material-file.
|
||||
*/
|
||||
class IMeshTextureLoader : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor
|
||||
virtual ~IMeshTextureLoader() {}
|
||||
|
||||
//! Set a custom texture path.
|
||||
/** This is the first path the texture-loader should search. */
|
||||
virtual void setTexturePath(const irr::io::path& path) = 0;
|
||||
|
||||
//! Get the current custom texture path.
|
||||
virtual const irr::io::path& getTexturePath() const = 0;
|
||||
|
||||
//! Get the texture by searching for it in all paths that makes sense for the given textureName.
|
||||
/** Usually you do not have to use this method, it is used internally by IMeshLoader's.
|
||||
\param textureName Texturename as used in the mesh-format
|
||||
\return Pointer to the texture. Returns 0 if loading failed.*/
|
||||
virtual irr::video::ITexture* getTexture(const irr::io::path& textureName) = 0;
|
||||
|
||||
//! Meshloaders will search paths relative to the meshFile.
|
||||
/** Usually you do not have to use this method, it is used internally by IMeshLoader's.
|
||||
Any values you set here will likely be overwritten internally. */
|
||||
virtual void setMeshFile(const irr::io::IReadFile* meshFile) = 0;
|
||||
|
||||
//! Meshloaders will try to look relative to the path of the materialFile
|
||||
/** Usually you do not have to use this method, it is used internally by IMeshLoader's.
|
||||
Any values you set here will likely be overwritten internally. */
|
||||
virtual void setMaterialFile(const irr::io::IReadFile* materialFile) = 0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
@ -1,43 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_META_TRIANGLE_SELECTOR_H_INCLUDED__
|
||||
#define __I_META_TRIANGLE_SELECTOR_H_INCLUDED__
|
||||
|
||||
#include "ITriangleSelector.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Interface for making multiple triangle selectors work as one big selector.
|
||||
/** This is nothing more than a collection of one or more triangle selectors
|
||||
providing together the interface of one triangle selector. In this way,
|
||||
collision tests can be done with different triangle soups in one pass.
|
||||
*/
|
||||
class IMetaTriangleSelector : public ITriangleSelector
|
||||
{
|
||||
public:
|
||||
|
||||
//! Adds a triangle selector to the collection of triangle selectors.
|
||||
/** \param toAdd: Pointer to an triangle selector to add to the list. */
|
||||
virtual void addTriangleSelector(ITriangleSelector* toAdd) = 0;
|
||||
|
||||
//! Removes a specific triangle selector from the collection.
|
||||
/** \param toRemove: Pointer to an triangle selector which is in the
|
||||
list but will be removed.
|
||||
\return True if successful, false if not. */
|
||||
virtual bool removeTriangleSelector(ITriangleSelector* toRemove) = 0;
|
||||
|
||||
//! Removes all triangle selectors from the collection.
|
||||
virtual void removeAllTriangleSelectors() = 0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,83 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_OCTREE_SCENE_NODE_H_INCLUDED__
|
||||
#define __I_OCTREE_SCENE_NODE_H_INCLUDED__
|
||||
|
||||
#include "IMeshSceneNode.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Settings if/how octree scene nodes are using hardware mesh-buffers
|
||||
/** VBO = Vertex buffer object = meshbuffers bound on the graphic-card instead of uploaded each frame.
|
||||
It can not be generally said which mode is optimal for drawing as this depends
|
||||
on the scene. So you have to try and experiment for your meshes which one works best.
|
||||
*/
|
||||
enum EOCTREENODE_VBO
|
||||
{
|
||||
//! No VBO's used. Vertices+indices send to graphic-card on each render.
|
||||
EOV_NO_VBO,
|
||||
|
||||
//! VBO's used. Draw the complete meshbuffers if any polygon in it is visible.
|
||||
//! This allows VBO's for the meshbuffers to be completely static, but basically means
|
||||
//! the octree is not used as an octree (not it still does do all the octree calculations)
|
||||
//! Might work in very specific cases, but if this is gives you the best fastest results
|
||||
//! you should probably compare as well to simply using a static mesh with no octree at all.
|
||||
//! In most cases the other 2 options should work better with an octree.
|
||||
EOV_USE_VBO,
|
||||
|
||||
//! VBO's used. The index-buffer information is updated each frame
|
||||
//! with only the visible parts of a tree-node.
|
||||
//! So the vertex-buffer is static and the index-buffer is dynamic.
|
||||
//! This is the default
|
||||
EOV_USE_VBO_WITH_VISIBITLY
|
||||
};
|
||||
|
||||
//! Kind of checks polygons of the octree scene nodes use against camera
|
||||
enum EOCTREE_POLYGON_CHECKS
|
||||
{
|
||||
//! Check against box of the camera frustum
|
||||
//! This is the default
|
||||
EOPC_BOX,
|
||||
|
||||
//! against the camera frustum
|
||||
EOPC_FRUSTUM
|
||||
|
||||
};
|
||||
|
||||
//! A scene node displaying a static mesh
|
||||
class IOctreeSceneNode : public irr::scene::IMeshSceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
/** Use setMesh() to set the mesh to display.
|
||||
*/
|
||||
IOctreeSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1,1,1))
|
||||
: IMeshSceneNode(parent, mgr, id, position, rotation, scale) {}
|
||||
|
||||
//! Get if/how vertex buffer object are used for the meshbuffers
|
||||
// NOTE: Will currently _always_ return EOV_NO_VBO.
|
||||
// Octree's with VBO's don't work yet correctly.
|
||||
virtual EOCTREENODE_VBO getUseVBO() const = 0;
|
||||
|
||||
//! Set the kind of tests polygons do for visibility against the camera
|
||||
virtual void setPolygonChecks(EOCTREE_POLYGON_CHECKS checks) = 0;
|
||||
|
||||
//! Get the kind of tests polygons do for visibility against the camera
|
||||
virtual EOCTREE_POLYGON_CHECKS getPolygonChecks() const = 0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,72 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_AFFECTOR_H_INCLUDED__
|
||||
#define __I_PARTICLE_AFFECTOR_H_INCLUDED__
|
||||
|
||||
#include "IAttributeExchangingObject.h"
|
||||
#include "SParticle.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Types of built in particle affectors
|
||||
enum E_PARTICLE_AFFECTOR_TYPE
|
||||
{
|
||||
EPAT_NONE = 0,
|
||||
EPAT_ATTRACT,
|
||||
EPAT_FADE_OUT,
|
||||
EPAT_GRAVITY,
|
||||
EPAT_ROTATE,
|
||||
EPAT_SCALE,
|
||||
EPAT_COUNT
|
||||
};
|
||||
|
||||
//! Names for built in particle affectors
|
||||
const c8* const ParticleAffectorTypeNames[] =
|
||||
{
|
||||
"None",
|
||||
"Attract",
|
||||
"FadeOut",
|
||||
"Gravity",
|
||||
"Rotate",
|
||||
"Scale",
|
||||
0
|
||||
};
|
||||
|
||||
//! A particle affector modifies particles.
|
||||
class IParticleAffector : public virtual io::IAttributeExchangingObject
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
IParticleAffector() : Enabled(true) {}
|
||||
|
||||
//! Affects an array of particles.
|
||||
/** \param now Current time. (Same as ITimer::getTime() would return)
|
||||
\param particlearray Array of particles.
|
||||
\param count Amount of particles in array. */
|
||||
virtual void affect(u32 now, SParticle* particlearray, u32 count) = 0;
|
||||
|
||||
//! Sets whether or not the affector is currently enabled.
|
||||
virtual void setEnabled(bool enabled) { Enabled = enabled; }
|
||||
|
||||
//! Gets whether or not the affector is currently enabled.
|
||||
virtual bool getEnabled() const { return Enabled; }
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_AFFECTOR_TYPE getType() const = 0;
|
||||
|
||||
protected:
|
||||
bool Enabled;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,54 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__
|
||||
#define __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__
|
||||
|
||||
#include "IParticleEmitter.h"
|
||||
#include "IAnimatedMeshSceneNode.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle emitter which emits particles from mesh vertices.
|
||||
class IParticleAnimatedMeshSceneNodeEmitter : public IParticleEmitter
|
||||
{
|
||||
public:
|
||||
|
||||
//! Set Mesh to emit particles from
|
||||
virtual void setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node ) = 0;
|
||||
|
||||
//! Set whether to use vertex normal for direction, or direction specified
|
||||
virtual void setUseNormalDirection( bool useNormalDirection = true ) = 0;
|
||||
|
||||
//! Set the amount that the normal is divided by for getting a particles direction
|
||||
virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) = 0;
|
||||
|
||||
//! Sets whether to emit min<->max particles for every vertex or to pick min<->max vertices
|
||||
virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0;
|
||||
|
||||
//! Get mesh we're emitting particles from
|
||||
virtual const IAnimatedMeshSceneNode* getAnimatedMeshSceneNode() const = 0;
|
||||
|
||||
//! Get whether to use vertex normal for direction, or direction specified
|
||||
virtual bool isUsingNormalDirection() const = 0;
|
||||
|
||||
//! Get the amount that the normal is divided by for getting a particles direction
|
||||
virtual f32 getNormalDirectionModifier() const = 0;
|
||||
|
||||
//! Gets whether to emit min<->max particles for every vertex or to pick min<->max vertices
|
||||
virtual bool getEveryMeshVertex() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_ANIMATED_MESH; }
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__
|
||||
|
@ -1,65 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
|
||||
#define __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
|
||||
|
||||
#include "IParticleAffector.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle affector which attracts or detracts particles.
|
||||
class IParticleAttractionAffector : public IParticleAffector
|
||||
{
|
||||
public:
|
||||
|
||||
//! Set the point that particles will attract to
|
||||
virtual void setPoint( const core::vector3df& point ) = 0;
|
||||
|
||||
//! Set the speed, in game units per second that the particles will attract to the specified point
|
||||
virtual void setSpeed( f32 speed ) =0;
|
||||
|
||||
//! Set whether or not the particles are attracting or detracting
|
||||
virtual void setAttract( bool attract ) = 0;
|
||||
|
||||
//! Set whether or not this will affect particles in the X direction
|
||||
virtual void setAffectX( bool affect ) = 0;
|
||||
|
||||
//! Set whether or not this will affect particles in the Y direction
|
||||
virtual void setAffectY( bool affect ) = 0;
|
||||
|
||||
//! Set whether or not this will affect particles in the Z direction
|
||||
virtual void setAffectZ( bool affect ) = 0;
|
||||
|
||||
//! Get the point that particles are attracted to
|
||||
virtual const core::vector3df& getPoint() const = 0;
|
||||
|
||||
//! Get the speed that points attract to the specified point
|
||||
virtual f32 getSpeed() const =0;
|
||||
|
||||
//! Get whether or not the particles are attracting or detracting
|
||||
virtual bool getAttract() const = 0;
|
||||
|
||||
//! Get whether or not the particles X position are affected
|
||||
virtual bool getAffectX() const = 0;
|
||||
|
||||
//! Get whether or not the particles Y position are affected
|
||||
virtual bool getAffectY() const = 0;
|
||||
|
||||
//! Get whether or not the particles Z position are affected
|
||||
virtual bool getAffectZ() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_AFFECTOR_TYPE getType() const _IRR_OVERRIDE_ { return EPAT_ATTRACT; }
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
|
||||
|
@ -1,36 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_BOX_EMITTER_H_INCLUDED__
|
||||
#define __I_PARTICLE_BOX_EMITTER_H_INCLUDED__
|
||||
|
||||
#include "IParticleEmitter.h"
|
||||
#include "aabbox3d.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle emitter which emits particles from a box shaped space
|
||||
class IParticleBoxEmitter : public IParticleEmitter
|
||||
{
|
||||
public:
|
||||
|
||||
//! Set the box shape
|
||||
virtual void setBox( const core::aabbox3df& box ) = 0;
|
||||
|
||||
//! Get the box shape set
|
||||
virtual const core::aabbox3df& getBox() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_BOX; }
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,59 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__
|
||||
#define __I_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__
|
||||
|
||||
#include "IParticleEmitter.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle emitter which emits from a cylindrically shaped space.
|
||||
class IParticleCylinderEmitter : public IParticleEmitter
|
||||
{
|
||||
public:
|
||||
|
||||
//! Set the center of the radius for the cylinder, at one end of the cylinder
|
||||
virtual void setCenter( const core::vector3df& center ) = 0;
|
||||
|
||||
//! Set the normal of the cylinder
|
||||
virtual void setNormal( const core::vector3df& normal ) = 0;
|
||||
|
||||
//! Set the radius of the cylinder
|
||||
virtual void setRadius( f32 radius ) = 0;
|
||||
|
||||
//! Set the length of the cylinder
|
||||
virtual void setLength( f32 length ) = 0;
|
||||
|
||||
//! Set whether or not to draw points inside the cylinder
|
||||
virtual void setOutlineOnly( bool outlineOnly = true ) = 0;
|
||||
|
||||
//! Get the center of the cylinder
|
||||
virtual const core::vector3df& getCenter() const = 0;
|
||||
|
||||
//! Get the normal of the cylinder
|
||||
virtual const core::vector3df& getNormal() const = 0;
|
||||
|
||||
//! Get the radius of the cylinder
|
||||
virtual f32 getRadius() const = 0;
|
||||
|
||||
//! Get the center of the cylinder
|
||||
virtual f32 getLength() const = 0;
|
||||
|
||||
//! Get whether or not to draw points inside the cylinder
|
||||
virtual bool getOutlineOnly() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_CYLINDER; }
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,128 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_EMITTER_H_INCLUDED__
|
||||
#define __I_PARTICLE_EMITTER_H_INCLUDED__
|
||||
|
||||
#include "IAttributeExchangingObject.h"
|
||||
#include "SParticle.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Types of built in particle emitters
|
||||
enum E_PARTICLE_EMITTER_TYPE
|
||||
{
|
||||
EPET_POINT = 0,
|
||||
EPET_ANIMATED_MESH,
|
||||
EPET_BOX,
|
||||
EPET_CYLINDER,
|
||||
EPET_MESH,
|
||||
EPET_RING,
|
||||
EPET_SPHERE,
|
||||
EPET_COUNT
|
||||
};
|
||||
|
||||
//! Names for built in particle emitters
|
||||
const c8* const ParticleEmitterTypeNames[] =
|
||||
{
|
||||
"Point",
|
||||
"AnimatedMesh",
|
||||
"Box",
|
||||
"Cylinder",
|
||||
"Mesh",
|
||||
"Ring",
|
||||
"Sphere",
|
||||
0
|
||||
};
|
||||
|
||||
//! A particle emitter for using with particle systems.
|
||||
/** A Particle emitter emits new particles into a particle system.
|
||||
*/
|
||||
class IParticleEmitter : public virtual io::IAttributeExchangingObject
|
||||
{
|
||||
public:
|
||||
|
||||
//! Prepares an array with new particles to emit into the system
|
||||
/** \param now Current time.
|
||||
\param timeSinceLastCall Time elapsed since last call, in milliseconds.
|
||||
\param outArray Pointer which will point to the array with the new
|
||||
particles to add into the system.
|
||||
\return Amount of new particles in the array. Can be 0. */
|
||||
virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) = 0;
|
||||
|
||||
//! Set direction the emitter emits particles
|
||||
virtual void setDirection( const core::vector3df& newDirection ) = 0;
|
||||
|
||||
//! Set minimum number of particles the emitter emits per second
|
||||
virtual void setMinParticlesPerSecond( u32 minPPS ) = 0;
|
||||
|
||||
//! Set maximum number of particles the emitter emits per second
|
||||
virtual void setMaxParticlesPerSecond( u32 maxPPS ) = 0;
|
||||
|
||||
//! Set minimum starting color for particles
|
||||
virtual void setMinStartColor( const video::SColor& color ) = 0;
|
||||
|
||||
//! Set maximum starting color for particles
|
||||
virtual void setMaxStartColor( const video::SColor& color ) = 0;
|
||||
|
||||
//! Set the maximum starting size for particles
|
||||
virtual void setMaxStartSize( const core::dimension2df& size ) = 0;
|
||||
|
||||
//! Set the minimum starting size for particles
|
||||
virtual void setMinStartSize( const core::dimension2df& size ) = 0;
|
||||
|
||||
//! Set the minimum particle life-time in milliseconds
|
||||
virtual void setMinLifeTime( u32 lifeTimeMin ) = 0;
|
||||
|
||||
//! Set the maximum particle life-time in milliseconds
|
||||
virtual void setMaxLifeTime( u32 lifeTimeMax ) = 0;
|
||||
|
||||
//! Set maximal random derivation from the direction
|
||||
virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) = 0;
|
||||
|
||||
//! Get direction the emitter emits particles
|
||||
virtual const core::vector3df& getDirection() const = 0;
|
||||
|
||||
//! Get the minimum number of particles the emitter emits per second
|
||||
virtual u32 getMinParticlesPerSecond() const = 0;
|
||||
|
||||
//! Get the maximum number of particles the emitter emits per second
|
||||
virtual u32 getMaxParticlesPerSecond() const = 0;
|
||||
|
||||
//! Get the minimum starting color for particles
|
||||
virtual const video::SColor& getMinStartColor() const = 0;
|
||||
|
||||
//! Get the maximum starting color for particles
|
||||
virtual const video::SColor& getMaxStartColor() const = 0;
|
||||
|
||||
//! Get the maximum starting size for particles
|
||||
virtual const core::dimension2df& getMaxStartSize() const = 0;
|
||||
|
||||
//! Get the minimum starting size for particles
|
||||
virtual const core::dimension2df& getMinStartSize() const = 0;
|
||||
|
||||
//! Get the minimum particle life-time in milliseconds
|
||||
virtual u32 getMinLifeTime() const = 0;
|
||||
|
||||
//! Get the maximum particle life-time in milliseconds
|
||||
virtual u32 getMaxLifeTime() const = 0;
|
||||
|
||||
//! Get maximal random derivation from the direction
|
||||
virtual s32 getMaxAngleDegrees() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_POINT; }
|
||||
};
|
||||
|
||||
typedef IParticleEmitter IParticlePointEmitter;
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,41 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__
|
||||
#define __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__
|
||||
|
||||
#include "IParticleAffector.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle affector which fades out the particles.
|
||||
class IParticleFadeOutAffector : public IParticleAffector
|
||||
{
|
||||
public:
|
||||
|
||||
//! Sets the targetColor, i.e. the color the particles will interpolate to over time.
|
||||
virtual void setTargetColor( const video::SColor& targetColor ) = 0;
|
||||
|
||||
//! Sets the time in milliseconds it takes for each particle to fade out (minimal 1 ms)
|
||||
virtual void setFadeOutTime( u32 fadeOutTime ) = 0;
|
||||
|
||||
//! Gets the targetColor, i.e. the color the particles will interpolate to over time.
|
||||
virtual const video::SColor& getTargetColor() const = 0;
|
||||
|
||||
//! Gets the time in milliseconds it takes for each particle to fade out.
|
||||
virtual u32 getFadeOutTime() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_AFFECTOR_TYPE getType() const _IRR_OVERRIDE_ { return EPAT_FADE_OUT; }
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__
|
||||
|
@ -1,42 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__
|
||||
#define __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__
|
||||
|
||||
#include "IParticleAffector.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle affector which applies gravity to particles.
|
||||
class IParticleGravityAffector : public IParticleAffector
|
||||
{
|
||||
public:
|
||||
|
||||
//! Set the time in milliseconds when the gravity force is totally lost
|
||||
/** At that point the particle does not move any more. */
|
||||
virtual void setTimeForceLost( f32 timeForceLost ) = 0;
|
||||
|
||||
//! Set the direction and force of gravity in all 3 dimensions.
|
||||
virtual void setGravity( const core::vector3df& gravity ) = 0;
|
||||
|
||||
//! Get the time in milliseconds when the gravity force is totally lost
|
||||
virtual f32 getTimeForceLost() const = 0;
|
||||
|
||||
//! Get the direction and force of gravity.
|
||||
virtual const core::vector3df& getGravity() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_AFFECTOR_TYPE getType() const _IRR_OVERRIDE_ { return EPAT_GRAVITY; }
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__
|
||||
|
@ -1,54 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_MESH_EMITTER_H_INCLUDED__
|
||||
#define __I_PARTICLE_MESH_EMITTER_H_INCLUDED__
|
||||
|
||||
#include "IParticleEmitter.h"
|
||||
#include "IMesh.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle emitter which emits from vertices of a mesh
|
||||
class IParticleMeshEmitter : public IParticleEmitter
|
||||
{
|
||||
public:
|
||||
|
||||
//! Set Mesh to emit particles from
|
||||
virtual void setMesh( IMesh* mesh ) = 0;
|
||||
|
||||
//! Set whether to use vertex normal for direction, or direction specified
|
||||
virtual void setUseNormalDirection( bool useNormalDirection = true ) = 0;
|
||||
|
||||
//! Set the amount that the normal is divided by for getting a particles direction
|
||||
virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) = 0;
|
||||
|
||||
//! Sets whether to emit min<->max particles for every vertex or to pick min<->max vertices
|
||||
virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0;
|
||||
|
||||
//! Get Mesh we're emitting particles from
|
||||
virtual const IMesh* getMesh() const = 0;
|
||||
|
||||
//! Get whether to use vertex normal for direction, or direction specified
|
||||
virtual bool isUsingNormalDirection() const = 0;
|
||||
|
||||
//! Get the amount that the normal is divided by for getting a particles direction
|
||||
virtual f32 getNormalDirectionModifier() const = 0;
|
||||
|
||||
//! Gets whether to emit min<->max particles for every vertex or to pick min<->max vertices
|
||||
virtual bool getEveryMeshVertex() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_MESH; }
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,47 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_RING_EMITTER_H_INCLUDED__
|
||||
#define __I_PARTICLE_RING_EMITTER_H_INCLUDED__
|
||||
|
||||
#include "IParticleEmitter.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle emitter which emits particles along a ring shaped area.
|
||||
class IParticleRingEmitter : public IParticleEmitter
|
||||
{
|
||||
public:
|
||||
|
||||
//! Set the center of the ring
|
||||
virtual void setCenter( const core::vector3df& center ) = 0;
|
||||
|
||||
//! Set the radius of the ring
|
||||
virtual void setRadius( f32 radius ) = 0;
|
||||
|
||||
//! Set the thickness of the ring
|
||||
virtual void setRingThickness( f32 ringThickness ) = 0;
|
||||
|
||||
//! Get the center of the ring
|
||||
virtual const core::vector3df& getCenter() const = 0;
|
||||
|
||||
//! Get the radius of the ring
|
||||
virtual f32 getRadius() const = 0;
|
||||
|
||||
//! Get the thickness of the ring
|
||||
virtual f32 getRingThickness() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_RING; }
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,41 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__
|
||||
#define __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__
|
||||
|
||||
#include "IParticleAffector.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle affector which rotates the particle system.
|
||||
class IParticleRotationAffector : public IParticleAffector
|
||||
{
|
||||
public:
|
||||
|
||||
//! Set the point that particles will rotate around
|
||||
virtual void setPivotPoint( const core::vector3df& point ) = 0;
|
||||
|
||||
//! Set the speed in degrees per second in all 3 dimensions
|
||||
virtual void setSpeed( const core::vector3df& speed ) = 0;
|
||||
|
||||
//! Get the point that particles are attracted to
|
||||
virtual const core::vector3df& getPivotPoint() const = 0;
|
||||
|
||||
//! Get the speed in degrees per second in all 3 dimensions
|
||||
virtual const core::vector3df& getSpeed() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_AFFECTOR_TYPE getType() const _IRR_OVERRIDE_ { return EPAT_ROTATE; }
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__
|
||||
|
@ -1,41 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_SPHERE_EMITTER_H_INCLUDED__
|
||||
#define __I_PARTICLE_SPHERE_EMITTER_H_INCLUDED__
|
||||
|
||||
#include "IParticleEmitter.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle emitter which emits from a spherical space.
|
||||
class IParticleSphereEmitter : public IParticleEmitter
|
||||
{
|
||||
public:
|
||||
|
||||
//! Set the center of the sphere for particle emissions
|
||||
virtual void setCenter( const core::vector3df& center ) = 0;
|
||||
|
||||
//! Set the radius of the sphere for particle emissions
|
||||
virtual void setRadius( f32 radius ) = 0;
|
||||
|
||||
//! Get the center of the sphere for particle emissions
|
||||
virtual const core::vector3df& getCenter() const = 0;
|
||||
|
||||
//! Get the radius of the sphere for particle emissions
|
||||
virtual f32 getRadius() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_SPHERE; }
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,572 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__
|
||||
#define __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__
|
||||
|
||||
#include "ISceneNode.h"
|
||||
#include "IParticleAnimatedMeshSceneNodeEmitter.h"
|
||||
#include "IParticleBoxEmitter.h"
|
||||
#include "IParticleCylinderEmitter.h"
|
||||
#include "IParticleMeshEmitter.h"
|
||||
#include "IParticleRingEmitter.h"
|
||||
#include "IParticleSphereEmitter.h"
|
||||
#include "IParticleAttractionAffector.h"
|
||||
#include "IParticleFadeOutAffector.h"
|
||||
#include "IParticleGravityAffector.h"
|
||||
#include "IParticleRotationAffector.h"
|
||||
#include "dimension2d.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A particle system scene node for creating snow, fire, explosions, smoke...
|
||||
/** A scene node controlling a particle System. The behavior of the particles
|
||||
can be controlled by setting the right particle emitters and affectors.
|
||||
You can for example easily create a campfire by doing this:
|
||||
|
||||
\code
|
||||
scene::IParticleSystemSceneNode* p = scenemgr->addParticleSystemSceneNode();
|
||||
p->setParticleSize(core::dimension2d<f32>(20.0f, 10.0f));
|
||||
scene::IParticleEmitter* em = p->createBoxEmitter(
|
||||
core::aabbox3d<f32>(-5,0,-5,5,1,5),
|
||||
core::vector3df(0.0f,0.03f,0.0f),
|
||||
40,80, video::SColor(0,255,255,255),video::SColor(0,255,255,255), 1100,2000);
|
||||
p->setEmitter(em);
|
||||
em->drop();
|
||||
scene::IParticleAffector* paf = p->createFadeOutParticleAffector();
|
||||
p->addAffector(paf);
|
||||
paf->drop();
|
||||
\endcode
|
||||
*/
|
||||
|
||||
//! Bitflags to control particle behavior
|
||||
enum EParticleBehavior
|
||||
{
|
||||
//! Continue emitting new particles even when the node is invisible
|
||||
EPB_INVISIBLE_EMITTING = 1,
|
||||
|
||||
//! Continue affecting particles even when the node is invisible
|
||||
EPB_INVISIBLE_AFFECTING = 2,
|
||||
|
||||
//! Continue updating particle positions or deleting them even when the node is invisible
|
||||
EPB_INVISIBLE_ANIMATING = 4,
|
||||
|
||||
//! Clear all particles when node gets invisible
|
||||
EPB_CLEAR_ON_INVISIBLE = 8,
|
||||
|
||||
//! Particle movement direction on emitting ignores the node rotation
|
||||
//! This is mainly to allow backward compatible behavior to Irrlicht 1.8
|
||||
EPB_EMITTER_VECTOR_IGNORE_ROTATION = 16,
|
||||
|
||||
//! On emitting global particles interpolate the positions randomly between the last and current node transformations.
|
||||
//! This can be set to avoid gaps caused by fast node movement or low framerates, but will be somewhat
|
||||
//! slower to calculate.
|
||||
EPB_EMITTER_FRAME_INTERPOLATION = 32
|
||||
};
|
||||
|
||||
class IParticleSystemSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
IParticleSystemSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
|
||||
: ISceneNode(parent, mgr, id, position, rotation, scale)
|
||||
, ParticleBehavior(0)
|
||||
{
|
||||
}
|
||||
|
||||
//! Sets the size of all particles.
|
||||
virtual void setParticleSize(
|
||||
const core::dimension2d<f32> &size = core::dimension2d<f32>(5.0f, 5.0f)) = 0;
|
||||
|
||||
//! Sets if the particles should be global.
|
||||
/** If they are, the particles are affected by the movement of the
|
||||
particle system scene node too, otherwise they completely ignore it.
|
||||
Default is true. */
|
||||
virtual void setParticlesAreGlobal(bool global=true) = 0;
|
||||
|
||||
|
||||
//! Bitflags to change the particle behavior
|
||||
/**
|
||||
\param flags A combination of ::EParticleBehavior bit-flags. Default is 0. */
|
||||
virtual void setParticleBehavior(irr::u32 flags)
|
||||
{
|
||||
ParticleBehavior = flags;
|
||||
}
|
||||
|
||||
|
||||
//! Gets how particles behave in different situations
|
||||
/**
|
||||
\return A combination of ::EParticleBehavior flags */
|
||||
virtual irr::u32 getParticleBehavior() const
|
||||
{
|
||||
return ParticleBehavior;
|
||||
}
|
||||
|
||||
//! Remove all currently visible particles
|
||||
virtual void clearParticles() = 0;
|
||||
|
||||
//! Do manually update the particles.
|
||||
/** This should only be called when you want to render the node outside
|
||||
the scenegraph, as the node will care about this otherwise
|
||||
automatically. */
|
||||
virtual void doParticleSystem(u32 time) = 0;
|
||||
|
||||
//! Gets the particle emitter, which creates the particles.
|
||||
/** \return The particle emitter. Can be 0 if none is set. */
|
||||
virtual IParticleEmitter* getEmitter() =0;
|
||||
|
||||
//! Sets the particle emitter, which creates the particles.
|
||||
/** A particle emitter can be created using one of the createEmitter
|
||||
methods. For example to create and use a simple PointEmitter, call
|
||||
IParticleEmitter* p = createPointEmitter(); setEmitter(p); p->drop();
|
||||
\param emitter: Sets the particle emitter. You can set this to 0 for
|
||||
removing the current emitter and stopping the particle system emitting
|
||||
new particles. */
|
||||
virtual void setEmitter(IParticleEmitter* emitter) = 0;
|
||||
|
||||
//! Adds new particle effector to the particle system.
|
||||
/** A particle affector modifies the particles. For example, the FadeOut
|
||||
affector lets all particles fade out after some time. It is created and
|
||||
used in this way:
|
||||
\code
|
||||
IParticleAffector* p = createFadeOutParticleAffector();
|
||||
addAffector(p);
|
||||
p->drop();
|
||||
\endcode
|
||||
Please note that an affector is not necessary for the particle system to
|
||||
work.
|
||||
\param affector: New affector. */
|
||||
virtual void addAffector(IParticleAffector* affector) = 0;
|
||||
|
||||
//! Get a list of all particle affectors.
|
||||
/** \return The list of particle affectors attached to this node. */
|
||||
virtual const core::list<IParticleAffector*>& getAffectors() const = 0;
|
||||
|
||||
//! Removes all particle affectors in the particle system.
|
||||
virtual void removeAllAffectors() = 0;
|
||||
|
||||
//! Creates a particle emitter for an animated mesh scene node
|
||||
/** \param node: Pointer to the animated mesh scene node to emit
|
||||
particles from
|
||||
\param useNormalDirection: If true, the direction of each particle
|
||||
created will be the normal of the vertex that it's emitting from. The
|
||||
normal is divided by the normalDirectionModifier parameter, which
|
||||
defaults to 100.0f.
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param normalDirectionModifier: If the emitter is using the normal
|
||||
direction then the normal of the vertex that is being emitted from is
|
||||
divided by this number.
|
||||
\param mbNumber: This allows you to specify a specific meshBuffer for
|
||||
the IMesh* to emit particles from. The default value is -1, which
|
||||
means a random meshBuffer picked from all of the meshes meshBuffers
|
||||
will be selected to pick a random vertex from. If the value is 0 or
|
||||
greater, it will only pick random vertices from the meshBuffer
|
||||
specified by this value.
|
||||
\param everyMeshVertex: If true, the emitter will emit between min/max
|
||||
particles every second, for every vertex in the mesh, if false, it will
|
||||
emit between min/max particles from random vertices in the mesh.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\param minStartSize: Minimal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\param maxStartSize: Maximal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleAnimatedMeshSceneNodeEmitter* createAnimatedMeshSceneNodeEmitter(
|
||||
scene::IAnimatedMeshSceneNode* node, bool useNormalDirection = true,
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1,
|
||||
bool everyMeshVertex = false,
|
||||
u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
|
||||
const video::SColor& minStartColor = video::SColor(255,0,0,0),
|
||||
const video::SColor& maxStartColor = video::SColor(255,255,255,255),
|
||||
u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
|
||||
s32 maxAngleDegrees = 0,
|
||||
const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
|
||||
const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
|
||||
|
||||
//! Creates a box particle emitter.
|
||||
/** \param box: The box for the emitter.
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\param minStartSize: Minimal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\param maxStartSize: Maximal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleBoxEmitter* createBoxEmitter(
|
||||
const core::aabbox3df& box = core::aabbox3df(-10,28,-10,10,30,10),
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
u32 minParticlesPerSecond = 5,
|
||||
u32 maxParticlesPerSecond = 10,
|
||||
const video::SColor& minStartColor = video::SColor(255,0,0,0),
|
||||
const video::SColor& maxStartColor = video::SColor(255,255,255,255),
|
||||
u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
|
||||
s32 maxAngleDegrees=0,
|
||||
const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
|
||||
const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
|
||||
|
||||
//! Creates a particle emitter for emitting from a cylinder
|
||||
/** \param center: The center of the circle at the base of the cylinder
|
||||
\param radius: The thickness of the cylinder
|
||||
\param normal: Direction of the length of the cylinder
|
||||
\param length: The length of the the cylinder
|
||||
\param outlineOnly: Whether or not to put points inside the cylinder or
|
||||
on the outline only
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\param minStartSize: Minimal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\param maxStartSize: Maximal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleCylinderEmitter* createCylinderEmitter(
|
||||
const core::vector3df& center, f32 radius,
|
||||
const core::vector3df& normal, f32 length,
|
||||
bool outlineOnly = false,
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
|
||||
const video::SColor& minStartColor = video::SColor(255,0,0,0),
|
||||
const video::SColor& maxStartColor = video::SColor(255,255,255,255),
|
||||
u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
|
||||
s32 maxAngleDegrees = 0,
|
||||
const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
|
||||
const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
|
||||
|
||||
//! Creates a mesh particle emitter.
|
||||
/** \param mesh: Pointer to mesh to emit particles from
|
||||
\param useNormalDirection: If true, the direction of each particle
|
||||
created will be the normal of the vertex that it's emitting from. The
|
||||
normal is divided by the normalDirectionModifier parameter, which
|
||||
defaults to 100.0f.
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param normalDirectionModifier: If the emitter is using the normal
|
||||
direction then the normal of the vertex that is being emitted from is
|
||||
divided by this number.
|
||||
\param mbNumber: This allows you to specify a specific meshBuffer for
|
||||
the IMesh* to emit particles from. The default value is -1, which
|
||||
means a random meshBuffer picked from all of the meshes meshBuffers
|
||||
will be selected to pick a random vertex from. If the value is 0 or
|
||||
greater, it will only pick random vertices from the meshBuffer
|
||||
specified by this value.
|
||||
\param everyMeshVertex: If true, the emitter will emit between min/max
|
||||
particles every second, for every vertex in the mesh, if false, it will
|
||||
emit between min/max particles from random vertices in the mesh.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\param minStartSize: Minimal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\param maxStartSize: Maximal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleMeshEmitter* createMeshEmitter(
|
||||
scene::IMesh* mesh, bool useNormalDirection = true,
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1,
|
||||
bool everyMeshVertex = false,
|
||||
u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
|
||||
const video::SColor& minStartColor = video::SColor(255,0,0,0),
|
||||
const video::SColor& maxStartColor = video::SColor(255,255,255,255),
|
||||
u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
|
||||
s32 maxAngleDegrees = 0,
|
||||
const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
|
||||
const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
|
||||
|
||||
//! Creates a point particle emitter.
|
||||
/** \param direction: Direction and speed of particle emission.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\param minStartSize: Minimal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\param maxStartSize: Maximal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticlePointEmitter* createPointEmitter(
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
u32 minParticlesPerSecond = 5,
|
||||
u32 maxParticlesPerSecond = 10,
|
||||
const video::SColor& minStartColor = video::SColor(255,0,0,0),
|
||||
const video::SColor& maxStartColor = video::SColor(255,255,255,255),
|
||||
u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
|
||||
s32 maxAngleDegrees=0,
|
||||
const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
|
||||
const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
|
||||
|
||||
//! Creates a ring particle emitter.
|
||||
/** \param center: Center of ring
|
||||
\param radius: Distance of points from center, points will be rotated
|
||||
around the Y axis at a random 360 degrees and will then be shifted by
|
||||
the provided ringThickness values in each axis.
|
||||
\param ringThickness : thickness of the ring or how wide the ring is
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\param minStartSize: Minimal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\param maxStartSize: Maximal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleRingEmitter* createRingEmitter(
|
||||
const core::vector3df& center, f32 radius, f32 ringThickness,
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
u32 minParticlesPerSecond = 5,
|
||||
u32 maxParticlesPerSecond = 10,
|
||||
const video::SColor& minStartColor = video::SColor(255,0,0,0),
|
||||
const video::SColor& maxStartColor = video::SColor(255,255,255,255),
|
||||
u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
|
||||
s32 maxAngleDegrees=0,
|
||||
const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
|
||||
const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
|
||||
|
||||
//! Creates a sphere particle emitter.
|
||||
/** \param center: Center of sphere
|
||||
\param radius: Radius of sphere
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\param minStartSize: Minimal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\param maxStartSize: Maximal initial start size of a particle. The
|
||||
real size of every particle is calculated as random interpolation
|
||||
between minStartSize and maxStartSize.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleSphereEmitter* createSphereEmitter(
|
||||
const core::vector3df& center, f32 radius,
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
u32 minParticlesPerSecond = 5,
|
||||
u32 maxParticlesPerSecond = 10,
|
||||
const video::SColor& minStartColor = video::SColor(255,0,0,0),
|
||||
const video::SColor& maxStartColor = video::SColor(255,255,255,255),
|
||||
u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
|
||||
s32 maxAngleDegrees=0,
|
||||
const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
|
||||
const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
|
||||
|
||||
//! Creates a point attraction affector.
|
||||
/** This affector modifies the positions of the particles and attracts
|
||||
them to a specified point at a specified speed per second.
|
||||
\param point: Point to attract particles to.
|
||||
\param speed: Speed in units per second, to attract to the specified
|
||||
point.
|
||||
\param attract: Whether the particles attract or detract from this
|
||||
point.
|
||||
\param affectX: Whether or not this will affect the X position of the
|
||||
particle.
|
||||
\param affectY: Whether or not this will affect the Y position of the
|
||||
particle.
|
||||
\param affectZ: Whether or not this will affect the Z position of the
|
||||
particle.
|
||||
\return Pointer to the created particle affector. To add this affector
|
||||
as new affector of this particle system, just call addAffector(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleAttractionAffector* createAttractionAffector(
|
||||
const core::vector3df& point, f32 speed = 1.0f, bool attract = true,
|
||||
bool affectX = true, bool affectY = true, bool affectZ = true) = 0;
|
||||
|
||||
//! Creates a scale particle affector.
|
||||
/** This affector scales the particle to the a multiple of its size defined
|
||||
by the scaleTo variable.
|
||||
\param scaleTo: multiple of the size which the particle will be scaled to until deletion
|
||||
\return Pointer to the created particle affector.
|
||||
To add this affector as new affector of this particle system,
|
||||
just call addAffector(). Note that you'll have to drop() the
|
||||
returned pointer, after you don't need it any more, see
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleAffector* createScaleParticleAffector(const core::dimension2df& scaleTo = core::dimension2df(1.0f, 1.0f)) = 0;
|
||||
|
||||
//! Creates a fade out particle affector.
|
||||
/** This affector modifies the color of every particle and and reaches
|
||||
the final color when the particle dies. This affector looks really
|
||||
good, if the EMT_TRANSPARENT_ADD_COLOR material is used and the
|
||||
targetColor is video::SColor(0,0,0,0): Particles are fading out into
|
||||
void with this setting.
|
||||
\param targetColor: Color whereto the color of the particle is changed.
|
||||
\param timeNeededToFadeOut: How much time in milliseconds should the
|
||||
affector need to change the color to the targetColor.
|
||||
\return Pointer to the created particle affector. To add this affector
|
||||
as new affector of this particle system, just call addAffector(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleFadeOutAffector* createFadeOutParticleAffector(
|
||||
const video::SColor& targetColor = video::SColor(0,0,0,0),
|
||||
u32 timeNeededToFadeOut = 1000) = 0;
|
||||
|
||||
//! Creates a gravity affector.
|
||||
/** This affector modifies the direction of the particle. It assumes
|
||||
that the particle is fired out of the emitter with huge force, but is
|
||||
loosing this after some time and is caught by the gravity then. This
|
||||
affector is ideal for creating things like fountains.
|
||||
\param gravity: Direction and force of gravity.
|
||||
\param timeForceLost: Time in milliseconds when the force of the
|
||||
emitter is totally lost and the particle does not move any more. This
|
||||
is the time where gravity fully affects the particle.
|
||||
\return Pointer to the created particle affector. To add this affector
|
||||
as new affector of this particle system, just call addAffector(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleGravityAffector* createGravityAffector(
|
||||
const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f),
|
||||
u32 timeForceLost = 1000) = 0;
|
||||
|
||||
//! Creates a rotation affector.
|
||||
/** This affector modifies the positions of the particles and attracts
|
||||
them to a specified point at a specified speed per second.
|
||||
\param speed: Rotation in degrees per second
|
||||
\param pivotPoint: Point to rotate the particles around
|
||||
\return Pointer to the created particle affector. To add this affector
|
||||
as new affector of this particle system, just call addAffector(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleRotationAffector* createRotationAffector(
|
||||
const core::vector3df& speed = core::vector3df(5.0f,5.0f,5.0f),
|
||||
const core::vector3df& pivotPoint = core::vector3df(0.0f,0.0f,0.0f) ) = 0;
|
||||
|
||||
//! Writes attributes of the scene node.
|
||||
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_
|
||||
{
|
||||
out->addInt("ParticleBehavior", ParticleBehavior);
|
||||
}
|
||||
|
||||
//! Reads attributes of the scene node.
|
||||
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_
|
||||
{
|
||||
ParticleBehavior = in->getAttributeAsInt("ParticleBehavior", ParticleBehavior);
|
||||
}
|
||||
|
||||
protected:
|
||||
s32 ParticleBehavior;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
@ -1,46 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_Q3_LEVEL_MESH_H_INCLUDED__
|
||||
#define __I_Q3_LEVEL_MESH_H_INCLUDED__
|
||||
|
||||
#include "IAnimatedMesh.h"
|
||||
#include "IQ3Shader.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
//! Interface for a Mesh which can be loaded directly from a Quake3 .bsp-file.
|
||||
/** The Mesh tries to load all textures of the map.*/
|
||||
class IQ3LevelMesh : public IAnimatedMesh
|
||||
{
|
||||
public:
|
||||
|
||||
//! loads the shader definition from file
|
||||
/** \param filename Name of the shaderfile, defaults to /scripts if fileNameIsValid is false.
|
||||
\param fileNameIsValid Specifies whether the filename is valid in the current situation. */
|
||||
virtual const quake3::IShader* getShader( const c8* filename, bool fileNameIsValid=true ) = 0;
|
||||
|
||||
//! returns a already loaded Shader
|
||||
virtual const quake3::IShader* getShader(u32 index) const = 0;
|
||||
|
||||
//! get's an interface to the entities
|
||||
virtual quake3::tQ3EntityList& getEntityList() = 0;
|
||||
|
||||
//! returns the requested brush entity
|
||||
/** \param num The number from the model key of the entity.
|
||||
|
||||
Use this interface if you parse the entities yourself.*/
|
||||
virtual IMesh* getBrushEntityMesh(s32 num) const = 0;
|
||||
|
||||
//! returns the requested brush entity
|
||||
virtual IMesh* getBrushEntityMesh(quake3::IEntity &ent) const = 0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -1,875 +0,0 @@
|
||||
// Copyright (C) 2006-2012 Nikolaus Gebhardt / Thomas Alten
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_Q3_LEVEL_SHADER_H_INCLUDED__
|
||||
#define __I_Q3_LEVEL_SHADER_H_INCLUDED__
|
||||
|
||||
#include "irrArray.h"
|
||||
#include "fast_atof.h"
|
||||
#include "IFileSystem.h"
|
||||
#include "IVideoDriver.h"
|
||||
#include "coreutil.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
namespace quake3
|
||||
{
|
||||
|
||||
static core::stringc irrEmptyStringc("");
|
||||
|
||||
//! Hold the different Mesh Types used for getMesh
|
||||
enum eQ3MeshIndex
|
||||
{
|
||||
E_Q3_MESH_GEOMETRY = 0,
|
||||
E_Q3_MESH_ITEMS,
|
||||
E_Q3_MESH_BILLBOARD,
|
||||
E_Q3_MESH_FOG,
|
||||
E_Q3_MESH_UNRESOLVED,
|
||||
E_Q3_MESH_SIZE
|
||||
};
|
||||
|
||||
/*! used to customize Quake3 BSP Loader
|
||||
*/
|
||||
|
||||
struct Q3LevelLoadParameter
|
||||
{
|
||||
Q3LevelLoadParameter ()
|
||||
:defaultLightMapMaterial ( video::EMT_LIGHTMAP_M4 ),
|
||||
defaultModulate ( video::EMFN_MODULATE_4X ),
|
||||
defaultFilter ( video::EMF_BILINEAR_FILTER ),
|
||||
patchTesselation ( 8 ),
|
||||
verbose ( 0 ),
|
||||
startTime ( 0 ), endTime ( 0 ),
|
||||
mergeShaderBuffer ( 1 ),
|
||||
cleanUnResolvedMeshes ( 1 ),
|
||||
loadAllShaders ( 0 ),
|
||||
loadSkyShader ( 0 ),
|
||||
alpharef ( 1 ),
|
||||
swapLump ( 0 ),
|
||||
#ifdef __BIG_ENDIAN__
|
||||
swapHeader ( 1 )
|
||||
#else
|
||||
swapHeader ( 0 )
|
||||
#endif
|
||||
{
|
||||
memcpy ( scriptDir, "scripts\x0", 8 );
|
||||
}
|
||||
|
||||
video::E_MATERIAL_TYPE defaultLightMapMaterial;
|
||||
video::E_MODULATE_FUNC defaultModulate;
|
||||
video::E_MATERIAL_FLAG defaultFilter;
|
||||
s32 patchTesselation;
|
||||
s32 verbose;
|
||||
u32 startTime;
|
||||
u32 endTime;
|
||||
s32 mergeShaderBuffer;
|
||||
s32 cleanUnResolvedMeshes;
|
||||
s32 loadAllShaders;
|
||||
s32 loadSkyShader;
|
||||
s32 alpharef;
|
||||
s32 swapLump;
|
||||
s32 swapHeader;
|
||||
c8 scriptDir [ 64 ];
|
||||
};
|
||||
|
||||
// some useful typedefs
|
||||
typedef core::array< core::stringc > tStringList;
|
||||
typedef core::array< video::ITexture* > tTexArray;
|
||||
|
||||
// string helper.. TODO: move to generic files
|
||||
inline s16 isEqual ( const core::stringc &string, u32 &pos, const c8 * const list[], u16 listSize )
|
||||
{
|
||||
const char * in = string.c_str () + pos;
|
||||
|
||||
for ( u16 i = 0; i != listSize; ++i )
|
||||
{
|
||||
if (string.size() < pos)
|
||||
return -2;
|
||||
u32 len = (u32) strlen ( list[i] );
|
||||
if (string.size() < pos+len)
|
||||
continue;
|
||||
if ( in [len] != 0 && in [len] != ' ' )
|
||||
continue;
|
||||
if ( strncmp ( in, list[i], len ) )
|
||||
continue;
|
||||
|
||||
pos += len + 1;
|
||||
return (s16) i;
|
||||
}
|
||||
return -2;
|
||||
}
|
||||
|
||||
inline f32 getAsFloat ( const core::stringc &string, u32 &pos )
|
||||
{
|
||||
const char * in = string.c_str () + pos;
|
||||
|
||||
f32 value = 0.f;
|
||||
pos += (u32) ( core::fast_atof_move ( in, value ) - in ) + 1;
|
||||
return value;
|
||||
}
|
||||
|
||||
//! get a quake3 vector translated to irrlicht position (x,-z,y )
|
||||
inline core::vector3df getAsVector3df ( const core::stringc &string, u32 &pos )
|
||||
{
|
||||
core::vector3df v;
|
||||
|
||||
v.X = getAsFloat ( string, pos );
|
||||
v.Z = getAsFloat ( string, pos );
|
||||
v.Y = getAsFloat ( string, pos );
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
extract substrings
|
||||
*/
|
||||
inline void getAsStringList ( tStringList &list, s32 max, const core::stringc &string, u32 &startPos )
|
||||
{
|
||||
list.clear ();
|
||||
|
||||
s32 finish = 0;
|
||||
s32 endPos;
|
||||
do
|
||||
{
|
||||
endPos = string.findNext ( ' ', startPos );
|
||||
if ( endPos == -1 )
|
||||
{
|
||||
finish = 1;
|
||||
endPos = string.size();
|
||||
}
|
||||
|
||||
list.push_back ( string.subString ( startPos, endPos - startPos ) );
|
||||
startPos = endPos + 1;
|
||||
|
||||
if ( list.size() >= (u32) max )
|
||||
finish = 1;
|
||||
|
||||
} while ( !finish );
|
||||
|
||||
}
|
||||
|
||||
//! A blend function for a q3 shader.
|
||||
struct SBlendFunc
|
||||
{
|
||||
SBlendFunc ( video::E_MODULATE_FUNC mod )
|
||||
: type ( video::EMT_SOLID ), modulate ( mod ),
|
||||
param0( 0.f ),
|
||||
isTransparent ( 0 ) {}
|
||||
|
||||
video::E_MATERIAL_TYPE type;
|
||||
video::E_MODULATE_FUNC modulate;
|
||||
|
||||
f32 param0;
|
||||
u32 isTransparent;
|
||||
};
|
||||
|
||||
// parses the content of Variable cull
|
||||
inline bool getCullingFunction ( const core::stringc &cull )
|
||||
{
|
||||
if ( cull.size() == 0 )
|
||||
return true;
|
||||
|
||||
bool ret = true;
|
||||
static const c8 * funclist[] = { "none", "disable", "twosided" };
|
||||
|
||||
u32 pos = 0;
|
||||
switch ( isEqual ( cull, pos, funclist, 3 ) )
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
ret = false;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// parses the content of Variable depthfunc
|
||||
// return a z-test
|
||||
inline u8 getDepthFunction ( const core::stringc &string )
|
||||
{
|
||||
u8 ret = video::ECFN_LESSEQUAL;
|
||||
|
||||
if ( string.size() == 0 )
|
||||
return ret;
|
||||
|
||||
static const c8 * funclist[] = { "lequal","equal" };
|
||||
|
||||
u32 pos = 0;
|
||||
switch ( isEqual ( string, pos, funclist, 2 ) )
|
||||
{
|
||||
case 0:
|
||||
ret = video::ECFN_LESSEQUAL;
|
||||
break;
|
||||
case 1:
|
||||
ret = video::ECFN_EQUAL;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
parses the content of Variable blendfunc,alphafunc
|
||||
it also make a hint for rendering as transparent or solid node.
|
||||
|
||||
we assume a typical quake scene would look like this..
|
||||
1) Big Static Mesh ( solid )
|
||||
2) static scene item ( may use transparency ) but rendered in the solid pass
|
||||
3) additional transparency item in the transparent pass
|
||||
|
||||
it's not 100% accurate! it just empirical..
|
||||
*/
|
||||
inline static void getBlendFunc ( const core::stringc &string, SBlendFunc &blendfunc )
|
||||
{
|
||||
if ( string.size() == 0 )
|
||||
return;
|
||||
|
||||
// maps to E_BLEND_FACTOR
|
||||
static const c8 * funclist[] =
|
||||
{
|
||||
"gl_zero",
|
||||
"gl_one",
|
||||
"gl_dst_color",
|
||||
"gl_one_minus_dst_color",
|
||||
"gl_src_color",
|
||||
"gl_one_minus_src_color",
|
||||
"gl_src_alpha",
|
||||
"gl_one_minus_src_alpha",
|
||||
"gl_dst_alpha",
|
||||
"gl_one_minus_dst_alpha",
|
||||
"gl_src_alpha_sat",
|
||||
|
||||
"add",
|
||||
"filter",
|
||||
"blend",
|
||||
|
||||
"ge128",
|
||||
"gt0",
|
||||
};
|
||||
|
||||
|
||||
u32 pos = 0;
|
||||
s32 srcFact = isEqual ( string, pos, funclist, 16 );
|
||||
|
||||
if ( srcFact < 0 )
|
||||
return;
|
||||
|
||||
u32 resolved = 0;
|
||||
s32 dstFact = isEqual ( string, pos, funclist, 16 );
|
||||
|
||||
switch ( srcFact )
|
||||
{
|
||||
case video::EBF_ZERO:
|
||||
switch ( dstFact )
|
||||
{
|
||||
// gl_zero gl_src_color == gl_dst_color gl_zero
|
||||
case video::EBF_SRC_COLOR:
|
||||
blendfunc.type = video::EMT_ONETEXTURE_BLEND;
|
||||
blendfunc.param0 = video::pack_textureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, blendfunc.modulate );
|
||||
blendfunc.isTransparent = 1;
|
||||
resolved = 1;
|
||||
break;
|
||||
} break;
|
||||
|
||||
case video::EBF_ONE:
|
||||
switch ( dstFact )
|
||||
{
|
||||
// gl_one gl_zero
|
||||
case video::EBF_ZERO:
|
||||
blendfunc.type = video::EMT_SOLID;
|
||||
blendfunc.isTransparent = 0;
|
||||
resolved = 1;
|
||||
break;
|
||||
|
||||
// gl_one gl_one
|
||||
case video::EBF_ONE:
|
||||
blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR;
|
||||
blendfunc.isTransparent = 1;
|
||||
resolved = 1;
|
||||
break;
|
||||
} break;
|
||||
|
||||
case video::EBF_SRC_ALPHA:
|
||||
switch ( dstFact )
|
||||
{
|
||||
// gl_src_alpha gl_one_minus_src_alpha
|
||||
case video::EBF_ONE_MINUS_SRC_ALPHA:
|
||||
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
|
||||
blendfunc.param0 = 1.f/255.f;
|
||||
blendfunc.isTransparent = 1;
|
||||
resolved = 1;
|
||||
break;
|
||||
} break;
|
||||
|
||||
case 11:
|
||||
// add
|
||||
blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR;
|
||||
blendfunc.isTransparent = 1;
|
||||
resolved = 1;
|
||||
break;
|
||||
case 12:
|
||||
// filter = gl_dst_color gl_zero or gl_zero gl_src_color
|
||||
blendfunc.type = video::EMT_ONETEXTURE_BLEND;
|
||||
blendfunc.param0 = video::pack_textureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, blendfunc.modulate );
|
||||
blendfunc.isTransparent = 1;
|
||||
resolved = 1;
|
||||
break;
|
||||
case 13:
|
||||
// blend = gl_src_alpha gl_one_minus_src_alpha
|
||||
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
|
||||
blendfunc.param0 = 1.f/255.f;
|
||||
blendfunc.isTransparent = 1;
|
||||
resolved = 1;
|
||||
break;
|
||||
case 14:
|
||||
// alphafunc ge128
|
||||
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
|
||||
blendfunc.param0 = 0.5f;
|
||||
blendfunc.isTransparent = 1;
|
||||
resolved = 1;
|
||||
break;
|
||||
case 15:
|
||||
// alphafunc gt0
|
||||
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
|
||||
blendfunc.param0 = 1.f / 255.f;
|
||||
blendfunc.isTransparent = 1;
|
||||
resolved = 1;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// use the generic blender
|
||||
if ( 0 == resolved )
|
||||
{
|
||||
blendfunc.type = video::EMT_ONETEXTURE_BLEND;
|
||||
blendfunc.param0 = video::pack_textureBlendFunc (
|
||||
(video::E_BLEND_FACTOR) srcFact,
|
||||
(video::E_BLEND_FACTOR) dstFact,
|
||||
blendfunc.modulate);
|
||||
|
||||
blendfunc.isTransparent = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// random noise [-1;1]
|
||||
struct Noiser
|
||||
{
|
||||
static f32 get ()
|
||||
{
|
||||
static u32 RandomSeed = 0x69666966;
|
||||
RandomSeed = (RandomSeed * 3631 + 1);
|
||||
|
||||
f32 value = ( (f32) (RandomSeed & 0x7FFF ) * (1.0f / (f32)(0x7FFF >> 1) ) ) - 1.f;
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
enum eQ3ModifierFunction
|
||||
{
|
||||
TCMOD = 0,
|
||||
DEFORMVERTEXES = 1,
|
||||
RGBGEN = 2,
|
||||
TCGEN = 3,
|
||||
MAP = 4,
|
||||
ALPHAGEN = 5,
|
||||
|
||||
FUNCTION2 = 0x10,
|
||||
SCROLL = FUNCTION2 + 1,
|
||||
SCALE = FUNCTION2 + 2,
|
||||
ROTATE = FUNCTION2 + 3,
|
||||
STRETCH = FUNCTION2 + 4,
|
||||
TURBULENCE = FUNCTION2 + 5,
|
||||
WAVE = FUNCTION2 + 6,
|
||||
|
||||
IDENTITY = FUNCTION2 + 7,
|
||||
VERTEX = FUNCTION2 + 8,
|
||||
TEXTURE = FUNCTION2 + 9,
|
||||
LIGHTMAP = FUNCTION2 + 10,
|
||||
ENVIRONMENT = FUNCTION2 + 11,
|
||||
DOLLAR_LIGHTMAP = FUNCTION2 + 12,
|
||||
BULGE = FUNCTION2 + 13,
|
||||
AUTOSPRITE = FUNCTION2 + 14,
|
||||
AUTOSPRITE2 = FUNCTION2 + 15,
|
||||
TRANSFORM = FUNCTION2 + 16,
|
||||
EXACTVERTEX = FUNCTION2 + 17,
|
||||
CONSTANT = FUNCTION2 + 18,
|
||||
LIGHTINGSPECULAR = FUNCTION2 + 19,
|
||||
MOVE = FUNCTION2 + 20,
|
||||
NORMAL = FUNCTION2 + 21,
|
||||
IDENTITYLIGHTING = FUNCTION2 + 22,
|
||||
|
||||
WAVE_MODIFIER_FUNCTION = 0x30,
|
||||
SINUS = WAVE_MODIFIER_FUNCTION + 1,
|
||||
COSINUS = WAVE_MODIFIER_FUNCTION + 2,
|
||||
SQUARE = WAVE_MODIFIER_FUNCTION + 3,
|
||||
TRIANGLE = WAVE_MODIFIER_FUNCTION + 4,
|
||||
SAWTOOTH = WAVE_MODIFIER_FUNCTION + 5,
|
||||
SAWTOOTH_INVERSE = WAVE_MODIFIER_FUNCTION + 6,
|
||||
NOISE = WAVE_MODIFIER_FUNCTION + 7,
|
||||
|
||||
UNKNOWN = -2
|
||||
};
|
||||
|
||||
struct SModifierFunction
|
||||
{
|
||||
SModifierFunction ()
|
||||
: masterfunc0 ( UNKNOWN ), masterfunc1( UNKNOWN ), func ( SINUS ),
|
||||
tcgen( TEXTURE ), rgbgen ( IDENTITY ), alphagen ( UNKNOWN ),
|
||||
base ( 0 ), amp ( 1 ), phase ( 0 ), frequency ( 1 ),
|
||||
wave ( 1 ),
|
||||
x ( 0 ), y ( 0 ), z( 0 ), count( 0 ) {}
|
||||
|
||||
// "tcmod","deformvertexes","rgbgen", "tcgen"
|
||||
eQ3ModifierFunction masterfunc0;
|
||||
// depends
|
||||
eQ3ModifierFunction masterfunc1;
|
||||
// depends
|
||||
eQ3ModifierFunction func;
|
||||
|
||||
eQ3ModifierFunction tcgen;
|
||||
eQ3ModifierFunction rgbgen;
|
||||
eQ3ModifierFunction alphagen;
|
||||
|
||||
union
|
||||
{
|
||||
f32 base;
|
||||
f32 bulgewidth;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
f32 amp;
|
||||
f32 bulgeheight;
|
||||
};
|
||||
|
||||
f32 phase;
|
||||
|
||||
union
|
||||
{
|
||||
f32 frequency;
|
||||
f32 bulgespeed;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
f32 wave;
|
||||
f32 div;
|
||||
};
|
||||
|
||||
f32 x;
|
||||
f32 y;
|
||||
f32 z;
|
||||
u32 count;
|
||||
|
||||
f32 evaluate ( f32 dt ) const
|
||||
{
|
||||
// phase in 0 and 1..
|
||||
f32 x = core::fract( (dt + phase ) * frequency );
|
||||
f32 y = 0.f;
|
||||
|
||||
switch ( func )
|
||||
{
|
||||
case SINUS:
|
||||
y = sinf ( x * core::PI * 2.f );
|
||||
break;
|
||||
case COSINUS:
|
||||
y = cosf ( x * core::PI * 2.f );
|
||||
break;
|
||||
case SQUARE:
|
||||
y = x < 0.5f ? 1.f : -1.f;
|
||||
break;
|
||||
case TRIANGLE:
|
||||
y = x < 0.5f ? ( 4.f * x ) - 1.f : ( -4.f * x ) + 3.f;
|
||||
break;
|
||||
case SAWTOOTH:
|
||||
y = x;
|
||||
break;
|
||||
case SAWTOOTH_INVERSE:
|
||||
y = 1.f - x;
|
||||
break;
|
||||
case NOISE:
|
||||
y = Noiser::get();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return base + ( y * amp );
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
inline core::vector3df getMD3Normal ( u32 i, u32 j )
|
||||
{
|
||||
const f32 lng = i * 2.0f * core::PI / 255.0f;
|
||||
const f32 lat = j * 2.0f * core::PI / 255.0f;
|
||||
return core::vector3df(cosf ( lat ) * sinf ( lng ),
|
||||
sinf ( lat ) * sinf ( lng ),
|
||||
cosf ( lng ));
|
||||
}
|
||||
|
||||
//
|
||||
inline void getModifierFunc ( SModifierFunction& fill, const core::stringc &string, u32 &pos )
|
||||
{
|
||||
if ( string.size() == 0 )
|
||||
return;
|
||||
|
||||
static const c8 * funclist[] =
|
||||
{
|
||||
"sin","cos","square",
|
||||
"triangle", "sawtooth","inversesawtooth", "noise"
|
||||
};
|
||||
|
||||
fill.func = (eQ3ModifierFunction) isEqual ( string,pos, funclist,7 );
|
||||
fill.func = fill.func == UNKNOWN ? SINUS : (eQ3ModifierFunction) ((u32) fill.func + WAVE_MODIFIER_FUNCTION + 1);
|
||||
|
||||
fill.base = getAsFloat ( string, pos );
|
||||
fill.amp = getAsFloat ( string, pos );
|
||||
fill.phase = getAsFloat ( string, pos );
|
||||
fill.frequency = getAsFloat ( string, pos );
|
||||
}
|
||||
|
||||
|
||||
// name = "a b c .."
|
||||
struct SVariable
|
||||
{
|
||||
core::stringc name;
|
||||
core::stringc content;
|
||||
|
||||
SVariable ( const c8 * n, const c8 *c = 0 ) : name ( n ), content (c) {}
|
||||
virtual ~SVariable () {}
|
||||
|
||||
void clear ()
|
||||
{
|
||||
name = "";
|
||||
content = "";
|
||||
}
|
||||
|
||||
s32 isValid () const
|
||||
{
|
||||
return name.size();
|
||||
}
|
||||
|
||||
bool operator == ( const SVariable &other ) const
|
||||
{
|
||||
return 0 == strcmp ( name.c_str(), other.name.c_str () );
|
||||
}
|
||||
|
||||
bool operator < ( const SVariable &other ) const
|
||||
{
|
||||
return 0 > strcmp ( name.c_str(), other.name.c_str () );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// string database. "a" = "Hello", "b" = "1234.6"
|
||||
struct SVarGroup
|
||||
{
|
||||
SVarGroup () { Variable.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE ); }
|
||||
virtual ~SVarGroup () {}
|
||||
|
||||
u32 isDefined ( const c8 * name, const c8 * content = 0 ) const
|
||||
{
|
||||
for ( u32 i = 0; i != Variable.size (); ++i )
|
||||
{
|
||||
if ( 0 == strcmp ( Variable[i].name.c_str(), name ) &&
|
||||
( 0 == content || strstr ( Variable[i].content.c_str(), content ) )
|
||||
)
|
||||
{
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// searches for Variable name and returns is content
|
||||
// if Variable is not found a reference to an Empty String is returned
|
||||
const core::stringc &get( const c8 * name ) const
|
||||
{
|
||||
SVariable search ( name );
|
||||
s32 index = Variable.linear_search ( search );
|
||||
if ( index < 0 )
|
||||
return irrEmptyStringc;
|
||||
|
||||
return Variable [ index ].content;
|
||||
}
|
||||
|
||||
// set the Variable name
|
||||
void set ( const c8 * name, const c8 * content = 0 )
|
||||
{
|
||||
u32 index = isDefined ( name, 0 );
|
||||
if ( 0 == index )
|
||||
{
|
||||
Variable.push_back ( SVariable ( name, content ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
Variable [ index ].content = content;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
core::array < SVariable > Variable;
|
||||
};
|
||||
|
||||
//! holding a group a variable
|
||||
struct SVarGroupList: public IReferenceCounted
|
||||
{
|
||||
SVarGroupList ()
|
||||
{
|
||||
VariableGroup.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE );
|
||||
}
|
||||
virtual ~SVarGroupList () {}
|
||||
|
||||
core::array < SVarGroup > VariableGroup;
|
||||
};
|
||||
|
||||
|
||||
//! A Parsed Shader Holding Variables ordered in Groups
|
||||
struct IShader
|
||||
{
|
||||
IShader ()
|
||||
: ID ( 0 ), VarGroup ( 0 ) {}
|
||||
virtual ~IShader () {}
|
||||
|
||||
bool operator == (const IShader &other ) const
|
||||
{
|
||||
return 0 == strcmp ( name.c_str(), other.name.c_str () );
|
||||
//return name == other.name;
|
||||
}
|
||||
|
||||
bool operator < (const IShader &other ) const
|
||||
{
|
||||
return strcmp ( name.c_str(), other.name.c_str () ) < 0;
|
||||
//return name < other.name;
|
||||
}
|
||||
|
||||
u32 getGroupSize () const
|
||||
{
|
||||
if ( 0 == VarGroup )
|
||||
return 0;
|
||||
return VarGroup->VariableGroup.size ();
|
||||
}
|
||||
|
||||
const SVarGroup * getGroup ( u32 stage ) const
|
||||
{
|
||||
if ( 0 == VarGroup || stage >= VarGroup->VariableGroup.size () )
|
||||
return 0;
|
||||
|
||||
return &VarGroup->VariableGroup [ stage ];
|
||||
}
|
||||
|
||||
// id
|
||||
s32 ID;
|
||||
SVarGroupList *VarGroup; // reference
|
||||
|
||||
// Shader: shader name ( also first variable in first Vargroup )
|
||||
// Entity: classname ( variable in Group(1) )
|
||||
core::stringc name;
|
||||
};
|
||||
|
||||
typedef IShader IEntity;
|
||||
|
||||
typedef core::array < IEntity > tQ3EntityList;
|
||||
|
||||
/*
|
||||
dump shader like original layout, regardless of internal data holding
|
||||
no recursive folding..
|
||||
*/
|
||||
inline void dumpVarGroup ( core::stringc &dest, const SVarGroup * group, s32 stack )
|
||||
{
|
||||
core::stringc buf;
|
||||
|
||||
if ( stack > 0 )
|
||||
{
|
||||
buf = "";
|
||||
for (s32 i = 0; i < stack - 1; ++i )
|
||||
buf += '\t';
|
||||
|
||||
buf += "{\n";
|
||||
dest.append ( buf );
|
||||
}
|
||||
|
||||
for ( u32 g = 0; g != group->Variable.size(); ++g )
|
||||
{
|
||||
buf = "";
|
||||
for (s32 i = 0; i < stack; ++i )
|
||||
buf += '\t';
|
||||
|
||||
buf += group->Variable[g].name;
|
||||
buf += " ";
|
||||
buf += group->Variable[g].content;
|
||||
buf += "\n";
|
||||
dest.append ( buf );
|
||||
}
|
||||
|
||||
if ( stack > 1 )
|
||||
{
|
||||
buf = "";
|
||||
for (s32 i = 0; i < stack - 1; ++i )
|
||||
buf += '\t';
|
||||
|
||||
buf += "}\n";
|
||||
dest.append ( buf );
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
dump a Shader or an Entity
|
||||
*/
|
||||
inline core::stringc & dumpShader ( core::stringc &dest, const IShader * shader, bool entity = false )
|
||||
{
|
||||
if ( 0 == shader )
|
||||
return dest;
|
||||
|
||||
const u32 size = shader->VarGroup->VariableGroup.size ();
|
||||
for ( u32 i = 0; i != size; ++i )
|
||||
{
|
||||
const SVarGroup * group = &shader->VarGroup->VariableGroup[ i ];
|
||||
dumpVarGroup ( dest, group, core::clamp( (int)i, 0, 2 ) );
|
||||
}
|
||||
|
||||
if ( !entity )
|
||||
{
|
||||
if ( size <= 1 )
|
||||
{
|
||||
dest.append ( "{\n" );
|
||||
}
|
||||
dest.append ( "}\n" );
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
quake3 doesn't care much about tga & jpg
|
||||
load one or multiple files stored in name started at startPos to the texture array textures
|
||||
if texture is not loaded 0 will be added ( to find missing textures easier)
|
||||
*/
|
||||
inline void getTextures(tTexArray &textures,
|
||||
const core::stringc &name, u32 &startPos,
|
||||
const io::IFileSystem *fileSystem,
|
||||
video::IVideoDriver* driver)
|
||||
{
|
||||
static const char * const extension[] =
|
||||
{
|
||||
".jpg",
|
||||
".jpeg",
|
||||
".png",
|
||||
".dds",
|
||||
".tga",
|
||||
".bmp",
|
||||
".pcx"
|
||||
};
|
||||
|
||||
tStringList stringList;
|
||||
getAsStringList(stringList, -1, name, startPos);
|
||||
|
||||
textures.clear();
|
||||
|
||||
io::path loadFile;
|
||||
for ( u32 i = 0; i!= stringList.size (); ++i )
|
||||
{
|
||||
video::ITexture* texture = 0;
|
||||
for (u32 g = 0; g != 7; ++g)
|
||||
{
|
||||
core::cutFilenameExtension ( loadFile, stringList[i] );
|
||||
|
||||
if ( loadFile == "$whiteimage" )
|
||||
{
|
||||
texture = driver->getTexture( "$whiteimage" );
|
||||
if ( 0 == texture )
|
||||
{
|
||||
core::dimension2du s ( 2, 2 );
|
||||
u32 image[4] = { 0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF };
|
||||
video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
|
||||
texture = driver->addTexture( "$whiteimage", w );
|
||||
w->drop ();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
if ( loadFile == "$redimage" )
|
||||
{
|
||||
texture = driver->getTexture( "$redimage" );
|
||||
if ( 0 == texture )
|
||||
{
|
||||
core::dimension2du s ( 2, 2 );
|
||||
u32 image[4] = { 0xFFFF0000, 0xFFFF0000,0xFFFF0000,0xFFFF0000 };
|
||||
video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
|
||||
texture = driver->addTexture( "$redimage", w );
|
||||
w->drop ();
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( loadFile == "$blueimage" )
|
||||
{
|
||||
texture = driver->getTexture( "$blueimage" );
|
||||
if ( 0 == texture )
|
||||
{
|
||||
core::dimension2du s ( 2, 2 );
|
||||
u32 image[4] = { 0xFF0000FF, 0xFF0000FF,0xFF0000FF,0xFF0000FF };
|
||||
video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
|
||||
texture = driver->addTexture( "$blueimage", w );
|
||||
w->drop ();
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( loadFile == "$checkerimage" )
|
||||
{
|
||||
texture = driver->getTexture( "$checkerimage" );
|
||||
if ( 0 == texture )
|
||||
{
|
||||
core::dimension2du s ( 2, 2 );
|
||||
u32 image[4] = { 0xFFFFFFFF, 0xFF000000,0xFF000000,0xFFFFFFFF };
|
||||
video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
|
||||
texture = driver->addTexture( "$checkerimage", w );
|
||||
w->drop ();
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( loadFile == "$lightmap" )
|
||||
{
|
||||
texture = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadFile.append ( extension[g] );
|
||||
}
|
||||
|
||||
texture = driver->findTexture( loadFile );
|
||||
if ( texture )
|
||||
break;
|
||||
|
||||
if ( fileSystem->existFile ( loadFile ) )
|
||||
{
|
||||
texture = driver->getTexture( loadFile );
|
||||
if ( texture )
|
||||
break;
|
||||
texture = 0;
|
||||
}
|
||||
}
|
||||
// take 0 Texture
|
||||
textures.push_back(texture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//! Manages various Quake3 Shader Styles
|
||||
class IShaderManager : public IReferenceCounted
|
||||
{
|
||||
};
|
||||
|
||||
} // end namespace quake3
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -1,284 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_SCENE_COLLISION_MANAGER_H_INCLUDED__
|
||||
#define __I_SCENE_COLLISION_MANAGER_H_INCLUDED__
|
||||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "vector3d.h"
|
||||
#include "triangle3d.h"
|
||||
#include "position2d.h"
|
||||
#include "line3d.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace scene
|
||||
{
|
||||
class ISceneNode;
|
||||
class ICameraSceneNode;
|
||||
class ITriangleSelector;
|
||||
class IMeshBuffer;
|
||||
|
||||
struct SCollisionHit
|
||||
{
|
||||
//! Point of collision
|
||||
core::vector3df Intersection;
|
||||
|
||||
//! Triangle with which we collided
|
||||
core::triangle3df Triangle;
|
||||
|
||||
//! Triangle selector which contained the colliding triangle (useful when having MetaTriangleSelector)
|
||||
ITriangleSelector* TriangleSelector;
|
||||
|
||||
//! Node which contained the triangle (is 0 when selector doesn't have that information)
|
||||
ISceneNode* Node;
|
||||
|
||||
//! Meshbuffer which contained the triangle (is 0 when the selector doesn't have that information, only works when selectors are created per meshbuffer)
|
||||
const IMeshBuffer* MeshBuffer;
|
||||
|
||||
//! Index of selected material of the triangle in the SceneNode. Usually only valid when MeshBuffer is also set, otherwise always 0
|
||||
irr::u32 MaterialIndex;
|
||||
|
||||
SCollisionHit() : TriangleSelector(0), Node(0), MeshBuffer(0), MaterialIndex(0)
|
||||
{}
|
||||
};
|
||||
|
||||
//! The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes.
|
||||
class ISceneCollisionManager : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Finds the nearest collision point of a line and lots of triangles, if there is one.
|
||||
/** \param hitResult: Contains collision result when there was a collision detected.
|
||||
\param ray: Line with which collisions are tested.
|
||||
\param selector: TriangleSelector to be used for the collision check.
|
||||
\return true if a collision was detected and false if not. */
|
||||
virtual bool getCollisionPoint(SCollisionHit& hitResult, const core::line3d<f32>& ray,
|
||||
ITriangleSelector* selector) = 0;
|
||||
|
||||
//! Finds the nearest collision point of a line and lots of triangles, if there is one.
|
||||
/** \param ray: Line with which collisions are tested.
|
||||
\param selector: TriangleSelector containing the triangles. It
|
||||
can be created for example using
|
||||
ISceneManager::createTriangleSelector() or
|
||||
ISceneManager::createTriangleOctreeSelector().
|
||||
\param outCollisionPoint: If a collision is detected, this will
|
||||
contain the position of the nearest collision to the line-start.
|
||||
\param outTriangle: If a collision is detected, this will
|
||||
contain the triangle with which the ray collided.
|
||||
\param outNode: If a collision is detected, this will contain
|
||||
the scene node associated with the triangle that was hit.
|
||||
\return True if a collision was detected and false if not. */
|
||||
virtual bool getCollisionPoint(const core::line3d<f32>& ray,
|
||||
ITriangleSelector* selector, core::vector3df& outCollisionPoint,
|
||||
core::triangle3df& outTriangle, ISceneNode*& outNode)
|
||||
{
|
||||
SCollisionHit hitResult;
|
||||
if ( getCollisionPoint(hitResult, ray, selector) )
|
||||
{
|
||||
outCollisionPoint = hitResult.Intersection;
|
||||
outTriangle = hitResult.Triangle;
|
||||
outNode = hitResult.Node;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//! Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid.
|
||||
/** This can be used for moving a character in a 3d world: The
|
||||
character will slide at walls and is able to walk up stairs.
|
||||
The method used how to calculate the collision result position
|
||||
is based on the paper "Improved Collision detection and
|
||||
Response" by Kasper Fauerby.
|
||||
\param selector: TriangleSelector containing the triangles of
|
||||
the world. It can be created for example using
|
||||
ISceneManager::createTriangleSelector() or
|
||||
ISceneManager::createTriangleOctreeSelector().
|
||||
\param ellipsoidPosition: Position of the ellipsoid.
|
||||
\param ellipsoidRadius: Radius of the ellipsoid.
|
||||
\param ellipsoidDirectionAndSpeed: Direction and speed of the
|
||||
movement of the ellipsoid.
|
||||
\param triout: Optional parameter where the last triangle
|
||||
causing a collision is stored, if there is a collision.
|
||||
\param hitPosition: Return value for the position of the collision
|
||||
\param outFalling: Is set to true if the ellipsoid is falling
|
||||
down, caused by gravity.
|
||||
\param outNode: the node with which the ellipsoid collided (if any)
|
||||
\param slidingSpeed: DOCUMENTATION NEEDED.
|
||||
\param gravityDirectionAndSpeed: Direction and force of gravity.
|
||||
\return New position of the ellipsoid. */
|
||||
virtual core::vector3df getCollisionResultPosition(
|
||||
ITriangleSelector* selector,
|
||||
const core::vector3df &ellipsoidPosition,
|
||||
const core::vector3df& ellipsoidRadius,
|
||||
const core::vector3df& ellipsoidDirectionAndSpeed,
|
||||
core::triangle3df& triout,
|
||||
core::vector3df& hitPosition,
|
||||
bool& outFalling,
|
||||
ISceneNode*& outNode,
|
||||
f32 slidingSpeed = 0.0005f,
|
||||
const core::vector3df& gravityDirectionAndSpeed
|
||||
= core::vector3df(0.0f, 0.0f, 0.0f)) = 0;
|
||||
|
||||
//! Returns a 3d ray which would go through the 2d screen coordinates.
|
||||
/** \param pos: Screen coordinates in pixels.
|
||||
\param camera: Camera from which the ray starts. If null, the
|
||||
active camera is used.
|
||||
\return Ray starting from the position of the camera and ending
|
||||
at a length of the far value of the camera at a position which
|
||||
would be behind the 2d screen coordinates. */
|
||||
virtual core::line3d<f32> getRayFromScreenCoordinates(
|
||||
const core::position2d<s32>& pos, const ICameraSceneNode* camera = 0) = 0;
|
||||
|
||||
//! Calculates 2d screen position from a 3d position.
|
||||
/** \param pos: 3D position in world space to be transformed
|
||||
into 2d.
|
||||
\param camera: Camera to be used. If null, the currently active
|
||||
camera is used.
|
||||
\param useViewPort: Calculate screen coordinates relative to
|
||||
the current view port. Please note that unless the driver does
|
||||
not take care of the view port, it is usually best to get the
|
||||
result in absolute screen coordinates (flag=false).
|
||||
\return 2d screen coordinates which a object in the 3d world
|
||||
would have if it would be rendered to the screen. If the 3d
|
||||
position is behind the camera, it is set to (-1000,-1000). In
|
||||
most cases you can ignore this fact, because if you use this
|
||||
method for drawing a decorator over a 3d object, it will be
|
||||
clipped by the screen borders. */
|
||||
virtual core::position2d<s32> getScreenCoordinatesFrom3DPosition(
|
||||
const core::vector3df& pos, const ICameraSceneNode* camera=0, bool useViewPort=false) = 0;
|
||||
|
||||
//! Gets the scene node, which is currently visible under the given screen coordinates, viewed from the currently active camera.
|
||||
/** The collision tests are done using a bounding box for each
|
||||
scene node. You can limit the recursive search so just all children of the specified root are tested.
|
||||
\param pos: Position in pixel screen coordinates, under which
|
||||
the returned scene node will be.
|
||||
\param idBitMask: Only scene nodes with an id with bits set
|
||||
like in this mask will be tested. If the BitMask is 0, this
|
||||
feature is disabled.
|
||||
Please note that the default node id of -1 will match with
|
||||
every bitmask != 0
|
||||
\param bNoDebugObjects: Doesn't take debug objects into account
|
||||
when true. These are scene nodes with IsDebugObject() = true.
|
||||
\param root If different from 0, the search is limited to the children of this node.
|
||||
\return Visible scene node under screen coordinates with
|
||||
matching bits in its id. If there is no scene node under this
|
||||
position, 0 is returned. */
|
||||
virtual ISceneNode* getSceneNodeFromScreenCoordinatesBB(const core::position2d<s32>& pos,
|
||||
s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode* root=0) =0;
|
||||
|
||||
//! Returns the nearest scene node which collides with a 3d ray and whose id matches a bitmask.
|
||||
/** The collision tests are done using a bounding box for each
|
||||
scene node. The recursive search can be limited be specifying a scene node.
|
||||
\param ray Line with which collisions are tested.
|
||||
\param idBitMask Only scene nodes with an id which matches at
|
||||
least one of the bits contained in this mask will be tested.
|
||||
However, if this parameter is 0, then all nodes are checked.
|
||||
\param bNoDebugObjects: Doesn't take debug objects into account when true. These
|
||||
are scene nodes with IsDebugObject() = true.
|
||||
\param root If different from 0, the search is limited to the children of this node.
|
||||
\return Scene node nearest to ray.start, which collides with
|
||||
the ray and matches the idBitMask, if the mask is not null. If
|
||||
no scene node is found, 0 is returned. */
|
||||
virtual ISceneNode* getSceneNodeFromRayBB(const core::line3d<f32>& ray,
|
||||
s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode* root=0) =0;
|
||||
|
||||
//! Get the scene node, which the given camera is looking at and whose id matches the bitmask.
|
||||
/** A ray is simply cast from the position of the camera to
|
||||
the view target position, and all scene nodes are tested
|
||||
against this ray. The collision tests are done using a bounding
|
||||
box for each scene node.
|
||||
\param camera: Camera from which the ray is cast.
|
||||
\param idBitMask: Only scene nodes with an id which matches at least one of the
|
||||
bits contained in this mask will be tested. However, if this parameter is 0, then
|
||||
all nodes are checked.
|
||||
feature is disabled.
|
||||
Please note that the default node id of -1 will match with
|
||||
every bitmask != 0
|
||||
\param bNoDebugObjects: Doesn't take debug objects into account
|
||||
when true. These are scene nodes with IsDebugObject() = true.
|
||||
\return Scene node nearest to the camera, which collides with
|
||||
the ray and matches the idBitMask, if the mask is not null. If
|
||||
no scene node is found, 0 is returned. */
|
||||
virtual ISceneNode* getSceneNodeFromCameraBB(const ICameraSceneNode* camera,
|
||||
s32 idBitMask=0, bool bNoDebugObjects = false) = 0;
|
||||
|
||||
|
||||
//! Perform a ray/box and ray/triangle collision check on a hierarchy of scene nodes.
|
||||
/** This checks all scene nodes under the specified one, first by ray/bounding
|
||||
box, and then by accurate ray/triangle collision, finding the nearest collision,
|
||||
and the scene node containing it. It returns the node hit, and (via output
|
||||
parameters) the position of the collision, and the triangle that was hit.
|
||||
|
||||
All scene nodes in the hierarchy tree under the specified node are checked. Only
|
||||
nodes that are visible, with an ID that matches at least one bit in the supplied
|
||||
bitmask, and which have a triangle selector are considered as candidates for being hit.
|
||||
You do not have to build a meta triangle selector; the individual triangle selectors
|
||||
of each candidate scene node are used automatically.
|
||||
|
||||
\param ray: Line with which collisions are tested.
|
||||
\param outCollisionPoint: If a collision is detected, this will contain the
|
||||
position of the nearest collision.
|
||||
\param outTriangle: If a collision is detected, this will contain the triangle
|
||||
with which the ray collided.
|
||||
\param idBitMask: Only scene nodes with an id which matches at least one of the
|
||||
bits contained in this mask will be tested. However, if this parameter is 0, then
|
||||
all nodes are checked.
|
||||
\param collisionRootNode: the scene node at which to begin checking. Only this
|
||||
node and its children will be checked. If you want to check the entire scene,
|
||||
pass 0, and the root scene node will be used (this is the default).
|
||||
\param noDebugObjects: when true, debug objects are not considered viable targets.
|
||||
Debug objects are scene nodes with IsDebugObject() = true.
|
||||
\return Returns the scene node containing the hit triangle nearest to ray.start.
|
||||
If no collision is detected, then 0 is returned. */
|
||||
virtual ISceneNode* getSceneNodeAndCollisionPointFromRay(
|
||||
SCollisionHit& hitResult,
|
||||
const core::line3df& ray,
|
||||
s32 idBitMask = 0,
|
||||
ISceneNode * collisionRootNode = 0,
|
||||
bool noDebugObjects = false) = 0;
|
||||
|
||||
//! Perform a ray/box and ray/triangle collision check on a hierarchy of scene nodes.
|
||||
/** Works same as other getSceneNodeAndCollisionPointFromRay but returns less information.
|
||||
(was written before the other getSceneNodeAndCollisionPointFromRay implementation).
|
||||
\param ray: Line with which collisions are tested.
|
||||
\param outCollisionPoint: If a collision is detected, this will contain the
|
||||
position of the nearest collision.
|
||||
\param outTriangle: If a collision is detected, this will contain the triangle
|
||||
with which the ray collided.
|
||||
\param idBitMask: Only scene nodes with an id which matches at least one of the
|
||||
bits contained in this mask will be tested. However, if this parameter is 0, then
|
||||
all nodes are checked.
|
||||
\param collisionRootNode: the scene node at which to begin checking. Only this
|
||||
node and its children will be checked. If you want to check the entire scene,
|
||||
pass 0, and the root scene node will be used (this is the default).
|
||||
\param noDebugObjects: when true, debug objects are not considered viable targets.
|
||||
Debug objects are scene nodes with IsDebugObject() = true.
|
||||
\return Returns the scene node containing the hit triangle nearest to ray.start.
|
||||
If no collision is detected, then 0 is returned. */
|
||||
virtual ISceneNode* getSceneNodeAndCollisionPointFromRay(
|
||||
const core::line3df& ray,
|
||||
core::vector3df& outCollisionPoint,
|
||||
core::triangle3df& outTriangle,
|
||||
s32 idBitMask = 0,
|
||||
ISceneNode * collisionRootNode = 0,
|
||||
bool noDebugObjects = false)
|
||||
{
|
||||
SCollisionHit hitResult;
|
||||
ISceneNode* node = getSceneNodeAndCollisionPointFromRay(hitResult, ray, idBitMask, collisionRootNode, noDebugObjects);
|
||||
if ( node )
|
||||
{
|
||||
outCollisionPoint = hitResult.Intersection;
|
||||
outTriangle = hitResult.Triangle;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
@ -14,10 +14,8 @@
|
||||
#include "SColor.h"
|
||||
#include "ETerrainElements.h"
|
||||
#include "ESceneNodeTypes.h"
|
||||
#include "ESceneNodeAnimatorTypes.h"
|
||||
#include "EMeshWriterEnums.h"
|
||||
#include "SceneParameters.h"
|
||||
#include "IGeometryCreator.h"
|
||||
#include "ISkinnedMesh.h"
|
||||
|
||||
namespace irr
|
||||
@ -103,11 +101,8 @@ namespace scene
|
||||
class IAnimatedMesh;
|
||||
class IAnimatedMeshSceneNode;
|
||||
class IBillboardSceneNode;
|
||||
class IBillboardTextSceneNode;
|
||||
class ICameraSceneNode;
|
||||
class IDummyTransformationSceneNode;
|
||||
class ILightManager;
|
||||
class ILightSceneNode;
|
||||
class IMesh;
|
||||
class IMeshBuffer;
|
||||
class IMeshCache;
|
||||
@ -115,35 +110,13 @@ namespace scene
|
||||
class IMeshManipulator;
|
||||
class IMeshSceneNode;
|
||||
class IMeshWriter;
|
||||
class IMetaTriangleSelector;
|
||||
class IOctreeSceneNode;
|
||||
class IParticleSystemSceneNode;
|
||||
class ISceneCollisionManager;
|
||||
class ISceneLoader;
|
||||
class ISceneNode;
|
||||
class ISceneNodeAnimator;
|
||||
class ISceneNodeAnimatorCollisionResponse;
|
||||
class ISceneNodeAnimatorFactory;
|
||||
class ISceneNodeFactory;
|
||||
class ISceneUserDataSerializer;
|
||||
class IShadowVolumeSceneNode;
|
||||
class ITerrainSceneNode;
|
||||
class ITextSceneNode;
|
||||
class ITriangleSelector;
|
||||
class IVolumeLightSceneNode;
|
||||
|
||||
namespace quake3
|
||||
{
|
||||
struct IShader;
|
||||
} // end namespace quake3
|
||||
|
||||
//! The Scene Manager manages scene nodes, mesh resources, cameras and all the other stuff.
|
||||
/** All Scene nodes can be created only here. There is a always growing
|
||||
list of scene nodes for lots of purposes: Indoor rendering scene nodes
|
||||
like the Octree (addOctreeSceneNode()) or the terrain renderer
|
||||
(addTerrainSceneNode()), different Camera scene nodes
|
||||
(addCameraSceneNode(), addCameraSceneNodeMaya()), scene nodes for Light
|
||||
(addLightSceneNode()), Billboards (addBillboardSceneNode()) and so on.
|
||||
/** All Scene nodes can be created only here.
|
||||
A scene node is a node in the hierarchical scene graph. Every scene node
|
||||
may have children, which are other scene nodes. Children move relative
|
||||
the their parents position. If the parent of a node is not visible, its
|
||||
@ -384,65 +357,6 @@ namespace scene
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual io::IFileSystem* getFileSystem() = 0;
|
||||
|
||||
//! adds Volume Lighting Scene Node.
|
||||
/** Example Usage:
|
||||
scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(0, -1,
|
||||
32, 32, //Subdivide U/V
|
||||
video::SColor(0, 180, 180, 180), //foot color
|
||||
video::SColor(0, 0, 0, 0) //tail color
|
||||
);
|
||||
if (n)
|
||||
{
|
||||
n->setScale(core::vector3df(46.0f, 45.0f, 46.0f));
|
||||
n->getMaterial(0).setTexture(0, smgr->getVideoDriver()->getTexture("lightFalloff.png"));
|
||||
}
|
||||
\return Pointer to the volumeLight if successful, otherwise NULL.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1,
|
||||
const u32 subdivU = 32, const u32 subdivV = 32,
|
||||
const video::SColor foot = video::SColor(51, 0, 230, 180),
|
||||
const video::SColor tail = video::SColor(0, 0, 0, 0),
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
|
||||
|
||||
//! Adds a cube scene node
|
||||
/** \param size: Size of the cube, uniformly in each dimension.
|
||||
\param parent: Parent of the scene node. Can be 0 if no parent.
|
||||
\param id: Id of the node. This id can be used to identify the scene node.
|
||||
\param position: Position of the space relative to its parent
|
||||
where the scene node will be placed.
|
||||
\param rotation: Initial rotation of the scene node.
|
||||
\param scale: Initial scale of the scene node.
|
||||
\return Pointer to the created test scene node. This
|
||||
pointer should not be dropped. See IReferenceCounted::drop()
|
||||
for more information. */
|
||||
virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
|
||||
|
||||
//! Adds a sphere scene node of the given radius and detail
|
||||
/** \param radius: Radius of the sphere.
|
||||
\param polyCount: The number of vertices in horizontal and
|
||||
vertical direction. The total polyCount of the sphere is
|
||||
polyCount*polyCount. This parameter must be less than 256 to
|
||||
stay within the 16-bit limit of the indices of a meshbuffer.
|
||||
\param parent: Parent of the scene node. Can be 0 if no parent.
|
||||
\param id: Id of the node. This id can be used to identify the scene node.
|
||||
\param position: Position of the space relative to its parent
|
||||
where the scene node will be placed.
|
||||
\param rotation: Initial rotation of the scene node.
|
||||
\param scale: Initial scale of the scene node.
|
||||
\return Pointer to the created test scene node. This
|
||||
pointer should not be dropped. See IReferenceCounted::drop()
|
||||
for more information. */
|
||||
virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
|
||||
|
||||
//! Adds a scene node for rendering an animated mesh model.
|
||||
/** \param mesh: Pointer to the loaded animated mesh to be displayed.
|
||||
\param parent: Parent of the scene node. Can be NULL if no parent.
|
||||
@ -478,65 +392,10 @@ namespace scene
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
|
||||
bool alsoAddIfMeshPointerZero=false) = 0;
|
||||
|
||||
//! Adds a scene node for rendering a animated water surface mesh.
|
||||
/** Looks really good when the Material type EMT_TRANSPARENT_REFLECTION
|
||||
is used.
|
||||
\param waveHeight: Height of the water waves.
|
||||
\param waveSpeed: Speed of the water waves.
|
||||
\param waveLength: Length of a water wave.
|
||||
\param mesh: Pointer to the loaded static mesh to be displayed with water waves on it.
|
||||
\param parent: Parent of the scene node. Can be NULL if no parent.
|
||||
\param id: Id of the node. This id can be used to identify the scene node.
|
||||
\param position: Position of the space relative to its parent where the
|
||||
scene node will be placed.
|
||||
\param rotation: Initial rotation of the scene node.
|
||||
\param scale: Initial scale of the scene node.
|
||||
\return Pointer to the created scene node.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNode* addWaterSurfaceSceneNode(IMesh* mesh,
|
||||
f32 waveHeight=2.0f, f32 waveSpeed=300.0f, f32 waveLength=10.0f,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
|
||||
|
||||
|
||||
//! Adds a scene node for rendering using a octree to the scene graph.
|
||||
/** This a good method for rendering
|
||||
scenes with lots of geometry. The octree is built on the fly from the mesh.
|
||||
\param mesh: The mesh containing all geometry from which the octree will be build.
|
||||
If this animated mesh has more than one frames in it, the first frame is taken.
|
||||
\param parent: Parent node of the octree node.
|
||||
\param id: id of the node. This id can be used to identify the node.
|
||||
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
|
||||
If a node gets less polys than this value it will not be split into
|
||||
smaller nodes.
|
||||
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
|
||||
\return Pointer to the octree if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IOctreeSceneNode* addOctreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0,
|
||||
s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) = 0;
|
||||
|
||||
//! Adds a scene node for rendering using a octree to the scene graph.
|
||||
/** This a good method for rendering scenes with lots of
|
||||
geometry. The octree is built on the fly from the mesh, much
|
||||
faster then a bsp tree.
|
||||
\param mesh: The mesh containing all geometry from which the octree will be build.
|
||||
\param parent: Parent node of the octree node.
|
||||
\param id: id of the node. This id can be used to identify the node.
|
||||
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
|
||||
If a node gets less polys than this value it will not be split into
|
||||
smaller nodes.
|
||||
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
|
||||
\return Pointer to the octree if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IOctreeSceneNode* addOctreeSceneNode(IMesh* mesh, ISceneNode* parent=0,
|
||||
s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false) = 0;
|
||||
|
||||
//! Adds a camera scene node to the scene graph and sets it as active camera.
|
||||
/** This camera does not react on user input like for example the one created with
|
||||
addCameraSceneNodeFPS(). If you want to move or animate it, use animators or the
|
||||
ISceneNode::setPosition(), ICameraSceneNode::setTarget() etc methods.
|
||||
/** This camera does not react on user input.
|
||||
If you want to move or animate it, use ISceneNode::setPosition(),
|
||||
ICameraSceneNode::setTarget() etc methods.
|
||||
By default, a camera's look at position (set with setTarget()) and its scene node
|
||||
rotation (set with setRotation()) are independent. If you want to be able to
|
||||
control the direction that the camera looks by using setRotation() then call
|
||||
@ -555,116 +414,6 @@ namespace scene
|
||||
const core::vector3df& lookat = core::vector3df(0,0,100),
|
||||
s32 id=-1, bool makeActive=true) = 0;
|
||||
|
||||
//! Adds a maya style user controlled camera scene node to the scene graph.
|
||||
/** This is a standard camera with an animator that provides mouse control similar
|
||||
to camera in the 3D Software Maya by Alias Wavefront.
|
||||
The camera does not react on setPosition anymore after applying this animator. Instead
|
||||
use setTarget, to fix the target the camera the camera hovers around. And setDistance
|
||||
to set the current distance from that target, i.e. the radius of the orbit the camera
|
||||
hovers on.
|
||||
\param parent: Parent scene node of the camera. Can be null.
|
||||
\param rotateSpeed: Rotation speed of the camera.
|
||||
\param zoomSpeed: Zoom speed of the camera.
|
||||
\param translationSpeed: TranslationSpeed of the camera.
|
||||
\param id: id of the camera. This id can be used to identify the camera.
|
||||
\param distance Initial distance of the camera from the object
|
||||
\param makeActive Flag whether this camera should become the active one.
|
||||
Make sure you always have one active camera.
|
||||
\return Returns a pointer to the interface of the camera if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent=0,
|
||||
f32 rotateSpeed=-1500.f, f32 zoomSpeed=200.f,
|
||||
f32 translationSpeed=1500.f, s32 id=-1, f32 distance=70.f,
|
||||
bool makeActive=true) =0;
|
||||
|
||||
//! Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for first person shooters (FPS).
|
||||
/** This FPS camera is intended to provide a demonstration of a
|
||||
camera that behaves like a typical First Person Shooter. It is
|
||||
useful for simple demos and prototyping but is not intended to
|
||||
provide a full solution for a production quality game. It binds
|
||||
the camera scene node rotation to the look-at target; @see
|
||||
ICameraSceneNode::bindTargetAndRotation(). With this camera,
|
||||
you look with the mouse, and move with cursor keys. If you want
|
||||
to change the key layout, you can specify your own keymap. For
|
||||
example to make the camera be controlled by the cursor keys AND
|
||||
the keys W,A,S, and D, do something like this:
|
||||
\code
|
||||
SKeyMap keyMap[8];
|
||||
keyMap[0].Action = EKA_MOVE_FORWARD;
|
||||
keyMap[0].KeyCode = KEY_UP;
|
||||
keyMap[1].Action = EKA_MOVE_FORWARD;
|
||||
keyMap[1].KeyCode = KEY_KEY_W;
|
||||
|
||||
keyMap[2].Action = EKA_MOVE_BACKWARD;
|
||||
keyMap[2].KeyCode = KEY_DOWN;
|
||||
keyMap[3].Action = EKA_MOVE_BACKWARD;
|
||||
keyMap[3].KeyCode = KEY_KEY_S;
|
||||
|
||||
keyMap[4].Action = EKA_STRAFE_LEFT;
|
||||
keyMap[4].KeyCode = KEY_LEFT;
|
||||
keyMap[5].Action = EKA_STRAFE_LEFT;
|
||||
keyMap[5].KeyCode = KEY_KEY_A;
|
||||
|
||||
keyMap[6].Action = EKA_STRAFE_RIGHT;
|
||||
keyMap[6].KeyCode = KEY_RIGHT;
|
||||
keyMap[7].Action = EKA_STRAFE_RIGHT;
|
||||
keyMap[7].KeyCode = KEY_KEY_D;
|
||||
|
||||
camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8);
|
||||
\endcode
|
||||
\param parent: Parent scene node of the camera. Can be null.
|
||||
\param rotateSpeed: Speed in degrees with which the camera is
|
||||
rotated. This can be done only with the mouse.
|
||||
\param moveSpeed: Speed in units per millisecond with which
|
||||
the camera is moved. Movement is done with the cursor keys.
|
||||
\param id: id of the camera. This id can be used to identify
|
||||
the camera.
|
||||
\param keyMapArray: Optional pointer to an array of a keymap,
|
||||
specifying what keys should be used to move the camera. If this
|
||||
is null, the default keymap is used. You can define actions
|
||||
more then one time in the array, to bind multiple keys to the
|
||||
same action.
|
||||
\param keyMapSize: Amount of items in the keymap array.
|
||||
\param noVerticalMovement: Setting this to true makes the
|
||||
camera only move within a horizontal plane, and disables
|
||||
vertical movement as known from most ego shooters. Default is
|
||||
'false', with which it is possible to fly around in space, if
|
||||
no gravity is there.
|
||||
\param jumpSpeed: Speed with which the camera is moved when
|
||||
jumping.
|
||||
\param invertMouse: Setting this to true makes the camera look
|
||||
up when the mouse is moved down and down when the mouse is
|
||||
moved up, the default is 'false' which means it will follow the
|
||||
movement of the mouse cursor.
|
||||
\param makeActive Flag whether this camera should become the active one.
|
||||
Make sure you always have one active camera.
|
||||
\return Pointer to the interface of the camera if successful,
|
||||
otherwise 0. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual ICameraSceneNode* addCameraSceneNodeFPS(ISceneNode* parent = 0,
|
||||
f32 rotateSpeed = 100.0f, f32 moveSpeed = 0.5f, s32 id=-1,
|
||||
SKeyMap* keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false,
|
||||
f32 jumpSpeed = 0.f, bool invertMouse=false,
|
||||
bool makeActive=true) = 0;
|
||||
|
||||
//! Adds a dynamic light scene node to the scene graph.
|
||||
/** The light will cast dynamic light on all
|
||||
other scene nodes in the scene, which have the material flag video::MTF_LIGHTING
|
||||
turned on. (This is the default setting in most scene nodes).
|
||||
\param parent: Parent scene node of the light. Can be null. If the parent moves,
|
||||
the light will move too.
|
||||
\param position: Position of the space relative to its parent where the light will be placed.
|
||||
\param color: Diffuse color of the light. Ambient or Specular colors can be set manually with
|
||||
the ILightSceneNode::getLightData() method.
|
||||
\param radius: Radius of the light.
|
||||
\param id: id of the node. This id can be used to identify the node.
|
||||
\return Pointer to the interface of the light if successful, otherwise NULL.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f),
|
||||
f32 radius=100.0f, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a billboard scene node to the scene graph.
|
||||
/** A billboard is like a 3d sprite: A 2d element,
|
||||
which always looks to the camera. It is usually used for things
|
||||
@ -689,180 +438,6 @@ namespace scene
|
||||
const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
|
||||
video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0;
|
||||
|
||||
//! Adds a skybox scene node to the scene graph.
|
||||
/** A skybox is a big cube with 6 textures on it and
|
||||
is drawn around the camera position.
|
||||
\param top: Texture for the top plane of the box.
|
||||
\param bottom: Texture for the bottom plane of the box.
|
||||
\param left: Texture for the left plane of the box.
|
||||
\param right: Texture for the right plane of the box.
|
||||
\param front: Texture for the front plane of the box.
|
||||
\param back: Texture for the back plane of the box.
|
||||
\param parent: Parent scene node of the skybox. A skybox usually has no parent,
|
||||
so this should be null. Note: If a parent is set to the skybox, the box will not
|
||||
change how it is drawn.
|
||||
\param id: An id of the node. This id can be used to identify the node.
|
||||
\return Pointer to the sky box if successful, otherwise NULL.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNode* addSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom,
|
||||
video::ITexture* left, video::ITexture* right, video::ITexture* front,
|
||||
video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a skydome scene node to the scene graph.
|
||||
/** A skydome is a large (half-) sphere with a panoramic texture
|
||||
on the inside and is drawn around the camera position.
|
||||
\param texture: Texture for the dome.
|
||||
\param horiRes: Number of vertices of a horizontal layer of the sphere.
|
||||
\param vertRes: Number of vertices of a vertical layer of the sphere.
|
||||
\param texturePercentage: How much of the height of the
|
||||
texture is used. Should be between 0 and 1.
|
||||
\param spherePercentage: How much of the sphere is drawn.
|
||||
Value should be between 0 and 2, where 1 is an exact
|
||||
half-sphere and 2 is a full sphere.
|
||||
\param radius The Radius of the sphere
|
||||
\param parent: Parent scene node of the dome. A dome usually has no parent,
|
||||
so this should be null. Note: If a parent is set, the dome will not
|
||||
change how it is drawn.
|
||||
\param id: An id of the node. This id can be used to identify the node.
|
||||
\return Pointer to the sky dome if successful, otherwise NULL.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture,
|
||||
u32 horiRes=16, u32 vertRes=8,
|
||||
f32 texturePercentage=0.9, f32 spherePercentage=2.0,f32 radius = 1000.f,
|
||||
ISceneNode* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a particle system scene node to the scene graph.
|
||||
/** \param withDefaultEmitter: Creates a default working point emitter
|
||||
which emits some particles. Set this to true to see a particle system
|
||||
in action. If set to false, you'll have to set the emitter you want by
|
||||
calling IParticleSystemSceneNode::setEmitter().
|
||||
\param parent: Parent of the scene node. Can be NULL if no parent.
|
||||
\param id: Id of the node. This id can be used to identify the scene node.
|
||||
\param position: Position of the space relative to its parent where the
|
||||
scene node will be placed.
|
||||
\param rotation: Initial rotation of the scene node.
|
||||
\param scale: Initial scale of the scene node.
|
||||
\return Pointer to the created scene node.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IParticleSystemSceneNode* addParticleSystemSceneNode(
|
||||
bool withDefaultEmitter=true, ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
|
||||
|
||||
//! Adds a terrain scene node to the scene graph.
|
||||
/** This node implements is a simple terrain renderer which uses
|
||||
a technique known as geo mip mapping
|
||||
for reducing the detail of triangle blocks which are far away.
|
||||
The code for the TerrainSceneNode is based on the terrain
|
||||
renderer by Soconne and the GeoMipMapSceneNode developed by
|
||||
Spintz. They made their code available for Irrlicht and allowed
|
||||
it to be distributed under this licence. I only modified some
|
||||
parts. A lot of thanks go to them.
|
||||
|
||||
This scene node is capable of loading terrains and updating
|
||||
the indices at runtime to enable viewing very large terrains
|
||||
very quickly. It uses a CLOD (Continuous Level of Detail)
|
||||
algorithm which updates the indices for each patch based on
|
||||
a LOD (Level of Detail) which is determined based on a patch's
|
||||
distance from the camera.
|
||||
|
||||
The patch size of the terrain must always be a size of 2^N+1,
|
||||
i.e. 8+1(9), 16+1(17), etc.
|
||||
The MaxLOD available is directly dependent on the patch size
|
||||
of the terrain. LOD 0 contains all of the indices to draw all
|
||||
the triangles at the max detail for a patch. As each LOD goes
|
||||
up by 1 the step taken, in generating indices increases by
|
||||
-2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step
|
||||
taken is 4, LOD 3 - 8, etc. The step can be no larger than
|
||||
the size of the patch, so having a LOD of 8, with a patch size
|
||||
of 17, is asking the algorithm to generate indices every 2^8 (
|
||||
256 ) vertices, which is not possible with a patch size of 17.
|
||||
The maximum LOD for a patch size of 17 is 2^4 ( 16 ). So,
|
||||
with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 (
|
||||
every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every
|
||||
8 vertices ) and LOD 4 ( every 16 vertices ).
|
||||
\param heightMapFileName: The name of the file on disk, to read vertex data from. This should
|
||||
be a gray scale bitmap.
|
||||
\param parent: Parent of the scene node. Can be 0 if no parent.
|
||||
\param id: Id of the node. This id can be used to identify the scene node.
|
||||
\param position: The absolute position of this node.
|
||||
\param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
|
||||
\param scale: The scale factor for the terrain. If you're
|
||||
using a heightmap of size 129x129 and would like your terrain
|
||||
to be 12900x12900 in game units, then use a scale factor of (
|
||||
core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
|
||||
scaling factor of 0.0f, then your terrain will be flat.
|
||||
\param vertexColor: The default color of all the vertices. If no texture is associated
|
||||
with the scene node, then all vertices will be this color. Defaults to white.
|
||||
\param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
|
||||
know what you are doing, this might lead to strange behavior.
|
||||
\param patchSize: patch size of the terrain. Only change if you
|
||||
know what you are doing, this might lead to strange behavior.
|
||||
\param smoothFactor: The number of times the vertices are smoothed.
|
||||
\param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
|
||||
\return Pointer to the created scene node. Can be null
|
||||
if the terrain could not be created, for example because the
|
||||
heightmap could not be loaded. The returned pointer should
|
||||
not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual ITerrainSceneNode* addTerrainSceneNode(
|
||||
const io::path& heightMapFileName,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
|
||||
const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
|
||||
const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f),
|
||||
video::SColor vertexColor = video::SColor(255,255,255,255),
|
||||
s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0,
|
||||
bool addAlsoIfHeightmapEmpty = false) = 0;
|
||||
|
||||
//! Adds a terrain scene node to the scene graph.
|
||||
/** Just like the other addTerrainSceneNode() method, but takes an IReadFile
|
||||
pointer as parameter for the heightmap. For more information take a look
|
||||
at the other function.
|
||||
\param heightMapFile: The file handle to read vertex data from. This should
|
||||
be a gray scale bitmap.
|
||||
\param parent: Parent of the scene node. Can be 0 if no parent.
|
||||
\param id: Id of the node. This id can be used to identify the scene node.
|
||||
\param position: The absolute position of this node.
|
||||
\param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
|
||||
\param scale: The scale factor for the terrain. If you're
|
||||
using a heightmap of size 129x129 and would like your terrain
|
||||
to be 12900x12900 in game units, then use a scale factor of (
|
||||
core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
|
||||
scaling factor of 0.0f, then your terrain will be flat.
|
||||
\param vertexColor: The default color of all the vertices. If no texture is associated
|
||||
with the scene node, then all vertices will be this color. Defaults to white.
|
||||
\param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
|
||||
know what you are doing, this might lead to strange behavior.
|
||||
\param patchSize: patch size of the terrain. Only change if you
|
||||
know what you are doing, this might lead to strange behavior.
|
||||
\param smoothFactor: The number of times the vertices are smoothed.
|
||||
\param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
|
||||
\return Pointer to the created scene node. Can be null
|
||||
if the terrain could not be created, for example because the
|
||||
heightmap could not be loaded. The returned pointer should
|
||||
not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual ITerrainSceneNode* addTerrainSceneNode(
|
||||
io::IReadFile* heightMapFile,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
|
||||
const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
|
||||
const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f),
|
||||
video::SColor vertexColor = video::SColor(255,255,255,255),
|
||||
s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0,
|
||||
bool addAlsoIfHeightmapEmpty = false) = 0;
|
||||
|
||||
//! Adds a quake3 scene node to the scene graph.
|
||||
/** A Quake3 Scene renders multiple meshes for a specific HighLanguage Shader (Quake3 Style )
|
||||
\return Pointer to the quake3 scene node if successful, otherwise NULL.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IMeshSceneNode* addQuake3SceneNode(const IMeshBuffer* meshBuffer, const quake3::IShader * shader,
|
||||
ISceneNode* parent=0, s32 id=-1
|
||||
) = 0;
|
||||
|
||||
|
||||
//! Adds an empty scene node to the scene graph.
|
||||
/** Can be used for doing advanced transformations
|
||||
or structuring the scene graph.
|
||||
@ -880,136 +455,6 @@ namespace scene
|
||||
virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode(
|
||||
ISceneNode* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a text scene node, which is able to display 2d text at a position in three dimensional space
|
||||
virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text,
|
||||
video::SColor color=video::SColor(100,255,255,255),
|
||||
ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0),
|
||||
s32 id=-1) = 0;
|
||||
|
||||
//! Adds a text scene node, which uses billboards. The node, and the text on it, will scale with distance.
|
||||
/**
|
||||
\param font The font to use on the billboard. Pass 0 to use the GUI environment's default font.
|
||||
\param text The text to display on the billboard.
|
||||
\param parent The billboard's parent. Pass 0 to use the root scene node.
|
||||
\param size The billboard's width and height.
|
||||
\param position The billboards position relative to its parent.
|
||||
\param id: An id of the node. This id can be used to identify the node.
|
||||
\param colorTop: The color of the vertices at the top of the billboard (default: white).
|
||||
\param colorBottom: The color of the vertices at the bottom of the billboard (default: white).
|
||||
\return Pointer to the billboard if successful, otherwise NULL.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IBillboardTextSceneNode* addBillboardTextSceneNode( gui::IGUIFont* font, const wchar_t* text,
|
||||
ISceneNode* parent = 0,
|
||||
const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
|
||||
const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
|
||||
video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0;
|
||||
|
||||
//! Adds a Hill Plane mesh to the mesh pool.
|
||||
/** The mesh is generated on the fly
|
||||
and looks like a plane with some hills on it. It is uses mostly for quick
|
||||
tests of the engine only. You can specify how many hills there should be
|
||||
on the plane and how high they should be. Also you must specify a name for
|
||||
the mesh, because the mesh is added to the mesh pool, and can be retrieved
|
||||
again using ISceneManager::getMesh() with the name as parameter.
|
||||
\param name: The name of this mesh which must be specified in order
|
||||
to be able to retrieve the mesh later with ISceneManager::getMesh().
|
||||
\param tileSize: Size of a tile of the mesh. (10.0f, 10.0f) would be a
|
||||
good value to start, for example.
|
||||
\param tileCount: Specifies how much tiles there will be. If you specify
|
||||
for example that a tile has the size (10.0f, 10.0f) and the tileCount is
|
||||
(10,10), than you get a field of 100 tiles which has the dimension 100.0f x 100.0f.
|
||||
\param material: Material of the hill mesh.
|
||||
\param hillHeight: Height of the hills. If you specify a negative value
|
||||
you will get holes instead of hills. If the height is 0, no hills will be
|
||||
created.
|
||||
\param countHills: Amount of hills on the plane. There will be countHills.X
|
||||
hills along the X axis and countHills.Y along the Y axis. So in total there
|
||||
will be countHills.X * countHills.Y hills.
|
||||
\param textureRepeatCount: Defines how often the texture will be repeated in
|
||||
x and y direction.
|
||||
return Null if the creation failed. The reason could be that you
|
||||
specified some invalid parameters or that a mesh with that name already
|
||||
exists. If successful, a pointer to the mesh is returned.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh* addHillPlaneMesh(const io::path& name,
|
||||
const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount,
|
||||
video::SMaterial* material = 0, f32 hillHeight = 0.0f,
|
||||
const core::dimension2d<f32>& countHills = core::dimension2d<f32>(0.0f, 0.0f),
|
||||
const core::dimension2d<f32>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) = 0;
|
||||
|
||||
//! Adds a static terrain mesh to the mesh pool.
|
||||
/** The mesh is generated on the fly
|
||||
from a texture file and a height map file. Both files may be huge
|
||||
(8000x8000 pixels would be no problem) because the generator splits the
|
||||
files into smaller textures if necessary.
|
||||
You must specify a name for the mesh, because the mesh is added to the mesh pool,
|
||||
and can be retrieved again using ISceneManager::getMesh() with the name as parameter.
|
||||
\param meshname: The name of this mesh which must be specified in order
|
||||
to be able to retrieve the mesh later with ISceneManager::getMesh().
|
||||
\param texture: Texture for the terrain. Please note that this is not a
|
||||
hardware texture as usual (ITexture), but an IImage software texture.
|
||||
You can load this texture with IVideoDriver::createImageFromFile().
|
||||
\param heightmap: A grayscaled heightmap image. Like the texture,
|
||||
it can be created with IVideoDriver::createImageFromFile(). The amount
|
||||
of triangles created depends on the size of this texture, so use a small
|
||||
heightmap to increase rendering speed.
|
||||
\param stretchSize: Parameter defining how big a is pixel on the heightmap.
|
||||
\param maxHeight: Defines how high a white pixel on the heightmap is.
|
||||
\param defaultVertexBlockSize: Defines the initial dimension between vertices.
|
||||
\return Null if the creation failed. The reason could be that you
|
||||
specified some invalid parameters, that a mesh with that name already
|
||||
exists, or that a texture could not be found. If successful, a pointer to the mesh is returned.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh* addTerrainMesh(const io::path& meshname,
|
||||
video::IImage* texture, video::IImage* heightmap,
|
||||
const core::dimension2d<f32>& stretchSize = core::dimension2d<f32>(10.0f,10.0f),
|
||||
f32 maxHeight=200.0f,
|
||||
const core::dimension2d<u32>& defaultVertexBlockSize = core::dimension2d<u32>(64,64)) = 0;
|
||||
|
||||
//! add a static arrow mesh to the meshpool
|
||||
/** \param name Name of the mesh
|
||||
\param vtxColorCylinder color of the cylinder
|
||||
\param vtxColorCone color of the cone
|
||||
\param tesselationCylinder Number of quads the cylinder side consists of
|
||||
\param tesselationCone Number of triangles the cone's roof consists of
|
||||
\param height Total height of the arrow
|
||||
\param cylinderHeight Total height of the cylinder, should be lesser than total height
|
||||
\param widthCylinder Diameter of the cylinder
|
||||
\param widthCone Diameter of the cone's base, should be not smaller than the cylinder's diameter
|
||||
\return Pointer to the arrow mesh if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh* addArrowMesh(const io::path& name,
|
||||
video::SColor vtxColorCylinder=0xFFFFFFFF,
|
||||
video::SColor vtxColorCone=0xFFFFFFFF,
|
||||
u32 tesselationCylinder=4, u32 tesselationCone=8,
|
||||
f32 height=1.f, f32 cylinderHeight=0.6f,
|
||||
f32 widthCylinder=0.05f, f32 widthCone=0.3f) = 0;
|
||||
|
||||
//! add a static sphere mesh to the meshpool
|
||||
/** \param name Name of the mesh
|
||||
\param radius Radius of the sphere
|
||||
\param polyCountX Number of quads used for the horizontal tiling
|
||||
\param polyCountY Number of quads used for the vertical tiling
|
||||
\return Pointer to the sphere mesh if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh* addSphereMesh(const io::path& name,
|
||||
f32 radius=5.f, u32 polyCountX = 16,
|
||||
u32 polyCountY = 16) = 0;
|
||||
|
||||
//! Add a volume light mesh to the meshpool
|
||||
/** \param name Name of the mesh
|
||||
\param SubdivideU Horizontal subdivision count
|
||||
\param SubdivideV Vertical subdivision count
|
||||
\param FootColor Color of the bottom of the light
|
||||
\param TailColor Color of the top of the light
|
||||
\return Pointer to the volume light mesh if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information.
|
||||
*/
|
||||
virtual IAnimatedMesh* addVolumeLightMesh(const io::path& name,
|
||||
const u32 SubdivideU = 32, const u32 SubdivideV = 32,
|
||||
const video::SColor FootColor = video::SColor(51, 0, 230, 180),
|
||||
const video::SColor TailColor = video::SColor(0, 0, 0, 0)) = 0;
|
||||
|
||||
//! Gets the root scene node.
|
||||
/** This is the scene node which is parent
|
||||
of all scene nodes. The root scene node is a special scene node which
|
||||
@ -1070,17 +515,6 @@ namespace scene
|
||||
\param camera: The new camera which should be active. */
|
||||
virtual void setActiveCamera(ICameraSceneNode* camera) = 0;
|
||||
|
||||
//! Sets the color of stencil buffers shadows drawn by the scene manager.
|
||||
virtual void setShadowColor(video::SColor color = video::SColor(150,0,0,0)) = 0;
|
||||
|
||||
//! Get the current color of shadows.
|
||||
virtual video::SColor getShadowColor() const = 0;
|
||||
|
||||
//! Create a shadow volume scene node to be used with custom nodes
|
||||
/** Use this if you implement your own SceneNodes and need shadow volumes in them.
|
||||
Otherwise you should generally use addShadowVolumeSceneNode functions from IMeshSceneNode or IAnimatedMeshSceneNode.*/
|
||||
virtual IShadowVolumeSceneNode* createShadowVolumeSceneNode(const IMesh* shadowMesh, ISceneNode* parent, s32 id, bool zfailmethod, f32 infinity) = 0;
|
||||
|
||||
//! Registers a node for rendering it at a specific time.
|
||||
/** This method should only be used by SceneNodes when they get a
|
||||
ISceneNode::OnRegisterSceneNode() call.
|
||||
@ -1108,254 +542,6 @@ namespace scene
|
||||
by existing scene node animators, culling of scene nodes is done, etc. */
|
||||
virtual void drawAll() = 0;
|
||||
|
||||
//! Creates a rotation animator, which rotates the attached scene node around itself.
|
||||
/** \param rotationSpeed Specifies the speed of the animation in degree per 10 milliseconds.
|
||||
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
|
||||
and the animator will animate it.
|
||||
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationSpeed) = 0;
|
||||
|
||||
//! Creates a fly circle animator, which lets the attached scene node fly around a center.
|
||||
/** \param center: Center of the circle.
|
||||
\param radius: Radius of the circle.
|
||||
\param speed: The orbital speed, in radians per millisecond.
|
||||
\param direction: Specifies the upvector used for alignment of the mesh.
|
||||
\param startPosition: The position on the circle where the animator will
|
||||
begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase)
|
||||
\param radiusEllipsoid: if radiusEllipsoid != 0 then radius2 from a ellipsoid
|
||||
begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase)
|
||||
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
|
||||
and the animator will animate it.
|
||||
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeAnimator* createFlyCircleAnimator(
|
||||
const core::vector3df& center=core::vector3df(0.f,0.f,0.f),
|
||||
f32 radius=100.f, f32 speed=0.001f,
|
||||
const core::vector3df& direction=core::vector3df(0.f, 1.f, 0.f),
|
||||
f32 startPosition = 0.f,
|
||||
f32 radiusEllipsoid = 0.f) = 0;
|
||||
|
||||
//! Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points.
|
||||
/** \param startPoint: Start point of the line.
|
||||
\param endPoint: End point of the line.
|
||||
\param timeForWay: Time in milliseconds how long the node should need to
|
||||
move from the start point to the end point.
|
||||
\param loop: If set to false, the node stops when the end point is reached.
|
||||
If loop is true, the node begins again at the start.
|
||||
\param pingpong Flag to set whether the animator should fly
|
||||
back from end to start again.
|
||||
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
|
||||
and the animator will animate it.
|
||||
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint,
|
||||
const core::vector3df& endPoint, u32 timeForWay, bool loop=false, bool pingpong = false) = 0;
|
||||
|
||||
//! Creates a texture animator, which switches the textures of the target scene node based on a list of textures.
|
||||
/** \param textures: List of textures to use.
|
||||
\param timePerFrame: Time in milliseconds, how long any texture in the list
|
||||
should be visible.
|
||||
\param loop: If set to to false, the last texture remains set, and the animation
|
||||
stops. If set to true, the animation restarts with the first texture.
|
||||
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
|
||||
and the animator will animate it.
|
||||
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeAnimator* createTextureAnimator(const core::array<video::ITexture*>& textures,
|
||||
s32 timePerFrame, bool loop=true) = 0;
|
||||
|
||||
//! Creates a scene node animator, which deletes the scene node after some time automatically.
|
||||
/** \param timeMs: Time in milliseconds, after when the node will be deleted.
|
||||
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
|
||||
and the animator will animate it.
|
||||
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMs) = 0;
|
||||
|
||||
//! Creates a special scene node animator for doing automatic collision detection and response.
|
||||
/** See ISceneNodeAnimatorCollisionResponse for details.
|
||||
\param world: Triangle selector holding all triangles of the world with which
|
||||
the scene node may collide. You can create a triangle selector with
|
||||
ISceneManager::createTriangleSelector();
|
||||
\param sceneNode: SceneNode which should be manipulated. After you added this animator
|
||||
to the scene node, the scene node will not be able to move through walls and is
|
||||
affected by gravity. If you need to teleport the scene node to a new position without
|
||||
it being effected by the collision geometry, then call sceneNode->setPosition(); then
|
||||
animator->setTargetNode(sceneNode);
|
||||
\param ellipsoidRadius: Radius of the ellipsoid with which collision detection and
|
||||
response is done. If you have got a scene node, and you are unsure about
|
||||
how big the radius should be, you could use the following code to determine
|
||||
it:
|
||||
\code
|
||||
const core::aabbox3d<f32>& box = yourSceneNode->getBoundingBox();
|
||||
core::vector3df radius = box.MaxEdge - box.getCenter();
|
||||
\endcode
|
||||
\param gravityPerSecond: Sets the gravity of the environment, as an acceleration in
|
||||
units per second per second. If your units are equivalent to meters, then
|
||||
core::vector3df(0,-10.0f,0) would give an approximately realistic gravity.
|
||||
You can disable gravity by setting it to core::vector3df(0,0,0).
|
||||
\param ellipsoidTranslation: By default, the ellipsoid for collision detection is created around
|
||||
the center of the scene node, which means that the ellipsoid surrounds
|
||||
it completely. If this is not what you want, you may specify a translation
|
||||
for the ellipsoid.
|
||||
\param slidingValue: DOCUMENTATION NEEDED.
|
||||
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
|
||||
and the animator will cause it to do collision detection and response.
|
||||
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeAnimatorCollisionResponse* createCollisionResponseAnimator(
|
||||
ITriangleSelector* world, ISceneNode* sceneNode,
|
||||
const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30),
|
||||
const core::vector3df& gravityPerSecond = core::vector3df(0,-10.0f,0),
|
||||
const core::vector3df& ellipsoidTranslation = core::vector3df(0,0,0),
|
||||
f32 slidingValue = 0.0005f) = 0;
|
||||
|
||||
//! Creates a follow spline animator.
|
||||
/** The animator modifies the position of
|
||||
the attached scene node to make it follow a Hermite spline.
|
||||
It uses a subset of Hermite splines: either cardinal splines
|
||||
(tightness != 0.5) or Catmull-Rom-splines (tightness == 0.5).
|
||||
The animator moves from one control point to the next in
|
||||
1/speed seconds. This code was sent in by Matthias Gall.
|
||||
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime,
|
||||
const core::array< core::vector3df >& points,
|
||||
f32 speed = 1.0f, f32 tightness = 0.5f, bool loop=true, bool pingpong=false) = 0;
|
||||
|
||||
//! Creates a simple ITriangleSelector, based on a mesh.
|
||||
/** Triangle selectors
|
||||
can be used for doing collision detection. Don't use this selector
|
||||
for a huge amount of triangles like in Quake3 maps.
|
||||
Instead, use for example ISceneManager::createOctreeTriangleSelector().
|
||||
Please note that the created triangle selector is not automatically attached
|
||||
to the scene node. You will have to call ISceneNode::setTriangleSelector()
|
||||
for this. To create and attach a triangle selector is done like this:
|
||||
\code
|
||||
ITriangleSelector* s = sceneManager->createTriangleSelector(yourMesh,
|
||||
yourSceneNode);
|
||||
yourSceneNode->setTriangleSelector(s);
|
||||
s->drop();
|
||||
\endcode
|
||||
\param mesh: Mesh of which the triangles are taken.
|
||||
\param node: Scene node of which transformation is used.
|
||||
\param separateMeshbuffers: When true it's possible to get information which meshbuffer
|
||||
got hit in collision tests. But has a slight speed cost.
|
||||
\return The selector, or null if not successful.
|
||||
If you no longer need the selector, you should call ITriangleSelector::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node, bool separateMeshbuffers=false) = 0;
|
||||
|
||||
//! Creates a simple ITriangleSelector, based on a meshbuffer.
|
||||
/**
|
||||
This is a static selector which won't update when the mesh changes.
|
||||
\param meshBuffer Triangles of that meshbuffer are used
|
||||
\param materialIndex If you pass a material index that index can be returned by the triangle selector.
|
||||
\para node: Scene node of which transformation is used.
|
||||
*/
|
||||
virtual ITriangleSelector* createTriangleSelector(const IMeshBuffer* meshBuffer, irr::u32 materialIndex, ISceneNode* node) = 0;
|
||||
|
||||
//! Creates a simple ITriangleSelector, based on an animated mesh scene node.
|
||||
/** Details of the mesh associated with the node will be extracted internally.
|
||||
\param node The animated mesh scene node from which to build the selector
|
||||
\param separateMeshbuffers: When true it's possible to get information which meshbuffer
|
||||
got hit in collision tests. But has a slight speed cost.
|
||||
*/
|
||||
virtual ITriangleSelector* createTriangleSelector(IAnimatedMeshSceneNode* node, bool separateMeshbuffers=false) = 0;
|
||||
|
||||
|
||||
//! Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box.
|
||||
/** Triangle selectors
|
||||
can be used for doing collision detection. Every time when triangles are
|
||||
queried, the triangle selector gets the bounding box of the scene node,
|
||||
an creates new triangles. In this way, it works good with animated scene nodes.
|
||||
\param node: Scene node of which the bounding box, visibility and transformation is used.
|
||||
\return The selector, or null if not successful.
|
||||
If you no longer need the selector, you should call ITriangleSelector::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ITriangleSelector* createTriangleSelectorFromBoundingBox(ISceneNode* node) = 0;
|
||||
|
||||
//! Creates a Triangle Selector, optimized by an octree.
|
||||
/** Triangle selectors
|
||||
can be used for doing collision detection. This triangle selector is
|
||||
optimized for huge amounts of triangle, it organizes them in an octree.
|
||||
Please note that the created triangle selector is not automatically attached
|
||||
to the scene node. You will have to call ISceneNode::setTriangleSelector()
|
||||
for this. To create and attach a triangle selector is done like this:
|
||||
\code
|
||||
ITriangleSelector* s = sceneManager->createOctreeTriangleSelector(yourMesh,
|
||||
yourSceneNode);
|
||||
yourSceneNode->setTriangleSelector(s);
|
||||
s->drop();
|
||||
\endcode
|
||||
For more information and examples on this, take a look at the collision
|
||||
tutorial in the SDK.
|
||||
\param mesh: Mesh of which the triangles are taken.
|
||||
\param node: Scene node of which visibility and transformation is used.
|
||||
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
|
||||
If a node gets less polys than this value, it will not be split into
|
||||
smaller nodes.
|
||||
\return The selector, or null if not successful.
|
||||
If you no longer need the selector, you should call ITriangleSelector::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ITriangleSelector* createOctreeTriangleSelector(IMesh* mesh,
|
||||
ISceneNode* node, s32 minimalPolysPerNode=32) = 0;
|
||||
|
||||
//! Creates a Triangle Selector for a single meshbuffer, optimized by an octree.
|
||||
/** Triangle selectors
|
||||
can be used for doing collision detection. This triangle selector is
|
||||
optimized for huge amounts of triangle, it organizes them in an octree.
|
||||
Please note that the created triangle selector is not automatically attached
|
||||
to the scene node. You will have to call ISceneNode::setTriangleSelector()
|
||||
for this. To create and attach a triangle selector is done like this:
|
||||
\code
|
||||
ITriangleSelector* s = sceneManager->createOctreeTriangleSelector(yourMesh,
|
||||
yourSceneNode);
|
||||
yourSceneNode->setTriangleSelector(s);
|
||||
s->drop();
|
||||
\endcode
|
||||
For more information and examples on this, take a look at the collision
|
||||
tutorial in the SDK.
|
||||
\param meshBuffer: Meshbuffer of which the triangles are taken.
|
||||
\param materialIndex: Setting this value allows the triangle selector to return the material index
|
||||
\param node: Scene node of which visibility and transformation is used.
|
||||
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
|
||||
If a node gets less polys than this value, it will not be split into
|
||||
smaller nodes.
|
||||
\return The selector, or null if not successful.
|
||||
If you no longer need the selector, you should call ITriangleSelector::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ITriangleSelector* createOctreeTriangleSelector(IMeshBuffer* meshBuffer, irr::u32 materialIndex,
|
||||
ISceneNode* node, s32 minimalPolysPerNode=32) = 0;
|
||||
|
||||
//! //! Creates a Triangle Selector, optimized by an octree.
|
||||
/** \deprecated Use createOctreeTriangleSelector instead. This method may be removed by Irrlicht 1.9. */
|
||||
_IRR_DEPRECATED_ ITriangleSelector* createOctTreeTriangleSelector(IMesh* mesh,
|
||||
ISceneNode* node, s32 minimalPolysPerNode=32)
|
||||
{
|
||||
return createOctreeTriangleSelector(mesh, node, minimalPolysPerNode);
|
||||
}
|
||||
|
||||
//! Creates a meta triangle selector.
|
||||
/** A meta triangle selector is nothing more than a
|
||||
collection of one or more triangle selectors providing together
|
||||
the interface of one triangle selector. In this way,
|
||||
collision tests can be done with different triangle soups in one pass.
|
||||
\return The selector, or null if not successful.
|
||||
If you no longer need the selector, you should call ITriangleSelector::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IMetaTriangleSelector* createMetaTriangleSelector() = 0;
|
||||
|
||||
//! Creates a triangle selector which can select triangles from a terrain scene node.
|
||||
/** \param node: Pointer to the created terrain scene node
|
||||
\param LOD: Level of detail, 0 for highest detail.
|
||||
\return The selector, or null if not successful.
|
||||
If you no longer need the selector, you should call ITriangleSelector::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ITriangleSelector* createTerrainTriangleSelector(
|
||||
ITerrainSceneNode* node, s32 LOD=0) = 0;
|
||||
|
||||
//! Adds an external mesh loader for extending the engine with new file formats.
|
||||
/** If you want the engine to be extended with
|
||||
file formats it currently is not able to load (e.g. .cob), just implement
|
||||
@ -1392,11 +578,6 @@ namespace scene
|
||||
\return A pointer to the specified loader, 0 if the index is incorrect. */
|
||||
virtual ISceneLoader* getSceneLoader(u32 index) const = 0;
|
||||
|
||||
//! Get pointer to the scene collision manager.
|
||||
/** \return Pointer to the collision manager
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneCollisionManager* getSceneCollisionManager() = 0;
|
||||
|
||||
//! Get pointer to the mesh manipulator.
|
||||
/** \return Pointer to the mesh manipulator
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
@ -1454,42 +635,14 @@ namespace scene
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeFactory* getSceneNodeFactory(u32 index) = 0;
|
||||
|
||||
//! Get the default scene node animator factory which can create all built-in scene node animators
|
||||
/** \return Pointer to the default scene node animator factory
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeAnimatorFactory* getDefaultSceneNodeAnimatorFactory() = 0;
|
||||
|
||||
//! Adds a scene node animator factory to the scene manager.
|
||||
/** Use this to extend the scene manager with new scene node animator types which it should be
|
||||
able to create automatically, for example when loading data from xml files. */
|
||||
virtual void registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd) = 0;
|
||||
|
||||
//! Get amount of registered scene node animator factories.
|
||||
virtual u32 getRegisteredSceneNodeAnimatorFactoryCount() const = 0;
|
||||
|
||||
//! Get scene node animator factory by index
|
||||
/** \return Pointer to the requested scene node animator factory, or 0 if it does not exist.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(u32 index) = 0;
|
||||
|
||||
//! Get typename from a scene node type or null if not found
|
||||
virtual const c8* getSceneNodeTypeName(ESCENE_NODE_TYPE type) = 0;
|
||||
|
||||
//! Returns a typename from a scene node animator type or null if not found
|
||||
virtual const c8* getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) = 0;
|
||||
|
||||
//! Adds a scene node to the scene by name
|
||||
/** \return Pointer to the scene node added by a factory
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNode* addSceneNode(const char* sceneNodeTypeName, ISceneNode* parent=0) = 0;
|
||||
|
||||
//! creates a scene node animator based on its type name
|
||||
/** \param typeName: Type of the scene node animator to add.
|
||||
\param target: Target scene node of the new animator.
|
||||
\return Returns pointer to the new scene node animator or null if not successful. You need to
|
||||
drop this pointer after calling this, see IReferenceCounted::drop() for details. */
|
||||
virtual ISceneNodeAnimator* createSceneNodeAnimator(const char* typeName, ISceneNode* target=0) = 0;
|
||||
|
||||
//! Creates a new scene manager.
|
||||
/** This can be used to easily draw and/or store two
|
||||
independent scenes at the same time. The mesh cache will be
|
||||
@ -1601,22 +754,12 @@ namespace scene
|
||||
//! Get ambient color of the scene
|
||||
virtual const video::SColorf& getAmbientLight() const = 0;
|
||||
|
||||
//! Register a custom callbacks manager which gets callbacks during scene rendering.
|
||||
/** \param[in] lightManager: the new callbacks manager. You may pass 0 to remove the
|
||||
current callbacks manager and restore the default behavior. */
|
||||
virtual void setLightManager(ILightManager* lightManager) = 0;
|
||||
|
||||
//! Get current render pass.
|
||||
virtual E_SCENE_NODE_RENDER_PASS getCurrentRenderPass() const =0;
|
||||
|
||||
//! Set current render pass.
|
||||
virtual void setCurrentRenderPass(E_SCENE_NODE_RENDER_PASS nextPass) =0;
|
||||
|
||||
//! Get an instance of a geometry creator.
|
||||
/** The geometry creator provides some helper methods to create various types of
|
||||
basic geometry. This can be useful for custom scene nodes. */
|
||||
virtual const IGeometryCreator* getGeometryCreator(void) const = 0;
|
||||
|
||||
//! Check if node is culled in current view frustum
|
||||
/** Please note that depending on the used culling method this
|
||||
check can be rather coarse, or slow. A positive result is
|
||||
|
@ -9,8 +9,6 @@
|
||||
#include "ESceneNodeTypes.h"
|
||||
#include "ECullingTypes.h"
|
||||
#include "EDebugSceneTypes.h"
|
||||
#include "ISceneNodeAnimator.h"
|
||||
#include "ITriangleSelector.h"
|
||||
#include "SMaterial.h"
|
||||
#include "irrString.h"
|
||||
#include "aabbox3d.h"
|
||||
@ -22,12 +20,11 @@ namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
class ISceneNode;
|
||||
class ISceneManager;
|
||||
|
||||
//! Typedef for list of scene nodes
|
||||
typedef core::list<ISceneNode*> ISceneNodeList;
|
||||
//! Typedef for list of scene node animators
|
||||
typedef core::list<ISceneNodeAnimator*> ISceneNodeAnimatorList;
|
||||
|
||||
//! Scene node interface.
|
||||
/** A scene node is a node in the hierarchical scene graph. Every scene
|
||||
@ -47,7 +44,7 @@ namespace scene
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
|
||||
: RelativeTranslation(position), RelativeRotation(rotation), RelativeScale(scale),
|
||||
Parent(0), SceneManager(mgr), TriangleSelector(0), ID(id),
|
||||
Parent(0), SceneManager(mgr), ID(id),
|
||||
AutomaticCullingState(EAC_BOX), DebugDataVisible(EDS_OFF),
|
||||
IsVisible(true), IsDebugObject(false)
|
||||
{
|
||||
@ -63,14 +60,6 @@ namespace scene
|
||||
{
|
||||
// delete all children
|
||||
removeAll();
|
||||
|
||||
// delete all animators
|
||||
ISceneNodeAnimatorList::Iterator ait = Animators.begin();
|
||||
for (; ait != Animators.end(); ++ait)
|
||||
(*ait)->drop();
|
||||
|
||||
if (TriangleSelector)
|
||||
TriangleSelector->drop();
|
||||
}
|
||||
|
||||
|
||||
@ -109,22 +98,6 @@ namespace scene
|
||||
{
|
||||
if (IsVisible)
|
||||
{
|
||||
// animate this node with all animators
|
||||
|
||||
ISceneNodeAnimatorList::Iterator ait = Animators.begin();
|
||||
while (ait != Animators.end())
|
||||
{
|
||||
// continue to the next node before calling animateNode()
|
||||
// so that the animator may remove itself from the scene
|
||||
// node without the iterator becoming invalid
|
||||
ISceneNodeAnimator* anim = *ait;
|
||||
++ait;
|
||||
if ( anim->isEnabled() )
|
||||
{
|
||||
anim->animateNode(this, timeMs);
|
||||
}
|
||||
}
|
||||
|
||||
// update absolute position
|
||||
updateAbsolutePosition();
|
||||
|
||||
@ -357,58 +330,6 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! Adds an animator which should animate this node.
|
||||
/** \param animator A pointer to the new animator. */
|
||||
virtual void addAnimator(ISceneNodeAnimator* animator)
|
||||
{
|
||||
if (animator)
|
||||
{
|
||||
Animators.push_back(animator);
|
||||
animator->grab();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//! Get a list of all scene node animators.
|
||||
/** \return The list of animators attached to this node. */
|
||||
const core::list<ISceneNodeAnimator*>& getAnimators() const
|
||||
{
|
||||
return Animators;
|
||||
}
|
||||
|
||||
|
||||
//! Removes an animator from this scene node.
|
||||
/** If the animator is found, it is also dropped and might be
|
||||
deleted if not other grab exists for it.
|
||||
\param animator A pointer to the animator to be deleted. */
|
||||
virtual void removeAnimator(ISceneNodeAnimator* animator)
|
||||
{
|
||||
ISceneNodeAnimatorList::Iterator it = Animators.begin();
|
||||
for (; it != Animators.end(); ++it)
|
||||
{
|
||||
if ((*it) == animator)
|
||||
{
|
||||
(*it)->drop();
|
||||
Animators.erase(it);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//! Removes all animators from this scene node.
|
||||
/** The animators might also be deleted if no other grab exists
|
||||
for them. */
|
||||
virtual void removeAnimators()
|
||||
{
|
||||
ISceneNodeAnimatorList::Iterator it = Animators.begin();
|
||||
for (; it != Animators.end(); ++it)
|
||||
(*it)->drop();
|
||||
|
||||
Animators.clear();
|
||||
}
|
||||
|
||||
|
||||
//! Returns the material based on the zero based index i.
|
||||
/** To get the amount of materials used by this scene node, use
|
||||
getMaterialCount(). This function is needed for inserting the
|
||||
@ -620,45 +541,6 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! Returns the triangle selector attached to this scene node.
|
||||
/** The Selector can be used by the engine for doing collision
|
||||
detection. You can create a TriangleSelector with
|
||||
ISceneManager::createTriangleSelector() or
|
||||
ISceneManager::createOctreeTriangleSelector and set it with
|
||||
ISceneNode::setTriangleSelector(). If a scene node got no triangle
|
||||
selector, but collision tests should be done with it, a triangle
|
||||
selector is created using the bounding box of the scene node.
|
||||
\return A pointer to the TriangleSelector or 0, if there
|
||||
is none. */
|
||||
virtual ITriangleSelector* getTriangleSelector() const
|
||||
{
|
||||
return TriangleSelector;
|
||||
}
|
||||
|
||||
|
||||
//! Sets the triangle selector of the scene node.
|
||||
/** The Selector can be used by the engine for doing collision
|
||||
detection. You can create a TriangleSelector with
|
||||
ISceneManager::createTriangleSelector() or
|
||||
ISceneManager::createOctreeTriangleSelector(). Some nodes may
|
||||
create their own selector by default, so it would be good to
|
||||
check if there is already a selector in this node by calling
|
||||
ISceneNode::getTriangleSelector().
|
||||
\param selector New triangle selector for this scene node. */
|
||||
virtual void setTriangleSelector(ITriangleSelector* selector)
|
||||
{
|
||||
if (TriangleSelector != selector)
|
||||
{
|
||||
if (TriangleSelector)
|
||||
TriangleSelector->drop();
|
||||
|
||||
TriangleSelector = selector;
|
||||
if (TriangleSelector)
|
||||
TriangleSelector->grab();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//! Updates the absolute position based on the relative and the parents position
|
||||
/** Note: This does not recursively update the parents absolute positions, so if you have a deeper
|
||||
hierarchy you might want to update the parents first.*/
|
||||
@ -778,7 +660,6 @@ namespace scene
|
||||
RelativeRotation = toCopyFrom->RelativeRotation;
|
||||
RelativeScale = toCopyFrom->RelativeScale;
|
||||
ID = toCopyFrom->ID;
|
||||
setTriangleSelector(toCopyFrom->TriangleSelector);
|
||||
AutomaticCullingState = toCopyFrom->AutomaticCullingState;
|
||||
DebugDataVisible = toCopyFrom->DebugDataVisible;
|
||||
IsVisible = toCopyFrom->IsVisible;
|
||||
@ -794,19 +675,6 @@ namespace scene
|
||||
ISceneNodeList::Iterator it = toCopyFrom->Children.begin();
|
||||
for (; it != toCopyFrom->Children.end(); ++it)
|
||||
(*it)->clone(this, newManager);
|
||||
|
||||
// clone animators
|
||||
|
||||
ISceneNodeAnimatorList::Iterator ait = toCopyFrom->Animators.begin();
|
||||
for (; ait != toCopyFrom->Animators.end(); ++ait)
|
||||
{
|
||||
ISceneNodeAnimator* anim = (*ait)->createClone(this, SceneManager);
|
||||
if (anim)
|
||||
{
|
||||
addAnimator(anim);
|
||||
anim->drop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! Sets the new scene manager for this node and all children.
|
||||
@ -841,15 +709,9 @@ namespace scene
|
||||
//! List of all children of this node
|
||||
core::list<ISceneNode*> Children;
|
||||
|
||||
//! List of all animator nodes
|
||||
core::list<ISceneNodeAnimator*> Animators;
|
||||
|
||||
//! Pointer to the scene manager
|
||||
ISceneManager* SceneManager;
|
||||
|
||||
//! Pointer to the triangle selector
|
||||
ITriangleSelector* TriangleSelector;
|
||||
|
||||
//! ID of the node.
|
||||
s32 ID;
|
||||
|
||||
|
@ -1,170 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_SCENE_NODE_ANIMATOR_H_INCLUDED__
|
||||
#define __I_SCENE_NODE_ANIMATOR_H_INCLUDED__
|
||||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "vector3d.h"
|
||||
#include "ESceneNodeAnimatorTypes.h"
|
||||
#include "IAttributeExchangingObject.h"
|
||||
#include "IAttributes.h"
|
||||
#include "IEventReceiver.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace io
|
||||
{
|
||||
class IAttributes;
|
||||
} // end namespace io
|
||||
namespace scene
|
||||
{
|
||||
class ISceneNode;
|
||||
class ISceneManager;
|
||||
|
||||
//! Animates a scene node. Can animate position, rotation, material, and so on.
|
||||
/** A scene node animator is able to animate a scene node in a very simple way. It may
|
||||
change its position, rotation, scale and/or material. There are lots of animators
|
||||
to choose from. You can create scene node animators with the ISceneManager interface.
|
||||
*/
|
||||
class ISceneNodeAnimator : public io::IAttributeExchangingObject, public IEventReceiver
|
||||
{
|
||||
public:
|
||||
ISceneNodeAnimator() : IsEnabled(true), PauseTimeSum(0), PauseTimeStart(0), StartTime(0)
|
||||
{
|
||||
}
|
||||
|
||||
//! Animates a scene node.
|
||||
/** \param node Node to animate.
|
||||
\param timeMs Current time in milliseconds. */
|
||||
virtual void animateNode(ISceneNode* node, u32 timeMs) =0;
|
||||
|
||||
//! Creates a clone of this animator.
|
||||
/** Please note that you will have to drop
|
||||
(IReferenceCounted::drop()) the returned pointer after calling this. */
|
||||
virtual ISceneNodeAnimator* createClone(ISceneNode* node,
|
||||
ISceneManager* newManager=0) =0;
|
||||
|
||||
//! Returns true if this animator receives events.
|
||||
/** When attached to an active camera, this animator will be
|
||||
able to respond to events such as mouse and keyboard events. */
|
||||
virtual bool isEventReceiverEnabled() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//! Event receiver, override this function for camera controlling animators
|
||||
virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//! Returns type of the scene node animator
|
||||
virtual ESCENE_NODE_ANIMATOR_TYPE getType() const
|
||||
{
|
||||
return ESNAT_UNKNOWN;
|
||||
}
|
||||
|
||||
//! Returns if the animator has finished.
|
||||
/** This is only valid for non-looping animators with a discrete end state.
|
||||
\return true if the animator has finished, false if it is still running. */
|
||||
virtual bool hasFinished(void) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//! Reset a time-based movement by changing the starttime.
|
||||
/** By default most animators start on object creation.
|
||||
This value is ignored by animators which don't work with a starttime.
|
||||
Known problems: CSceneNodeAnimatorRotation currently overwrites this value constantly (might be changed in the future).
|
||||
\param time Commonly you will use irr::ITimer::getTime().
|
||||
\param resetPauseTime Reset internal pause time for enabling/diabling animators as well
|
||||
*/
|
||||
virtual void setStartTime(u32 time, bool resetPauseTime=true)
|
||||
{
|
||||
StartTime = time;
|
||||
if ( resetPauseTime )
|
||||
{
|
||||
PauseTimeStart = 0;
|
||||
PauseTimeSum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//! Get the starttime.
|
||||
/** This will return 0 for by animators which don't work with a starttime unless a starttime was manually set */
|
||||
virtual irr::u32 getStartTime() const
|
||||
{
|
||||
return StartTime;
|
||||
}
|
||||
|
||||
//! Sets the enabled state of this element.
|
||||
/**
|
||||
\param enabled When set to false ISceneNodes will not update the animator anymore.
|
||||
Animators themselves usually don't care. So manual calls to animateNode still work.
|
||||
\param timeNow When set to values > 0 on enabling and disabling an internal timer will be increased by the time disabled time.
|
||||
Animator decide themselves how to handle that timer, but generally setting it will allow you to pause an animator, so it
|
||||
will continue at the same position when you enable it again. To use that pass irr::ITimer::getTime() as value.
|
||||
Animators with no timers will just ignore this.
|
||||
*/
|
||||
virtual void setEnabled(bool enabled, u32 timeNow=0)
|
||||
{
|
||||
if ( enabled == IsEnabled )
|
||||
return;
|
||||
IsEnabled = enabled;
|
||||
if ( enabled )
|
||||
{
|
||||
if ( timeNow > 0 && PauseTimeStart > 0 )
|
||||
PauseTimeSum += timeNow-PauseTimeStart;
|
||||
}
|
||||
else
|
||||
{
|
||||
PauseTimeStart = timeNow;
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool isEnabled() const
|
||||
{
|
||||
return IsEnabled;
|
||||
}
|
||||
|
||||
//! Writes attributes of the scene node animator.
|
||||
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_
|
||||
{
|
||||
out->addBool("IsEnabled", IsEnabled);
|
||||
// timers not serialized as they usually depend on system-time which is different on each application start.
|
||||
}
|
||||
|
||||
//! Reads attributes of the scene node animator.
|
||||
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_
|
||||
{
|
||||
IsEnabled = in->getAttributeAsBool("IsEnabled", IsEnabled);
|
||||
PauseTimeSum = 0;
|
||||
PauseTimeStart = 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
/** This method can be used by clone() implementations of
|
||||
derived classes
|
||||
\param toCopyFrom The animator from which the values are copied */
|
||||
void cloneMembers(const ISceneNodeAnimator* toCopyFrom)
|
||||
{
|
||||
IsEnabled = toCopyFrom->IsEnabled;
|
||||
PauseTimeSum = toCopyFrom->IsEnabled;
|
||||
PauseTimeStart = toCopyFrom->PauseTimeStart;
|
||||
StartTime = toCopyFrom->StartTime;
|
||||
}
|
||||
|
||||
bool IsEnabled; //! Only enabled animators are updated
|
||||
u32 PauseTimeSum; //! Sum up time which the animator was disabled
|
||||
u32 PauseTimeStart; //! Last time setEnabled(false) was called with a timer > 0
|
||||
u32 StartTime; //! Used by animators which are time-based, ignored otherwise.
|
||||
};
|
||||
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -1,75 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__
|
||||
#define __I_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__
|
||||
|
||||
#include "ISceneNodeAnimator.h"
|
||||
#include "IEventReceiver.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
struct SKeyMap;
|
||||
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Special scene node animator for FPS cameras
|
||||
/** This scene node animator can be attached to a camera to make it act
|
||||
like a first person shooter
|
||||
*/
|
||||
class ISceneNodeAnimatorCameraFPS : public ISceneNodeAnimator
|
||||
{
|
||||
public:
|
||||
|
||||
//! Returns the speed of movement in units per millisecond
|
||||
virtual f32 getMoveSpeed() const = 0;
|
||||
|
||||
//! Sets the speed of movement in units per millisecond
|
||||
virtual void setMoveSpeed(f32 moveSpeed) = 0;
|
||||
|
||||
//! Returns the rotation speed when using keyboard
|
||||
virtual f32 getRotateSpeedKeyboard() const = 0;
|
||||
|
||||
//! Set the rotation speed when using keyboard
|
||||
virtual void setRotateSpeedKeyboard(f32 rotateSpeed) = 0;
|
||||
|
||||
//! Returns the rotation speed in degrees when using mouse
|
||||
/** The degrees are equivalent to a half screen movement of the mouse,
|
||||
i.e. if the mouse cursor had been moved to the border of the screen since
|
||||
the last animation. */
|
||||
virtual f32 getRotateSpeed() const = 0;
|
||||
|
||||
//! Set the rotation speed in degrees when using mouse
|
||||
virtual void setRotateSpeed(f32 rotateSpeed) = 0;
|
||||
|
||||
//! Sets the keyboard mapping for this animator (old style)
|
||||
/** \param map Array of keyboard mappings, see irr::SKeyMap
|
||||
\param count Size of the keyboard map array. */
|
||||
virtual void setKeyMap(SKeyMap *map, u32 count) = 0;
|
||||
|
||||
//! Sets the keyboard mapping for this animator
|
||||
//! \param keymap The new keymap array
|
||||
virtual void setKeyMap(const core::array<SKeyMap>& keymap) = 0;
|
||||
|
||||
//! Gets the keyboard mapping for this animator
|
||||
virtual const core::array<SKeyMap>& getKeyMap() const = 0;
|
||||
|
||||
//! Sets whether vertical movement should be allowed.
|
||||
/** If vertical movement is enabled then the camera may fight with
|
||||
gravity causing camera shake. Disable this if the camera has
|
||||
a collision animator with gravity enabled. */
|
||||
virtual void setVerticalMovement(bool allow) = 0;
|
||||
|
||||
//! Sets whether the Y axis of the mouse should be inverted.
|
||||
/** If enabled then moving the mouse down will cause
|
||||
the camera to look up. It is disabled by default. */
|
||||
virtual void setInvertMouse(bool invert) = 0;
|
||||
};
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -1,65 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__
|
||||
#define __I_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__
|
||||
|
||||
#include "ISceneNodeAnimator.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Special scene node animator for Maya-style cameras
|
||||
/** This scene node animator can be attached to a camera to make it act like a 3d
|
||||
modeling tool.
|
||||
The camera is moving relative to the target with the mouse, by pressing either
|
||||
of the three buttons.
|
||||
In order to move the camera, set a new target for the camera. The distance defines
|
||||
the current orbit radius the camera moves on. Distance can be changed via the setter
|
||||
or by mouse events.
|
||||
*/
|
||||
class ISceneNodeAnimatorCameraMaya : public ISceneNodeAnimator
|
||||
{
|
||||
public:
|
||||
|
||||
//! Returns the speed of movement
|
||||
virtual f32 getMoveSpeed() const = 0;
|
||||
|
||||
//! Sets the speed of movement
|
||||
virtual void setMoveSpeed(f32 moveSpeed) = 0;
|
||||
|
||||
//! Returns the rotation speed
|
||||
virtual f32 getRotateSpeed() const = 0;
|
||||
|
||||
//! Set the rotation speed
|
||||
virtual void setRotateSpeed(f32 rotateSpeed) = 0;
|
||||
|
||||
//! Returns the zoom speed
|
||||
virtual f32 getZoomSpeed() const = 0;
|
||||
|
||||
//! Set the zoom speed
|
||||
virtual void setZoomSpeed(f32 zoomSpeed) = 0;
|
||||
|
||||
//! Returns the current distance, i.e. orbit radius
|
||||
virtual f32 getDistance() const = 0;
|
||||
|
||||
//! Set the distance
|
||||
virtual void setDistance(f32 distance) = 0;
|
||||
|
||||
//! Set the minimal distance to the camera target for zoom
|
||||
virtual void setTargetMinDistance(f32 minDistance) = 0;
|
||||
|
||||
//! Returns the minimal distance to the camera target for zoom
|
||||
virtual f32 getTargetMinDistance() const = 0;
|
||||
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -1,171 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_SCENE_NODE_ANIMATOR_COLLISION_RESPONSE_H_INCLUDED__
|
||||
#define __I_SCENE_NODE_ANIMATOR_COLLISION_RESPONSE_H_INCLUDED__
|
||||
|
||||
#include "ISceneNode.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
class ISceneNodeAnimatorCollisionResponse;
|
||||
|
||||
//! Callback interface for catching events of collisions.
|
||||
/** Implement this interface and use
|
||||
ISceneNodeAnimatorCollisionResponse::setCollisionCallback to be able to
|
||||
be notified if a collision has occurred.
|
||||
**/
|
||||
class ICollisionCallback : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Will be called when a collision occurs.
|
||||
/** See ISceneNodeAnimatorCollisionResponse::setCollisionCallback for more information.
|
||||
\param animator: Collision response animator in which the collision occurred. You can call
|
||||
this animator's methods to find the node, collisionPoint and/or collision triangle.
|
||||
\retval true if the collision was handled in the animator. The animator's target
|
||||
node will *not* be stopped at the collision point, but will instead move fully
|
||||
to the location that triggered the collision check.
|
||||
\retval false if the collision was not handled in the animator. The animator's
|
||||
target node will be moved to the collision position.
|
||||
*/
|
||||
virtual bool onCollision(const ISceneNodeAnimatorCollisionResponse& animator) = 0;
|
||||
};
|
||||
|
||||
//! Special scene node animator for doing automatic collision detection and response.
|
||||
/** This scene node animator can be attached to any single scene node
|
||||
and will then prevent it from moving through specified collision geometry
|
||||
(e.g. walls and floors of the) world, as well as having it fall under gravity.
|
||||
This animator provides a simple implementation of first person shooter cameras.
|
||||
Attach it to a camera, and the camera will behave as the player control in a
|
||||
first person shooter game: The camera stops and slides at walls, walks up stairs,
|
||||
falls down if there is no floor under it, and so on.
|
||||
|
||||
The animator will treat any change in the position of its target scene
|
||||
node as movement, including a setPosition(), as movement. If you want to
|
||||
teleport the target scene node manually to a location without it being effected
|
||||
by collision geometry, then call setTargetNode(node) after calling node->setPosition().
|
||||
*/
|
||||
class ISceneNodeAnimatorCollisionResponse : public ISceneNodeAnimator
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor
|
||||
virtual ~ISceneNodeAnimatorCollisionResponse() {}
|
||||
|
||||
//! Check if the attached scene node is falling.
|
||||
/** Falling means that there is no blocking wall from the scene
|
||||
node in the direction of the gravity. The implementation of
|
||||
this method is very fast, no collision detection is done when
|
||||
invoking it.
|
||||
\return True if the scene node is falling, false if not. */
|
||||
virtual bool isFalling() const = 0;
|
||||
|
||||
//! Sets the radius of the ellipsoid for collision detection and response.
|
||||
/** If you have a scene node, and you are unsure about how big
|
||||
the radius should be, you could use the following code to
|
||||
determine it:
|
||||
\code
|
||||
core::aabbox<f32> box = yourSceneNode->getBoundingBox();
|
||||
core::vector3df radius = box.MaxEdge - box.getCenter();
|
||||
\endcode
|
||||
\param radius: New radius of the ellipsoid. */
|
||||
virtual void setEllipsoidRadius(const core::vector3df& radius) = 0;
|
||||
|
||||
//! Returns the radius of the ellipsoid for collision detection and response.
|
||||
/** \return Radius of the ellipsoid. */
|
||||
virtual core::vector3df getEllipsoidRadius() const = 0;
|
||||
|
||||
//! Sets the gravity of the environment.
|
||||
/** A good example value would be core::vector3df(0,-100.0f,0)
|
||||
for letting gravity affect all object to fall down. For bigger
|
||||
gravity, make increase the length of the vector. You can
|
||||
disable gravity by setting it to core::vector3df(0,0,0);
|
||||
\param gravity: New gravity vector. */
|
||||
virtual void setGravity(const core::vector3df& gravity) = 0;
|
||||
|
||||
//! Get current vector of gravity.
|
||||
//! \return Gravity vector. */
|
||||
virtual core::vector3df getGravity() const = 0;
|
||||
|
||||
//! 'Jump' the animator, by adding a jump speed opposite to its gravity
|
||||
/** \param jumpSpeed The initial speed of the jump; the velocity will be opposite
|
||||
to this animator's gravity vector. */
|
||||
virtual void jump(f32 jumpSpeed) = 0;
|
||||
|
||||
//! Should the Target react on collision ( default = true )
|
||||
virtual void setAnimateTarget ( bool enable ) = 0;
|
||||
virtual bool getAnimateTarget () const = 0;
|
||||
|
||||
//! Set translation of the collision ellipsoid.
|
||||
/** By default, the ellipsoid for collision detection is
|
||||
created around the center of the scene node, which means that
|
||||
the ellipsoid surrounds it completely. If this is not what you
|
||||
want, you may specify a translation for the ellipsoid.
|
||||
\param translation: Translation of the ellipsoid relative
|
||||
to the position of the scene node. */
|
||||
virtual void setEllipsoidTranslation(const core::vector3df &translation) = 0;
|
||||
|
||||
//! Get the translation of the ellipsoid for collision detection.
|
||||
/** See
|
||||
ISceneNodeAnimatorCollisionResponse::setEllipsoidTranslation()
|
||||
for more details.
|
||||
\return Translation of the ellipsoid relative to the position
|
||||
of the scene node. */
|
||||
virtual core::vector3df getEllipsoidTranslation() const = 0;
|
||||
|
||||
//! Sets a triangle selector holding all triangles of the world with which the scene node may collide.
|
||||
/** \param newWorld: New triangle selector containing triangles
|
||||
to let the scene node collide with. */
|
||||
virtual void setWorld(ITriangleSelector* newWorld) = 0;
|
||||
|
||||
//! Get the current triangle selector containing all triangles for collision detection.
|
||||
virtual ITriangleSelector* getWorld() const = 0;
|
||||
|
||||
//! Set the single node that this animator will act on.
|
||||
/** \param node The new target node. Setting this will force the animator to update
|
||||
its last target position for the node, allowing setPosition() to teleport
|
||||
the node through collision geometry. */
|
||||
virtual void setTargetNode(ISceneNode * node) = 0;
|
||||
|
||||
//! Gets the single node that this animator is acting on.
|
||||
/** \return The node that this animator is acting on. */
|
||||
virtual ISceneNode* getTargetNode(void) const = 0;
|
||||
|
||||
//! Returns true if a collision occurred during the last animateNode()
|
||||
virtual bool collisionOccurred() const = 0;
|
||||
|
||||
//! Returns the last point of collision.
|
||||
virtual const core::vector3df & getCollisionPoint() const = 0;
|
||||
|
||||
//! Returns the last triangle that caused a collision
|
||||
virtual const core::triangle3df & getCollisionTriangle() const = 0;
|
||||
|
||||
//! Returns the position that the target node will be moved to, unless the collision is consumed in a callback.
|
||||
/**
|
||||
If you have a collision callback registered, and it consumes the collision, then the
|
||||
node will ignore the collision and will not stop at this position. Instead, it will
|
||||
move fully to the position that caused the collision to occur. */
|
||||
virtual const core::vector3df & getCollisionResultPosition(void) const = 0;
|
||||
|
||||
//! Returns the node that was collided with.
|
||||
virtual ISceneNode* getCollisionNode(void) const = 0;
|
||||
|
||||
//! Sets a callback interface which will be called if a collision occurs.
|
||||
/** \param callback: collision callback handler that will be called when a collision
|
||||
occurs. Set this to 0 to disable the callback.
|
||||
*/
|
||||
virtual void setCollisionCallback(ICollisionCallback* callback) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -1,69 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__
|
||||
#define __I_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__
|
||||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "ESceneNodeAnimatorTypes.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
class ISceneNode;
|
||||
class ISceneNodeAnimator;
|
||||
|
||||
//! Interface for dynamic creation of scene node animators
|
||||
/** To be able to add custom scene node animators to Irrlicht and to make it possible for the
|
||||
scene manager to save and load those external animators, simply implement this
|
||||
interface and register it in you scene manager via ISceneManager::registerSceneNodeAnimatorFactory.
|
||||
Note: When implementing your own scene node factory, don't call ISceneNodeManager::grab() to
|
||||
increase the reference counter of the scene node manager. This is not necessary because the
|
||||
scene node manager will grab() the factory anyway, and otherwise cyclic references will
|
||||
be created and the scene manager and all its nodes won't get deallocated.
|
||||
*/
|
||||
class ISceneNodeAnimatorFactory : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! creates a scene node animator based on its type id
|
||||
/** \param type: Type of the scene node animator to add.
|
||||
\param target: Target scene node of the new animator.
|
||||
\return Returns pointer to the new scene node animator or null if not successful. You need to
|
||||
drop this pointer after calling this, see IReferenceCounted::drop() for details. */
|
||||
virtual ISceneNodeAnimator* createSceneNodeAnimator(ESCENE_NODE_ANIMATOR_TYPE type, ISceneNode* target) = 0;
|
||||
|
||||
//! creates a scene node animator based on its type name
|
||||
/** \param typeName: Type of the scene node animator to add.
|
||||
\param target: Target scene node of the new animator.
|
||||
\return Returns pointer to the new scene node animator or null if not successful. You need to
|
||||
drop this pointer after calling this, see IReferenceCounted::drop() for details. */
|
||||
virtual ISceneNodeAnimator* createSceneNodeAnimator(const c8* typeName, ISceneNode* target) = 0;
|
||||
|
||||
//! returns amount of scene node animator types this factory is able to create
|
||||
virtual u32 getCreatableSceneNodeAnimatorTypeCount() const = 0;
|
||||
|
||||
//! returns type of a creatable 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(u32 idx) const = 0;
|
||||
|
||||
//! returns type name of a creatable 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(u32 idx) const = 0;
|
||||
|
||||
//! returns type name of a creatable 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) const = 0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -1,65 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__
|
||||
#define __I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__
|
||||
|
||||
#include "ISceneNode.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
class IMesh;
|
||||
|
||||
enum ESHADOWVOLUME_OPTIMIZATION
|
||||
{
|
||||
//! Create volumes around every triangle
|
||||
ESV_NONE,
|
||||
|
||||
//! Create volumes only around the silhouette of the mesh
|
||||
/** This can reduce the number of volumes drastically,
|
||||
but will have an upfront-cost where it calculates adjacency of
|
||||
triangles. Also it will not work with all models. Basically
|
||||
if you see strange black shadow lines then you have a model
|
||||
for which it won't work.
|
||||
We get that information about adjacency by comparing the positions of
|
||||
all edges in the mesh (even if they are in different meshbuffers). */
|
||||
ESV_SILHOUETTE_BY_POS
|
||||
};
|
||||
|
||||
//! Scene node for rendering a shadow volume into a stencil buffer.
|
||||
class IShadowVolumeSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
IShadowVolumeSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id)
|
||||
: ISceneNode(parent, mgr, id) {}
|
||||
|
||||
//! Sets the mesh from which the shadow volume should be generated.
|
||||
/** To optimize shadow rendering, use a simpler mesh for shadows.
|
||||
*/
|
||||
virtual void setShadowMesh(const IMesh* mesh) = 0;
|
||||
|
||||
//! Updates the shadow volumes for current light positions.
|
||||
virtual void updateShadowVolumes() = 0;
|
||||
|
||||
//! Set optimization used to create shadow volumes
|
||||
/** Default is ESV_SILHOUETTE_BY_POS. If the shadow
|
||||
looks bad then give ESV_NONE a try (which will be slower).
|
||||
Alternatively you can try to fix the model, it's often
|
||||
because it's not closed (aka if you'd put water in it then
|
||||
that would leak out). */
|
||||
virtual void setOptimization(ESHADOWVOLUME_OPTIMIZATION optimization) = 0;
|
||||
|
||||
//! Get currently active optimization used to create shadow volumes
|
||||
virtual ESHADOWVOLUME_OPTIMIZATION getOptimization() const = 0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -1,190 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
// The code for the TerrainSceneNode is based on the terrain renderer by
|
||||
// Soconne and the GeoMipMapSceneNode developed by Spintz. They made their
|
||||
// code available for Irrlicht and allowed it to be distributed under this
|
||||
// licence. I only modified some parts. A lot of thanks go to them.
|
||||
|
||||
#ifndef __I_TERRAIN_SCENE_NODE_H__
|
||||
#define __I_TERRAIN_SCENE_NODE_H__
|
||||
|
||||
#include "ETerrainElements.h"
|
||||
#include "ISceneNode.h"
|
||||
#include "IDynamicMeshBuffer.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace io
|
||||
{
|
||||
class IReadFile;
|
||||
} // end namespace io
|
||||
namespace scene
|
||||
{
|
||||
class IMesh;
|
||||
|
||||
//! A scene node for displaying terrain using the geo mip map algorithm.
|
||||
/** The code for the TerrainSceneNode is based on the Terrain renderer by Soconne and
|
||||
* the GeoMipMapSceneNode developed by Spintz. They made their code available for Irrlicht
|
||||
* and allowed it to be distributed under this licence. I only modified some parts.
|
||||
* A lot of thanks go to them.
|
||||
*
|
||||
* This scene node is capable of very quickly loading
|
||||
* terrains and updating the indices at runtime to enable viewing very large terrains. It uses a
|
||||
* CLOD (Continuous Level of Detail) algorithm which updates the indices for each patch based on
|
||||
* a LOD (Level of Detail) which is determined based on a patch's distance from the camera.
|
||||
*
|
||||
* The Patch Size of the terrain must always be a size of ( 2^N+1, i.e. 8+1(9), 16+1(17), etc. ).
|
||||
* The MaxLOD available is directly dependent on the patch size of the terrain. LOD 0 contains all
|
||||
* of the indices to draw all the triangles at the max detail for a patch. As each LOD goes up by 1
|
||||
* the step taken, in generating indices increases by - 2^LOD, so for LOD 1, the step taken is 2, for
|
||||
* LOD 2, the step taken is 4, LOD 3 - 8, etc. The step can be no larger than the size of the patch,
|
||||
* so having a LOD of 8, with a patch size of 17, is asking the algorithm to generate indices every
|
||||
* 2^8 ( 256 ) vertices, which is not possible with a patch size of 17. The maximum LOD for a patch
|
||||
* size of 17 is 2^4 ( 16 ). So, with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( every
|
||||
* 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every 8 vertices ) and LOD 4 ( every 16 vertices ).
|
||||
**/
|
||||
class ITerrainSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
ITerrainSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0.0f, 0.0f, 0.0f),
|
||||
const core::vector3df& rotation = core::vector3df(0.0f, 0.0f, 0.0f),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f) )
|
||||
: ISceneNode (parent, mgr, id, position, rotation, scale) {}
|
||||
|
||||
//! Get the bounding box of the terrain.
|
||||
/** \return The bounding box of the entire terrain. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const =0;
|
||||
|
||||
//! Get the bounding box of a patch
|
||||
/** \return The bounding box of the chosen patch. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox(s32 patchX, s32 patchZ) const =0;
|
||||
|
||||
//! Get the number of indices currently in the meshbuffer
|
||||
/** \return The index count. */
|
||||
virtual u32 getIndexCount() const =0;
|
||||
|
||||
//! Get pointer to the mesh
|
||||
/** \return Pointer to the mesh. */
|
||||
virtual IMesh* getMesh() =0;
|
||||
|
||||
//! Get pointer to the buffer used by the terrain (most users will not need this)
|
||||
virtual IMeshBuffer* getRenderBuffer() =0;
|
||||
|
||||
|
||||
//! Gets the meshbuffer data based on a specified level of detail.
|
||||
/** \param mb A reference to an IDynamicMeshBuffer object
|
||||
\param LOD The level of detail you want the indices from. */
|
||||
virtual void getMeshBufferForLOD(IDynamicMeshBuffer& mb, s32 LOD=0) 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.
|
||||
\param patchX Patch x coordinate.
|
||||
\param patchZ Patch z coordinate.
|
||||
\param LOD The level of detail to get for that patch. If -1,
|
||||
then get 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 of indices put into the buffer. */
|
||||
virtual s32 getIndicesForPatch(core::array<u32>& indices,
|
||||
s32 patchX, s32 patchZ, s32 LOD=0) =0;
|
||||
|
||||
//! Populates an array with the CurrentLOD of each patch.
|
||||
/** \param LODs A reference to a core::array<s32> to hold the
|
||||
values
|
||||
\return Number of elements in the array */
|
||||
virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs) const =0;
|
||||
|
||||
//! Manually sets the LOD of a patch
|
||||
/** NOTE: Any values set here are overwritten again in the automatic
|
||||
recalculations when the camera changes.
|
||||
\param patchX Patch x coordinate.
|
||||
\param patchZ Patch z coordinate.
|
||||
\param LOD The level of detail to set the patch to. */
|
||||
virtual void setLODOfPatch(s32 patchX, s32 patchZ, s32 LOD=0) =0;
|
||||
|
||||
//! Get center of terrain.
|
||||
virtual const core::vector3df& getTerrainCenter() const =0;
|
||||
|
||||
//! Get height of a point of the terrain.
|
||||
virtual f32 getHeight(f32 x, f32 y) const =0;
|
||||
|
||||
//! Sets the movement camera threshold.
|
||||
/** It is used to determine when to recalculate
|
||||
indices for the scene node. The default value is 10.0f. */
|
||||
virtual void setCameraMovementDelta(f32 delta) =0;
|
||||
|
||||
//! Sets the rotation camera threshold.
|
||||
/** It is used to determine when to recalculate
|
||||
indices for the scene node. The default value is 1.0f. */
|
||||
virtual void setCameraRotationDelta(f32 delta) =0;
|
||||
|
||||
//! Sets whether or not the node should dynamically update its associated selector when the geomipmap data changes.
|
||||
/** \param bVal: Boolean value representing whether or not to update selector dynamically. */
|
||||
virtual void setDynamicSelectorUpdate(bool bVal) =0;
|
||||
|
||||
//! Override the default generation of distance thresholds.
|
||||
/** For determining the LOD a patch is rendered at. If any LOD
|
||||
is overridden, then the scene node will no longer apply scaling
|
||||
factors to these values. If you override these distances, and
|
||||
then apply a scale to the scene node, it is your responsibility
|
||||
to update the new distances to work best with your new terrain
|
||||
size. */
|
||||
virtual bool overrideLODDistance(s32 LOD, f64 newDistance) =0;
|
||||
|
||||
//! Scales the base texture, similar to makePlanarTextureMapping.
|
||||
/** \param scale The scaling amount. Values above 1.0
|
||||
increase the number of time the texture is drawn on the
|
||||
terrain. Values below 0 will decrease the number of times the
|
||||
texture is drawn on the terrain. Using negative values will
|
||||
flip the texture, as well as still scaling it.
|
||||
\param scale2 If set to 0 (default value), this will set the
|
||||
second texture coordinate set to the same values as in the
|
||||
first set. If this is another value than zero, it will scale
|
||||
the second texture coordinate set by this value. */
|
||||
virtual void scaleTexture(f32 scale = 1.0f, f32 scale2=0.0f) =0;
|
||||
|
||||
//! Initializes the terrain data. Loads the vertices from the heightMapFile.
|
||||
/** The file must contain a loadable image of the heightmap. The heightmap
|
||||
must be square.
|
||||
\param file The file to read the image from. File is not rewinded.
|
||||
\param vertexColor Color of all vertices.
|
||||
\param smoothFactor Number of smoothing passes. */
|
||||
virtual bool loadHeightMap(io::IReadFile* file,
|
||||
video::SColor vertexColor=video::SColor(255,255,255,255),
|
||||
s32 smoothFactor=0) =0;
|
||||
|
||||
//! Initializes the terrain data. Loads the vertices from the heightMapFile.
|
||||
/** The data is interpreted as (signed) integers of the given bit size or
|
||||
floats (with 32bits, signed). Allowed bitsizes for integers are
|
||||
8, 16, and 32. The heightmap must be square.
|
||||
\param file The file to read the RAW data from. File is not rewinded.
|
||||
\param bitsPerPixel Size of data if integers used, for floats always use 32.
|
||||
\param signedData Whether we use signed or unsigned ints, ignored for floats.
|
||||
\param floatVals Whether the data is float or int.
|
||||
\param width Width (and also Height, as it must be square) of the heightmap. Use 0 for autocalculating from the filesize.
|
||||
\param vertexColor Color of all vertices.
|
||||
\param smoothFactor Number of smoothing passes. */
|
||||
virtual bool loadHeightMapRAW(io::IReadFile* file, s32 bitsPerPixel=16,
|
||||
bool signedData=false, bool floatVals=false, s32 width=0,
|
||||
video::SColor vertexColor=video::SColor(255,255,255,255),
|
||||
s32 smoothFactor=0) =0;
|
||||
|
||||
//! Force node to use a fixed LOD level at the borders of the terrain.
|
||||
/** This can be useful when several TerrainSceneNodes are connected.
|
||||
\param borderLOD When >= 0 all patches at the 4 borders will use the
|
||||
given LOD. When < 0 borders are just regular patches (that's default). */
|
||||
virtual void setFixedBorderLOD(irr::s32 borderLOD=0) = 0;
|
||||
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // __I_TERRAIN_SCENE_NODE_H__
|
||||
|
@ -1,55 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_TEXT_SCENE_NODE_H_INCLUDED__
|
||||
#define __I_TEXT_SCENE_NODE_H_INCLUDED__
|
||||
|
||||
#include "ISceneNode.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace gui
|
||||
{
|
||||
class IGUIFont;
|
||||
}
|
||||
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! A scene node for displaying 2d text at a position in three dimensional space
|
||||
class ITextSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
ITextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0,0,0))
|
||||
: ISceneNode(parent, mgr, id, position) {}
|
||||
|
||||
//! sets the text string
|
||||
virtual void setText(const wchar_t* text) = 0;
|
||||
|
||||
//! get the text string
|
||||
virtual const wchar_t* getText() const = 0;
|
||||
|
||||
//! sets the color of the text
|
||||
virtual void setTextColor(video::SColor color) = 0;
|
||||
|
||||
//! get the color of the text
|
||||
virtual video::SColor getTextColor() const = 0;
|
||||
|
||||
//! set the font used to draw the text
|
||||
virtual void setFont(gui::IGUIFont* font) = 0;
|
||||
|
||||
//! Get the font used to draw the text
|
||||
virtual gui::IGUIFont* getFont() const = 0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,195 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_TRIANGLE_SELECTOR_H_INCLUDED__
|
||||
#define __I_TRIANGLE_SELECTOR_H_INCLUDED__
|
||||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "triangle3d.h"
|
||||
#include "aabbox3d.h"
|
||||
#include "matrix4.h"
|
||||
#include "line3d.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
class ISceneNode;
|
||||
class ITriangleSelector;
|
||||
class IMeshBuffer;
|
||||
|
||||
//! Additional information about the triangle arrays returned by ITriangleSelector::getTriangles
|
||||
/** ITriangleSelector are free to fill out this information fully, partly or ignore it.
|
||||
Usually they will try to fill it when they can and set values to 0 otherwise.
|
||||
*/
|
||||
struct SCollisionTriangleRange
|
||||
{
|
||||
SCollisionTriangleRange()
|
||||
: RangeStart(0), RangeSize(0)
|
||||
, Selector(0), SceneNode(0)
|
||||
, MeshBuffer(0), MaterialIndex(0)
|
||||
{}
|
||||
|
||||
//! Check if this triangle index inside the range
|
||||
/**
|
||||
\param triangleIndex Index to an element inside the array of triangles returned by ITriangleSelector::getTriangles
|
||||
*/
|
||||
bool isIndexInRange(irr::u32 triangleIndex) const
|
||||
{
|
||||
return triangleIndex >= RangeStart && triangleIndex < RangeStart+RangeSize;
|
||||
}
|
||||
|
||||
//! First index in the returned triangle array for which this struct is valid
|
||||
irr::u32 RangeStart;
|
||||
|
||||
//! Number of elements in the returned triangle array for which this struct is valid (starting with RangeStart)
|
||||
irr::u32 RangeSize;
|
||||
|
||||
//! Real selector which contained those triangles (useful when working with MetaTriangleSelector)
|
||||
ITriangleSelector* Selector;
|
||||
|
||||
//! SceneNode from which the triangles are from
|
||||
ISceneNode* SceneNode;
|
||||
|
||||
//! Meshbuffer from which the triangles are from
|
||||
//! Is 0 when the ITriangleSelector doesn't support meshbuffer selection
|
||||
const IMeshBuffer* MeshBuffer;
|
||||
|
||||
//! Index of selected material in the SceneNode. Usually only valid when MeshBuffer is also set, otherwise always 0
|
||||
irr::u32 MaterialIndex;
|
||||
};
|
||||
|
||||
//! Interface to return triangles with specific properties.
|
||||
/** Every ISceneNode may have a triangle selector, available with
|
||||
ISceneNode::getTriangleSelector() or ISceneManager::createTriangleSelector.
|
||||
This is used for doing collision detection: For example if you know, that a
|
||||
collision may have happened in the area between (1,1,1) and (10,10,10), you
|
||||
can get all triangles of the scene node in this area with the
|
||||
ITriangleSelector easily and check every triangle if it collided. */
|
||||
class ITriangleSelector : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Get amount of all available triangles in this selector
|
||||
virtual s32 getTriangleCount() const = 0;
|
||||
|
||||
//! Gets the triangles for one associated node.
|
||||
/**
|
||||
This returns all triangles for one scene node associated with this
|
||||
selector. If there is more than one scene node associated (e.g. for
|
||||
an IMetaTriangleSelector) this this function may be called multiple
|
||||
times to retrieve all triangles.
|
||||
\param triangles Array where the resulting triangles will be
|
||||
written to.
|
||||
\param arraySize Size of the target array.
|
||||
\param outTriangleCount: Amount of triangles which have been written
|
||||
into the array.
|
||||
\param transform Pointer to matrix for transforming the triangles
|
||||
before they are returned. Useful for example to scale all triangles
|
||||
down into an ellipsoid space.
|
||||
\param useNodeTransform When the selector has a node then transform the
|
||||
triangles by that node's transformation matrix.
|
||||
\param outTriangleInfo When a pointer to an array is passed then that
|
||||
array is filled with additional information about the returned triangles.
|
||||
One element of SCollisionTriangleRange added for each range of triangles which
|
||||
has distinguishable information. For example one range per meshbuffer.
|
||||
*/
|
||||
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
|
||||
s32& outTriangleCount, const core::matrix4* transform=0,
|
||||
bool useNodeTransform=true,
|
||||
irr::core::array<SCollisionTriangleRange>* outTriangleInfo=0) const = 0;
|
||||
|
||||
//! Gets the triangles for one associated node which may lie within a specific bounding box.
|
||||
/**
|
||||
This returns all triangles for one scene node associated with this
|
||||
selector. If there is more than one scene node associated (e.g. for
|
||||
an IMetaTriangleSelector) this this function may be called multiple
|
||||
times to retrieve all triangles.
|
||||
|
||||
This method will return at least the triangles that intersect the box,
|
||||
but may return other triangles as well.
|
||||
\param triangles Array where the resulting triangles will be written
|
||||
to.
|
||||
\param arraySize Size of the target array.
|
||||
\param outTriangleCount Amount of triangles which have been written
|
||||
into the array.
|
||||
\param box Only triangles which are in this axis aligned bounding box
|
||||
will be written into the array.
|
||||
\param transform Pointer to matrix for transforming the triangles
|
||||
before they are returned. Useful for example to scale all triangles
|
||||
down into an ellipsoid space.
|
||||
\param useNodeTransform When the selector has a node then transform the
|
||||
triangles by that node's transformation matrix.
|
||||
\param outTriangleInfo When a pointer to an array is passed then that
|
||||
array is filled with additional information about the returned triangles.
|
||||
One element of SCollisionTriangleRange added for each range of triangles which
|
||||
has distinguishable information. For example one range per meshbuffer. */
|
||||
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
|
||||
s32& outTriangleCount, const core::aabbox3d<f32>& box,
|
||||
const core::matrix4* transform=0, bool useNodeTransform=true,
|
||||
irr::core::array<SCollisionTriangleRange>* outTriangleInfo=0) const = 0;
|
||||
|
||||
//! Gets the triangles for one associated node which have or may have contact with a 3d line.
|
||||
/**
|
||||
This returns all triangles for one scene node associated with this
|
||||
selector. If there is more than one scene node associated (e.g. for
|
||||
an IMetaTriangleSelector) this this function may be called multiple
|
||||
times to retrieve all triangles.
|
||||
|
||||
Please note that unoptimized triangle selectors also may return
|
||||
triangles which are not in contact at all with the 3d line.
|
||||
\param triangles Array where the resulting triangles will be written
|
||||
to.
|
||||
\param arraySize Size of the target array.
|
||||
\param outTriangleCount Amount of triangles which have been written
|
||||
into the array.
|
||||
\param line Only triangles which may be in contact with this 3d line
|
||||
will be written into the array.
|
||||
\param transform Pointer to matrix for transforming the triangles
|
||||
before they are returned. Useful for example to scale all triangles
|
||||
down into an ellipsoid space.
|
||||
\param useNodeTransform When the selector has a node then transform the
|
||||
triangles by that node's transformation matrix.
|
||||
\param outTriangleInfo When a pointer to an array is passed then that
|
||||
array is filled with additional information about the returned triangles.
|
||||
One element of SCollisionTriangleRange added for each range of triangles which
|
||||
has distinguishable information. For example one range per meshbuffer. */
|
||||
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
|
||||
s32& outTriangleCount, const core::line3d<f32>& line,
|
||||
const core::matrix4* transform=0, bool useNodeTransform=true,
|
||||
irr::core::array<SCollisionTriangleRange>* outTriangleInfo=0) const = 0;
|
||||
|
||||
//! Get number of TriangleSelectors that are part of this one
|
||||
/** Only useful for MetaTriangleSelector, others return 1
|
||||
*/
|
||||
virtual u32 getSelectorCount() const = 0;
|
||||
|
||||
//! Get TriangleSelector based on index based on getSelectorCount
|
||||
/** Only useful for MetaTriangleSelector, others return 'this' or 0
|
||||
*/
|
||||
virtual ITriangleSelector* getSelector(u32 index) = 0;
|
||||
|
||||
//! Get TriangleSelector based on index based on getSelectorCount
|
||||
/** Only useful for MetaTriangleSelector, others return 'this' or 0
|
||||
*/
|
||||
virtual const ITriangleSelector* getSelector(u32 index) const = 0;
|
||||
|
||||
//! Get scene node associated with a given triangle.
|
||||
/** With CMetaTriangleSelector-selectors it's possible to find out a node
|
||||
belonging to a certain triangle index.
|
||||
NOTE: triangleIndex has nothing to do with the order of triangles returned by getTriangles functions!
|
||||
So you can _not_ use this function to find out anything about to which node returned triangles belong.
|
||||
Use STriangleCollisionInfo struct for that.
|
||||
\param triangleIndex: the index of the triangle for which you want to find.
|
||||
\return The scene node associated with that triangle.
|
||||
*/
|
||||
virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const = 0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
@ -1,60 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
//
|
||||
// created by Dean Wadsworth aka Varmint Dec 31 2007
|
||||
|
||||
#ifndef __I_VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__
|
||||
#define __I_VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__
|
||||
|
||||
#include "ISceneNode.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
class IMeshBuffer;
|
||||
|
||||
class IVolumeLightSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
IVolumeLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position,
|
||||
const core::vector3df& rotation,
|
||||
const core::vector3df& scale)
|
||||
: ISceneNode(parent, mgr, id, position, rotation, scale) {};
|
||||
|
||||
//! Returns type of the scene node
|
||||
virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_VOLUME_LIGHT; }
|
||||
|
||||
//! Sets the number of segments across the U axis
|
||||
virtual void setSubDivideU(const u32 inU) =0;
|
||||
|
||||
//! Sets the number of segments across the V axis
|
||||
virtual void setSubDivideV(const u32 inV) =0;
|
||||
|
||||
//! Returns the number of segments across the U axis
|
||||
virtual u32 getSubDivideU() const =0;
|
||||
|
||||
//! Returns the number of segments across the V axis
|
||||
virtual u32 getSubDivideV() const =0;
|
||||
|
||||
//! Sets the color of the base of the light
|
||||
virtual void setFootColor(const video::SColor inColor) =0;
|
||||
|
||||
//! Sets the color of the tip of the light
|
||||
virtual void setTailColor(const video::SColor inColor) =0;
|
||||
|
||||
//! Returns the color of the base of the light
|
||||
virtual video::SColor getFootColor() const =0;
|
||||
|
||||
//! Returns the color of the tip of the light
|
||||
virtual video::SColor getTailColor() const =0;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
@ -190,12 +190,6 @@ If not defined, Windows Multimedia library is used, which offers also broad supp
|
||||
#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
|
||||
#endif
|
||||
|
||||
//! enabled Direct3D 9
|
||||
#define _IRR_COMPILE_WITH_DIRECT3D_9_
|
||||
#ifdef NO_IRR_COMPILE_WITH_DIRECT3D_9_
|
||||
#undef _IRR_COMPILE_WITH_DIRECT3D_9_
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_OPENGL_ to compile the Irrlicht engine with OpenGL.
|
||||
@ -292,21 +286,6 @@ define out. */
|
||||
|
||||
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_SOFTWARE_ to compile the Irrlicht engine with software driver
|
||||
/** If you do not need the software driver, or want to use Burning's Video instead,
|
||||
comment this define out */
|
||||
//#define _IRR_COMPILE_WITH_SOFTWARE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_SOFTWARE_
|
||||
#undef _IRR_COMPILE_WITH_SOFTWARE_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_BURNINGSVIDEO_ to compile the Irrlicht engine with Burning's video driver
|
||||
/** If you do not need this software driver, you can comment this define out. */
|
||||
//#define _IRR_COMPILE_WITH_BURNINGSVIDEO_
|
||||
#ifdef NO_IRR_COMPILE_WITH_BURNINGSVIDEO_
|
||||
#undef _IRR_COMPILE_WITH_BURNINGSVIDEO_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_X11_ to compile the Irrlicht engine with X11 support.
|
||||
/** If you do not wish the engine to be compiled with X11, comment this
|
||||
define out. */
|
||||
@ -351,13 +330,6 @@ you will not be able to use anything provided by the GUI Environment, including
|
||||
#undef _IRR_COMPILE_WITH_GUI_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_PARTICLES to compile the engine the withe build-in particle system
|
||||
/** You can disable this if you don't need particles or use an external particle system. */
|
||||
#define _IRR_COMPILE_WITH_PARTICLES_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PARTICLES_
|
||||
#undef _IRR_COMPILE_WITH_PARTICLES_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_WCHAR_FILESYSTEM to enable unicode filesystem support for the engine.
|
||||
/** This enables the engine to read/write from unicode filesystem. If you
|
||||
disable this feature, the engine behave as before (ansi). This is currently only supported
|
||||
@ -432,69 +404,9 @@ tool <http://developer.nvidia.com/object/nvperfhud_home.html>. */
|
||||
16Bit + SubPixel/SubTexel Correct + ZBuffer
|
||||
*/
|
||||
|
||||
#define BURNINGVIDEO_RENDERER_BEAUTIFUL
|
||||
//#define BURNINGVIDEO_RENDERER_FAST
|
||||
//#define BURNINGVIDEO_RENDERER_ULTRA_FAST
|
||||
//#define BURNINGVIDEO_RENDERER_CE
|
||||
|
||||
//! Uncomment the following line if you want to ignore the deprecated warnings
|
||||
//#define IGNORE_DEPRECATED_WARNING
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ to support ShadowVolumes
|
||||
#define _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_
|
||||
#undef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_OCTREE_SCENENODE_ to support OctreeSceneNodes
|
||||
#define _IRR_COMPILE_WITH_OCTREE_SCENENODE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_OCTREE_SCENENODE_
|
||||
#undef _IRR_COMPILE_WITH_OCTREE_SCENENODE_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ to support TerrainSceneNodes
|
||||
#define _IRR_COMPILE_WITH_TERRAIN_SCENENODE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_TERRAIN_SCENENODE_
|
||||
#undef _IRR_COMPILE_WITH_TERRAIN_SCENENODE_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ to support BillboardSceneNodes
|
||||
#define _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
|
||||
#undef _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_ to support WaterSurfaceSceneNodes
|
||||
#define _IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_
|
||||
#undef _IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_SKYDOME_SCENENODE_ to support SkydomeSceneNodes
|
||||
#define _IRR_COMPILE_WITH_SKYDOME_SCENENODE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_SKYDOME_SCENENODE_
|
||||
#undef _IRR_COMPILE_WITH_SKYDOME_SCENENODE_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_CUBE_SCENENODE_ to support CubeSceneNodes
|
||||
#define _IRR_COMPILE_WITH_CUBE_SCENENODE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_CUBE_SCENENODE_
|
||||
#undef _IRR_COMPILE_WITH_CUBE_SCENENODE_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_SPHERE_SCENENODE_ to support CubeSceneNodes
|
||||
#define _IRR_COMPILE_WITH_SPHERE_SCENENODE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_SPHERE_SCENENODE_
|
||||
#undef _IRR_COMPILE_WITH_SPHERE_SCENENODE_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_IRR_SCENE_LOADER_ if you want to be able to load
|
||||
/** .irr scenes using ISceneManager::loadScene */
|
||||
#define _IRR_COMPILE_WITH_IRR_SCENE_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_IRR_SCENE_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_IRR_SCENE_LOADER_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ if you want to use bone based
|
||||
/** animated meshes. If you compile without this, you will be unable to load
|
||||
B3D, MS3D or X meshes */
|
||||
@ -509,119 +421,18 @@ B3D, MS3D or X meshes */
|
||||
#ifdef NO_IRR_COMPILE_WITH_B3D_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_B3D_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_MS3D_LOADER_ if you want to Milkshape files
|
||||
#define _IRR_COMPILE_WITH_MS3D_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_MS3D_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_MS3D_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_X_LOADER_ if you want to use Microsoft X files
|
||||
#define _IRR_COMPILE_WITH_X_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_X_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_X_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_OGRE_LOADER_ if you want to load Ogre 3D files
|
||||
#define _IRR_COMPILE_WITH_OGRE_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_OGRE_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_OGRE_LOADER_
|
||||
#endif
|
||||
#endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_HALFLIFE_LOADER_ if you want to load Halflife animated files
|
||||
#define _IRR_COMPILE_WITH_HALFLIFE_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_HALFLIFE_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_HALFLIFE_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_MD2_LOADER_ if you want to load Quake 2 animated files
|
||||
#define _IRR_COMPILE_WITH_MD2_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_MD2_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_MD2_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_MD3_LOADER_ if you want to load Quake 3 animated files
|
||||
#define _IRR_COMPILE_WITH_MD3_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_MD3_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_MD3_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_3DS_LOADER_ if you want to load 3D Studio Max files
|
||||
#define _IRR_COMPILE_WITH_3DS_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_3DS_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_3DS_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_CSM_LOADER_ if you want to load Cartography Shop files
|
||||
#define _IRR_COMPILE_WITH_CSM_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_CSM_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_CSM_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_BSP_LOADER_ if you want to load Quake 3 BSP files
|
||||
#define _IRR_COMPILE_WITH_BSP_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_BSP_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_BSP_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_DMF_LOADER_ if you want to load DeleD files
|
||||
#define _IRR_COMPILE_WITH_DMF_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_DMF_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_DMF_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_LMTS_LOADER_ if you want to load LMTools files
|
||||
#define _IRR_COMPILE_WITH_LMTS_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_LMTS_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_LMTS_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_MY3D_LOADER_ if you want to load MY3D files
|
||||
#define _IRR_COMPILE_WITH_MY3D_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_MY3D_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_MY3D_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_OBJ_LOADER_ if you want to load Wavefront OBJ files
|
||||
#define _IRR_COMPILE_WITH_OBJ_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_OBJ_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_OBJ_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_OCT_LOADER_ if you want to load FSRad OCT files
|
||||
#define _IRR_COMPILE_WITH_OCT_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_OCT_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_OCT_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_LWO_LOADER_ if you want to load Lightwave3D files
|
||||
#define _IRR_COMPILE_WITH_LWO_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_LWO_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_LWO_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_STL_LOADER_ if you want to load stereolithography files
|
||||
#define _IRR_COMPILE_WITH_STL_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_STL_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_STL_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PLY_LOADER_ if you want to load Polygon (Stanford Triangle) files
|
||||
#define _IRR_COMPILE_WITH_PLY_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PLY_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_PLY_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_SMF_LOADER_ if you want to load 3D World Studio mesh files
|
||||
#define _IRR_COMPILE_WITH_SMF_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_SMF_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_SMF_LOADER_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_STL_WRITER_ if you want to write .stl files
|
||||
#define _IRR_COMPILE_WITH_STL_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_STL_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_STL_WRITER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_OBJ_WRITER_ if you want to write .obj files
|
||||
#define _IRR_COMPILE_WITH_OBJ_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_OBJ_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_OBJ_WRITER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PLY_WRITER_ if you want to write .ply files
|
||||
#define _IRR_COMPILE_WITH_PLY_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PLY_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_PLY_WRITER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_B3D_WRITER_ if you want to write .b3d files
|
||||
#define _IRR_COMPILE_WITH_B3D_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_B3D_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_B3D_WRITER_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_BMP_LOADER_ if you want to load .bmp files
|
||||
//! Disabling this loader will also disable the built-in font
|
||||
@ -634,107 +445,22 @@ B3D, MS3D or X meshes */
|
||||
#ifdef NO_IRR_COMPILE_WITH_JPG_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_JPG_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PCX_LOADER_ if you want to load .pcx files
|
||||
#define _IRR_COMPILE_WITH_PCX_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PCX_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_PCX_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PNG_LOADER_ if you want to load .png files
|
||||
#define _IRR_COMPILE_WITH_PNG_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PNG_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_PNG_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PPM_LOADER_ if you want to load .ppm/.pgm/.pbm files
|
||||
#define _IRR_COMPILE_WITH_PPM_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PPM_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_PPM_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PSD_LOADER_ if you want to load .psd files
|
||||
#define _IRR_COMPILE_WITH_PSD_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PSD_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_PSD_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PVR_LOADER_ if you want to load .pvr files
|
||||
#define _IRR_COMPILE_WITH_PVR_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PVR_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_PVR_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_DDS_LOADER_ if you want to load compressed .dds files
|
||||
// Patent problem isn't related to this loader.
|
||||
#define _IRR_COMPILE_WITH_DDS_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_DDS_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_DDS_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_DDS_DECODER_LOADER_ if you want to load .dds files
|
||||
//! loader will decompress these files and will send to the memory as uncompressed files.
|
||||
// Outcommented because
|
||||
// a) it doesn't compile on 64-bit currently
|
||||
// b) anyone enabling it should be aware that S3TC compression algorithm which might be used in that loader
|
||||
// is patented in the US by S3 and they do collect license fees when it's used in applications.
|
||||
// So if you are unfortunate enough to develop applications for US market and their broken patent system be careful.
|
||||
// #define _IRR_COMPILE_WITH_DDS_DECODER_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_DDS_DECODER_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_DDS_DECODER_LOADER_
|
||||
#endif
|
||||
#ifdef _IRR_COMPILE_WITH_DDS_DECODER_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_DDS_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_TGA_LOADER_ if you want to load .tga files
|
||||
#define _IRR_COMPILE_WITH_TGA_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_TGA_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_TGA_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_WAL_LOADER_ if you want to load .wal files
|
||||
#define _IRR_COMPILE_WITH_WAL_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_WAL_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_WAL_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_LMP_LOADER_ if you want to load .lmp files
|
||||
#define _IRR_COMPILE_WITH_LMP_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_LMP_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_LMP_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_RGB_LOADER_ if you want to load Silicon Graphics .rgb/.rgba/.sgi/.int/.inta/.bw files
|
||||
#define _IRR_COMPILE_WITH_RGB_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_RGB_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_RGB_LOADER_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_BMP_WRITER_ if you want to write .bmp files
|
||||
#define _IRR_COMPILE_WITH_BMP_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_BMP_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_BMP_WRITER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_JPG_WRITER_ if you want to write .jpg files
|
||||
#define _IRR_COMPILE_WITH_JPG_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_JPG_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_JPG_WRITER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PCX_WRITER_ if you want to write .pcx files
|
||||
#define _IRR_COMPILE_WITH_PCX_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PCX_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_PCX_WRITER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PNG_WRITER_ if you want to write .png files
|
||||
#define _IRR_COMPILE_WITH_PNG_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PNG_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_PNG_WRITER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PPM_WRITER_ if you want to write .ppm files
|
||||
#define _IRR_COMPILE_WITH_PPM_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PPM_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_PPM_WRITER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PSD_WRITER_ if you want to write .psd files
|
||||
#define _IRR_COMPILE_WITH_PSD_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PSD_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_PSD_WRITER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_TGA_WRITER_ if you want to write .tga files
|
||||
#define _IRR_COMPILE_WITH_TGA_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_TGA_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_TGA_WRITER_
|
||||
#endif
|
||||
|
||||
//! Define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ if you want to open ZIP and GZIP archives
|
||||
/** ZIP reading has several more options below to configure. */
|
||||
@ -758,26 +484,6 @@ ones. */
|
||||
#ifdef NO__IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
|
||||
#undef __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
|
||||
#endif
|
||||
//! Define __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ if you want to open ID software PAK archives
|
||||
#define __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_
|
||||
#ifdef NO__IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_
|
||||
#undef __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_
|
||||
#endif
|
||||
//! Define __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ if you want to open Nebula Device NPK archives
|
||||
#define __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_
|
||||
#ifdef NO__IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_
|
||||
#undef __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_
|
||||
#endif
|
||||
//! Define __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ if you want to open TAR archives
|
||||
#define __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_
|
||||
#ifdef NO__IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_
|
||||
#undef __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_
|
||||
#endif
|
||||
//! Define __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ if you want to open WAD archives
|
||||
#define __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_
|
||||
#ifdef NO__IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_
|
||||
#undef __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_
|
||||
#endif
|
||||
|
||||
// Some cleanup and standard stuff
|
||||
|
||||
|
@ -368,20 +368,7 @@ namespace video
|
||||
The specular color of the dynamic lights
|
||||
(SLight::SpecularColor) will influence the the highlight color
|
||||
too, but they are set to a useful value by default when
|
||||
creating the light scene node. Here is a simple example on how
|
||||
to use specular highlights:
|
||||
\code
|
||||
// load and display mesh
|
||||
scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(
|
||||
smgr->getMesh("data/faerie.md2"));
|
||||
node->setMaterialTexture(0, driver->getTexture("data/Faerie2.pcx")); // set diffuse texture
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, true); // enable dynamic lighting
|
||||
node->getMaterial(0).Shininess = 20.0f; // set size of specular highlights
|
||||
|
||||
// add white light
|
||||
scene::ILightSceneNode* light = smgr->addLightSceneNode(0,
|
||||
core::vector3df(5,5,5), video::SColorf(1.0f, 1.0f, 1.0f));
|
||||
\endcode */
|
||||
creating the light scene node.*/
|
||||
f32 Shininess;
|
||||
|
||||
//! Free parameter, dependent on the material type.
|
||||
|
@ -49,19 +49,16 @@
|
||||
#include "EMaterialTypes.h"
|
||||
#include "EMeshWriterEnums.h"
|
||||
#include "EMessageBoxFlags.h"
|
||||
#include "ESceneNodeAnimatorTypes.h"
|
||||
// #include "ESceneNodeAnimatorTypes.h"
|
||||
#include "ESceneNodeTypes.h"
|
||||
#include "ETerrainElements.h"
|
||||
#include "fast_atof.h"
|
||||
#include "heapsort.h"
|
||||
#include "IAnimatedMesh.h"
|
||||
#include "IAnimatedMeshMD2.h"
|
||||
#include "IAnimatedMeshMD3.h"
|
||||
#include "IAnimatedMeshSceneNode.h"
|
||||
#include "IAttributeExchangingObject.h"
|
||||
#include "IAttributes.h"
|
||||
#include "IBillboardSceneNode.h"
|
||||
#include "IBillboardTextSceneNode.h"
|
||||
#include "IBoneSceneNode.h"
|
||||
#include "ICameraSceneNode.h"
|
||||
#include "IContextManager.h"
|
||||
@ -71,7 +68,6 @@
|
||||
#include "IEventReceiver.h"
|
||||
#include "IFileList.h"
|
||||
#include "IFileSystem.h"
|
||||
#include "IGeometryCreator.h"
|
||||
#include "IGPUProgrammingServices.h"
|
||||
#include "IGUIButton.h"
|
||||
#include "IGUICheckBox.h"
|
||||
@ -104,7 +100,6 @@
|
||||
#include "IImageLoader.h"
|
||||
#include "IImageWriter.h"
|
||||
#include "IIndexBuffer.h"
|
||||
#include "ILightSceneNode.h"
|
||||
#include "ILogger.h"
|
||||
#include "IMaterialRenderer.h"
|
||||
#include "IMaterialRendererServices.h"
|
||||
@ -115,12 +110,7 @@
|
||||
#include "IMeshManipulator.h"
|
||||
#include "IMeshSceneNode.h"
|
||||
#include "IMeshWriter.h"
|
||||
#include "IOctreeSceneNode.h"
|
||||
#include "IMetaTriangleSelector.h"
|
||||
#include "IOSOperator.h"
|
||||
#include "IParticleSystemSceneNode.h" // also includes all emitters and attractors
|
||||
#include "IQ3LevelMesh.h"
|
||||
#include "IQ3Shader.h"
|
||||
#include "IReadFile.h"
|
||||
#include "IReferenceCounted.h"
|
||||
#include "irrArray.h"
|
||||
@ -133,31 +123,19 @@
|
||||
#include "irrString.h"
|
||||
#include "irrTypes.h"
|
||||
#include "path.h"
|
||||
#include "ISceneCollisionManager.h"
|
||||
#include "ISceneLoader.h"
|
||||
#include "ISceneManager.h"
|
||||
#include "ISceneNode.h"
|
||||
#include "ISceneNodeAnimator.h"
|
||||
#include "ISceneNodeAnimatorCameraFPS.h"
|
||||
#include "ISceneNodeAnimatorCameraMaya.h"
|
||||
#include "ISceneNodeAnimatorCollisionResponse.h"
|
||||
#include "ISceneNodeAnimatorFactory.h"
|
||||
#include "ISceneNodeFactory.h"
|
||||
#include "ISceneUserDataSerializer.h"
|
||||
#include "IShaderConstantSetCallBack.h"
|
||||
#include "IShadowVolumeSceneNode.h"
|
||||
#include "ISkinnedMesh.h"
|
||||
#include "ITerrainSceneNode.h"
|
||||
#include "ITextSceneNode.h"
|
||||
#include "ITexture.h"
|
||||
#include "ITimer.h"
|
||||
#include "ITriangleSelector.h"
|
||||
#include "IVertexBuffer.h"
|
||||
#include "IVideoDriver.h"
|
||||
#include "IVideoModeList.h"
|
||||
#include "IVolumeLightSceneNode.h"
|
||||
#include "IWriteFile.h"
|
||||
#include "ILightManager.h"
|
||||
#include "Keycodes.h"
|
||||
#include "line2d.h"
|
||||
#include "line3d.h"
|
||||
|
Reference in New Issue
Block a user