Some whitespace adjustment.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4500 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
6d6b243924
commit
9f7227b7ad
|
@ -29,7 +29,7 @@ namespace scene
|
|||
"box", // camera box against node box
|
||||
"frustum_box", // camera frustum against node box
|
||||
"frustum_sphere", // camera frustum against node sphere
|
||||
"occ_query", // occlusion query
|
||||
"occ_query", // occlusion query
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace scene
|
|||
enum ESCENE_NODE_TYPE
|
||||
{
|
||||
//! of type CSceneManager (note that ISceneManager is not(!) an ISceneNode)
|
||||
ESNT_SCENE_MANAGER = MAKE_IRR_ID('s','m','n','g'),
|
||||
ESNT_SCENE_MANAGER = MAKE_IRR_ID('s','m','n','g'),
|
||||
|
||||
//! simple cube scene node
|
||||
ESNT_CUBE = MAKE_IRR_ID('c','u','b','e'),
|
||||
|
|
|
@ -80,17 +80,17 @@ namespace scene
|
|||
//! 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;
|
||||
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
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace scene
|
|||
/** If the camera's target and rotation are bound ( @see
|
||||
bindTargetAndRotation() ) then calling this will also change
|
||||
the camera's scene node rotation to match the target.
|
||||
Note that setTarget uses the current absolute position
|
||||
Note that setTarget uses the current absolute position
|
||||
internally, so if you changed setPosition since last rendering you must
|
||||
call updateAbsolutePosition before using this function.
|
||||
\param pos Look at target of the camera, in world co-ordinates. */
|
||||
|
@ -179,7 +179,7 @@ namespace scene
|
|||
|
||||
if (!out)
|
||||
return;
|
||||
out->addBool ("IsOrthogonal", IsOrthogonal );
|
||||
out->addBool("IsOrthogonal", IsOrthogonal);
|
||||
}
|
||||
|
||||
//! Reads attributes of the camera node
|
||||
|
|
|
@ -24,12 +24,12 @@ namespace scene
|
|||
{
|
||||
//! Blinn-phong which is default for opengl and dx fixed function pipelines.
|
||||
//! But several well-known renderers don't support it and prefer phong.
|
||||
ECTF_BLINN,
|
||||
ECTF_BLINN,
|
||||
//! Phong shading, default in many external renderers.
|
||||
ECTF_PHONG,
|
||||
//! diffuse shaded surface that is independent of lighting.
|
||||
ECTF_LAMBERT,
|
||||
// constantly shaded surface that is independent of lighting.
|
||||
// constantly shaded surface that is independent of lighting.
|
||||
ECTF_CONSTANT
|
||||
};
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace scene
|
|||
//! default - only alpha channel of color or texture is used.
|
||||
ECOF_A_ONE = 0,
|
||||
|
||||
//! Alpha values for each RGB channel of color or texture are used.
|
||||
//! Alpha values for each RGB channel of color or texture are used.
|
||||
ECOF_RGB_ZERO = 1
|
||||
};
|
||||
|
||||
|
@ -80,7 +80,7 @@ namespace scene
|
|||
enum E_COLLADA_GEOMETRY_WRITING
|
||||
{
|
||||
//! Default - write each mesh exactly once to collada. Optimal but will not work with many tools.
|
||||
ECGI_PER_MESH,
|
||||
ECGI_PER_MESH,
|
||||
|
||||
//! Write each mesh as often as it's used with different materials-names in the scene.
|
||||
//! Material names which are used here are created on export, so using the IColladaMeshWriterNames
|
||||
|
@ -92,25 +92,25 @@ namespace scene
|
|||
class IColladaMeshWriterProperties : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
virtual ~IColladaMeshWriterProperties () {}
|
||||
virtual ~IColladaMeshWriterProperties () {}
|
||||
|
||||
//! Which lighting model should be used in the technique (FX) section when exporting effects (materials)
|
||||
virtual E_COLLADA_TECHNIQUE_FX getTechniqueFx(const video::SMaterial& material) const = 0;
|
||||
|
||||
//! Which texture index should be used when writing the texture of the given sampler color.
|
||||
/** \return the index to the texture-layer or -1 if that texture should never be exported
|
||||
/** \return the index to the texture-layer or -1 if that texture should never be exported
|
||||
Note: for ECCS_TRANSPARENT by default the alpha channel is used, if you want to use RGB you have to set
|
||||
also the ECOF_RGB_ZERO flag in getTransparentFx. */
|
||||
virtual s32 getTextureIdx(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
|
||||
|
||||
//! Return which color from Irrlicht should be used for the color requested by collada
|
||||
/** Note that collada allows exporting either texture or color, not both.
|
||||
/** Note that collada allows exporting either texture or color, not both.
|
||||
So color mapping is only checked if we have no valid texture already.
|
||||
By default we try to return best fits when possible. For example ECCS_DIFFUSE is mapped to ECIC_DIFFUSE.
|
||||
When ECIC_CUSTOM is returned then the result of getCustomColor will be used. */
|
||||
virtual E_COLLADA_IRR_COLOR getColorMapping(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
|
||||
|
||||
//! Return custom colors for certain color types requested by collada.
|
||||
//! Return custom colors for certain color types requested by collada.
|
||||
/** Only used when getColorMapping returns ECIC_CUSTOM for the same paramters. */
|
||||
virtual video::SColor getCustomColor(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
|
||||
|
||||
|
@ -118,18 +118,18 @@ namespace scene
|
|||
/** Not this is only about ECCS_TRANSPARENT and does not affect getTransparency. */
|
||||
virtual E_COLLADA_TRANSPARENT_FX getTransparentFx(const video::SMaterial& material) const = 0;
|
||||
|
||||
//! Transparency value for that material.
|
||||
//! Transparency value for that material.
|
||||
/** This value is additional to transparent settings, if both are set they will be multiplicated.
|
||||
\return 1.0 for fully transparent, 0.0 for not transparent and not written at all when < 0.f */
|
||||
virtual f32 getTransparency(const video::SMaterial& material) const = 0;
|
||||
|
||||
//! Reflectivity value for that material
|
||||
/** The amount of perfect mirror reflection to be added to the reflected light
|
||||
/** The amount of perfect mirror reflection to be added to the reflected light
|
||||
\return 0.0 - 1.0 for reflectivity and element is not written at all when < 0.f */
|
||||
virtual f32 getReflectivity(const video::SMaterial& material) const = 0;
|
||||
|
||||
//! Return index of refraction for that material
|
||||
/** By default we don't write that.
|
||||
/** By default we don't write that.
|
||||
\return a value greater equal 0.f to write \<index_of_refraction\> when it is lesser than 0 nothing will be written */
|
||||
virtual f32 getIndexOfRefraction(const video::SMaterial& material) const = 0;
|
||||
|
||||
|
@ -137,7 +137,7 @@ namespace scene
|
|||
//! By default all visible nodes are exported.
|
||||
virtual bool isExportable(const irr::scene::ISceneNode * node) const = 0;
|
||||
|
||||
//! Return the mesh for the given node. If it has no mesh or shouldn't export it's mesh
|
||||
//! Return the mesh for the given node. If it has no mesh or shouldn't export it's mesh
|
||||
//! you can return 0 in which case only the transformation matrix of the node will be used.
|
||||
// TODO: Function is not const because there is no const getMesh() function for several Irrlicht nodes.
|
||||
virtual IMesh* getMesh(irr::scene::ISceneNode * node) = 0;
|
||||
|
@ -158,40 +158,40 @@ namespace scene
|
|||
class IColladaMeshWriterNames : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
virtual ~IColladaMeshWriterNames () {}
|
||||
|
||||
//! Return a unique name for the given mesh
|
||||
/** Note that names really must be unique here per mesh-pointer, so
|
||||
mostly it's a good idea to return the nameForMesh from
|
||||
IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow
|
||||
the xs::NCName standard to be valid, you can run them through
|
||||
/** Note that names really must be unique here per mesh-pointer, so
|
||||
mostly it's a good idea to return the nameForMesh from
|
||||
IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow
|
||||
the xs::NCName standard to be valid, you can run them through
|
||||
IColladaMeshWriter::toNCName to ensure that.
|
||||
\param mesh Pointer to the mesh which needs a name
|
||||
\param instance When E_COLLADA_GEOMETRY_WRITING is not ECGI_PER_MESH then
|
||||
\param instance When E_COLLADA_GEOMETRY_WRITING is not ECGI_PER_MESH then
|
||||
several instances of the same mesh can be written and this counts them.
|
||||
*/
|
||||
virtual irr::core::stringw nameForMesh(const scene::IMesh* mesh, int instance) = 0;
|
||||
|
||||
//! Return a unique name for the given node
|
||||
/** Note that names really must be unique here per node-pointer, so
|
||||
mostly it's a good idea to return the nameForNode from
|
||||
IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow
|
||||
the xs::NCName standard to be valid, you can run them through
|
||||
/** Note that names really must be unique here per node-pointer, so
|
||||
mostly it's a good idea to return the nameForNode from
|
||||
IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow
|
||||
the xs::NCName standard to be valid, you can run them through
|
||||
IColladaMeshWriter::toNCName to ensure that.
|
||||
*/
|
||||
virtual irr::core::stringw nameForNode(const scene::ISceneNode* node) = 0;
|
||||
|
||||
//! Return a name for the material
|
||||
/** There is one material created in the writer for each unique name.
|
||||
So you can use this to control the number of materials which get written.
|
||||
/** There is one material created in the writer for each unique name.
|
||||
So you can use this to control the number of materials which get written.
|
||||
For example Irrlicht does by default write one material for each material
|
||||
instanced by a node. So if you know that in your application material
|
||||
instances per node are identical between different nodes you can reduce
|
||||
the number of exported materials using that knowledge by using identical
|
||||
names for such shared materials.
|
||||
Names must follow the xs::NCName standard to be valid, you can run them
|
||||
through IColladaMeshWriter::toNCName to ensure that.
|
||||
instanced by a node. So if you know that in your application material
|
||||
instances per node are identical between different nodes you can reduce
|
||||
the number of exported materials using that knowledge by using identical
|
||||
names for such shared materials.
|
||||
Names must follow the xs::NCName standard to be valid, you can run them
|
||||
through IColladaMeshWriter::toNCName to ensure that.
|
||||
*/
|
||||
virtual irr::core::stringw nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node) = 0;
|
||||
};
|
||||
|
@ -202,7 +202,7 @@ namespace scene
|
|||
{
|
||||
public:
|
||||
|
||||
IColladaMeshWriter()
|
||||
IColladaMeshWriter()
|
||||
: Properties(0), DefaultProperties(0), NameGenerator(0), DefaultNameGenerator(0)
|
||||
, WriteTextures(true), WriteDefaultScene(true), ExportSMaterialOnce(true)
|
||||
, AmbientLight(0.f, 0.f, 0.f, 1.f)
|
||||
|
@ -211,7 +211,7 @@ namespace scene
|
|||
}
|
||||
|
||||
//! Destructor
|
||||
virtual ~IColladaMeshWriter()
|
||||
virtual ~IColladaMeshWriter()
|
||||
{
|
||||
if ( Properties )
|
||||
Properties->drop();
|
||||
|
@ -234,7 +234,7 @@ namespace scene
|
|||
}
|
||||
|
||||
//! Get if texture information should be written
|
||||
virtual bool getWriteTextures() const
|
||||
virtual bool getWriteTextures() const
|
||||
{
|
||||
return WriteTextures;
|
||||
}
|
||||
|
@ -271,11 +271,11 @@ namespace scene
|
|||
/** Optimally ECGI_PER_MESH would be always sufficent - writing geometry once per mesh.
|
||||
Unfortunately many tools (at the time of writing this nearly all of them) have trouble
|
||||
on import when different materials are used per node. So when you override materials
|
||||
per node and importing the resuling collada has materials problems in other tools try
|
||||
using other values here.
|
||||
\param writeStyle One of the E_COLLADA_GEOMETRY_WRITING settings.
|
||||
per node and importing the resuling collada has materials problems in other tools try
|
||||
using other values here.
|
||||
\param writeStyle One of the E_COLLADA_GEOMETRY_WRITING settings.
|
||||
*/
|
||||
virtual void setGeometryWriting(E_COLLADA_GEOMETRY_WRITING writeStyle)
|
||||
virtual void setGeometryWriting(E_COLLADA_GEOMETRY_WRITING writeStyle)
|
||||
{
|
||||
GeometryWriting = writeStyle;
|
||||
}
|
||||
|
@ -287,10 +287,10 @@ namespace scene
|
|||
}
|
||||
|
||||
//! Make certain there is only one collada material generated per Irrlicht material
|
||||
/** Checks before creating a collada material-name if an identical
|
||||
irr:::video::SMaterial has been exported already. If so don't export it with
|
||||
/** Checks before creating a collada material-name if an identical
|
||||
irr:::video::SMaterial has been exported already. If so don't export it with
|
||||
another name. This is set by default and leads to way smaller .dae files.
|
||||
Note that if you need to disable this flag for some reason you can still
|
||||
Note that if you need to disable this flag for some reason you can still
|
||||
get a similar effect using the IColladaMeshWriterNames::nameForMaterial
|
||||
by returning identical names for identical materials there.
|
||||
*/
|
||||
|
@ -305,13 +305,13 @@ namespace scene
|
|||
}
|
||||
|
||||
//! Set properties to use by the meshwriter instead of it's default properties.
|
||||
/** Overloading properties with an own class allows modifying the writing process in certain ways.
|
||||
/** Overloading properties with an own class allows modifying the writing process in certain ways.
|
||||
By default properties are set to the DefaultProperties. */
|
||||
virtual void setProperties(IColladaMeshWriterProperties * p)
|
||||
{
|
||||
if ( p == Properties )
|
||||
return;
|
||||
if ( p )
|
||||
if ( p )
|
||||
p->grab();
|
||||
if ( Properties )
|
||||
Properties->drop();
|
||||
|
@ -324,19 +324,19 @@ namespace scene
|
|||
return Properties;
|
||||
}
|
||||
|
||||
//! Return the original default properties of the writer.
|
||||
//! Return the original default properties of the writer.
|
||||
/** You can use this pointer in your own properties to access and return default values. */
|
||||
IColladaMeshWriterProperties * getDefaultProperties() const
|
||||
{
|
||||
return DefaultProperties;
|
||||
IColladaMeshWriterProperties * getDefaultProperties() const
|
||||
{
|
||||
return DefaultProperties;
|
||||
}
|
||||
|
||||
//! Install a generator to create custom names on export.
|
||||
//! Install a generator to create custom names on export.
|
||||
virtual void setNameGenerator(IColladaMeshWriterNames * nameGenerator)
|
||||
{
|
||||
if ( nameGenerator == NameGenerator )
|
||||
return;
|
||||
if ( nameGenerator )
|
||||
if ( nameGenerator )
|
||||
nameGenerator->grab();
|
||||
if ( NameGenerator )
|
||||
NameGenerator->drop();
|
||||
|
@ -349,11 +349,11 @@ namespace scene
|
|||
return NameGenerator;
|
||||
}
|
||||
|
||||
//! Return the original default name generator of the writer.
|
||||
//! Return the original default name generator of the writer.
|
||||
/** You can use this pointer in your own generator to access and return default values. */
|
||||
IColladaMeshWriterNames * getDefaultNameGenerator() const
|
||||
{
|
||||
return DefaultNameGenerator;
|
||||
IColladaMeshWriterNames * getDefaultNameGenerator() const
|
||||
{
|
||||
return DefaultNameGenerator;
|
||||
}
|
||||
|
||||
//! Restrict the characters of oldString a set of allowed characters in xs::NCName and add the prefix.
|
||||
|
@ -361,8 +361,8 @@ namespace scene
|
|||
virtual irr::core::stringw toNCName(const irr::core::stringw& oldString, const irr::core::stringw& prefix=irr::core::stringw(L"_NC_")) const = 0;
|
||||
|
||||
//! After export you can find out which name had been used for writing the geometry for this node.
|
||||
/** The name comes from IColladaMeshWriterNames::nameForMesh, but you can't access the node there.
|
||||
\return Either a pointer to the name or NULL */
|
||||
/** The name comes from IColladaMeshWriterNames::nameForMesh, but you can't access the node there.
|
||||
\return Either a pointer to the name or NULL */
|
||||
// TODO: Function is not const because there is no const getMesh() function for several Irrlicht nodes.
|
||||
virtual const irr::core::stringw* findGeometryNameForNode(ISceneNode* node) = 0;
|
||||
|
||||
|
@ -373,7 +373,7 @@ namespace scene
|
|||
{
|
||||
if ( p == DefaultProperties )
|
||||
return;
|
||||
if ( p )
|
||||
if ( p )
|
||||
p->grab();
|
||||
if ( DefaultProperties )
|
||||
DefaultProperties->drop();
|
||||
|
@ -385,7 +385,7 @@ namespace scene
|
|||
{
|
||||
if ( p == DefaultNameGenerator )
|
||||
return;
|
||||
if ( p )
|
||||
if ( p )
|
||||
p->grab();
|
||||
if ( DefaultNameGenerator )
|
||||
DefaultNameGenerator->drop();
|
||||
|
|
|
@ -20,19 +20,19 @@ namespace gui
|
|||
enum ECURSOR_ICON
|
||||
{
|
||||
// Following cursors might be system specific, or might use an Irrlicht icon-set. No guarantees so far.
|
||||
ECI_NORMAL, // arrow
|
||||
ECI_CROSS, // Crosshair
|
||||
ECI_HAND, // Hand
|
||||
ECI_HELP, // Arrow and question mark
|
||||
ECI_IBEAM, // typical text-selection cursor
|
||||
ECI_NO, // should not click icon
|
||||
ECI_WAIT, // hourclass
|
||||
ECI_SIZEALL, // arrow in all directions
|
||||
ECI_NORMAL, // arrow
|
||||
ECI_CROSS, // Crosshair
|
||||
ECI_HAND, // Hand
|
||||
ECI_HELP, // Arrow and question mark
|
||||
ECI_IBEAM, // typical text-selection cursor
|
||||
ECI_NO, // should not click icon
|
||||
ECI_WAIT, // hourclass
|
||||
ECI_SIZEALL, // arrow in all directions
|
||||
ECI_SIZENESW, // resizes in direction north-east or south-west
|
||||
ECI_SIZENWSE, // resizes in direction north-west or south-east
|
||||
ECI_SIZENS, // resizes in direction north or south
|
||||
ECI_SIZEWE, // resizes in direction west or east
|
||||
ECI_UP, // up-arrow
|
||||
ECI_SIZENWSE, // resizes in direction north-west or south-east
|
||||
ECI_SIZENS, // resizes in direction north or south
|
||||
ECI_SIZEWE, // resizes in direction west or east
|
||||
ECI_UP, // up-arrow
|
||||
|
||||
// Implementer note: Should we add system specific cursors, which use guaranteed the system icons,
|
||||
// then I would recommend using a naming scheme like ECI_W32_CROSS, ECI_X11_CROSSHAIR and adding those
|
||||
|
|
|
@ -216,7 +216,7 @@ namespace irr
|
|||
//! The text in an editbox was changed. This does not include automatic changes in text-breaking.
|
||||
EGET_EDITBOX_CHANGED,
|
||||
|
||||
//! The marked area in an editbox was changed.
|
||||
//! The marked area in an editbox was changed.
|
||||
EGET_EDITBOX_MARKING_CHANGED,
|
||||
|
||||
//! The tab was changed in an tab control
|
||||
|
@ -345,7 +345,7 @@ struct SEvent
|
|||
{
|
||||
NUMBER_OF_BUTTONS = 32,
|
||||
|
||||
AXIS_X = 0, // e.g. analog stick 1 left to right
|
||||
AXIS_X = 0, // e.g. analog stick 1 left to right
|
||||
AXIS_Y, // e.g. analog stick 1 top to bottom
|
||||
AXIS_Z, // e.g. throttle, or analog 2 stick 2 left to right
|
||||
AXIS_R, // e.g. rudder, or analog 2 stick 2 top to bottom
|
||||
|
@ -454,18 +454,18 @@ struct SJoystickInfo
|
|||
/** This is an internal Irrlicht index; it does not map directly
|
||||
* to any particular hardware joystick. It corresponds to the
|
||||
* irr::SJoystickEvent Joystick ID. */
|
||||
u8 Joystick;
|
||||
u8 Joystick;
|
||||
|
||||
//! The name that the joystick uses to identify itself.
|
||||
core::stringc Name;
|
||||
core::stringc Name;
|
||||
|
||||
//! The number of buttons that the joystick has.
|
||||
u32 Buttons;
|
||||
u32 Buttons;
|
||||
|
||||
//! The number of axes that the joystick has, i.e. X, Y, Z, R, U, V.
|
||||
/** Note: with a Linux device, the POV hat (if any) will use two axes. These
|
||||
* will be included in this count. */
|
||||
u32 Axes;
|
||||
u32 Axes;
|
||||
|
||||
//! An indication of whether the joystick has a POV hat.
|
||||
/** A Windows device will identify the presence or absence or the POV hat. A
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace gui
|
|||
//! call setVisible(false)
|
||||
ECMC_HIDE = 2
|
||||
|
||||
// note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags.
|
||||
// note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags.
|
||||
};
|
||||
|
||||
//! GUI Context menu interface.
|
||||
|
@ -64,10 +64,10 @@ namespace gui
|
|||
virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true,
|
||||
bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
|
||||
|
||||
//! Insert a menu item at specified position.
|
||||
/** \param idx: Position to insert the new element,
|
||||
should be smaller than itemcount otherwise the item is added to the end.
|
||||
\param text: Text of menu item. Set this to 0 to create
|
||||
//! Insert a menu item at specified position.
|
||||
/** \param idx: Position to insert the new element,
|
||||
should be smaller than itemcount otherwise the item is added to the end.
|
||||
\param text: Text of menu item. Set this to 0 to create
|
||||
an separator instead of a real item, which is the same like
|
||||
calling addSeparator();
|
||||
\param commandId: Command id of menu item, a simple id you may
|
||||
|
@ -81,11 +81,11 @@ namespace gui
|
|||
virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId=-1, bool enabled=true,
|
||||
bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
|
||||
|
||||
//! Find an item by it's CommandID
|
||||
//! Find an item by its CommandID
|
||||
/**
|
||||
\param commandId: We are looking for the first item which has this commandID
|
||||
\param idxStartSearch: Start searching from this index.
|
||||
\return Returns the index of the item when found or otherwise -1. */
|
||||
\return Returns the index of the item when found or otherwise -1. */
|
||||
virtual s32 findItemWithCommandId(s32 commandId, u32 idxStartSearch=0) const = 0;
|
||||
|
||||
//! Adds a separator item to the menu
|
||||
|
|
|
@ -134,11 +134,11 @@ namespace gui
|
|||
//! Returns maximum amount of characters, previously set by setMax();
|
||||
virtual u32 getMax() const = 0;
|
||||
|
||||
//! Set the character used for the cursor.
|
||||
//! Set the character used for the cursor.
|
||||
/** By default it's "_" */
|
||||
virtual void setCursorChar(const wchar_t cursorChar) = 0;
|
||||
|
||||
//! Get the character used for the cursor.
|
||||
//! Get the character used for the cursor.
|
||||
virtual wchar_t getCursorChar() const = 0;
|
||||
|
||||
//! Set the blinktime for the cursor. 2x blinktime is one full cycle.
|
||||
|
@ -146,8 +146,7 @@ namespace gui
|
|||
virtual void setCursorBlinkTime(irr::u32 timeMs) = 0;
|
||||
|
||||
//! Get the cursor blinktime
|
||||
virtual irr::u32 getCursorBlinkTime() const = 0;
|
||||
|
||||
virtual irr::u32 getCursorBlinkTime() const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -564,7 +564,7 @@ public:
|
|||
virtual bool sendToBack(IGUIElement* child)
|
||||
{
|
||||
core::list<IGUIElement*>::Iterator it = Children.begin();
|
||||
if (child == (*it)) // already there
|
||||
if (child == (*it)) // already there
|
||||
return true;
|
||||
for (; it != Children.end(); ++it)
|
||||
{
|
||||
|
@ -748,7 +748,7 @@ public:
|
|||
{
|
||||
return GUIElementTypeNames[Type];
|
||||
}
|
||||
|
||||
|
||||
//! Returns the name of the element.
|
||||
/** \return Name as character string. */
|
||||
virtual const c8* getName() const
|
||||
|
@ -778,7 +778,7 @@ public:
|
|||
scripting languages, editors, debuggers or xml serialization purposes. */
|
||||
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
|
||||
{
|
||||
out->addString("Name", Name.c_str());
|
||||
out->addString("Name", Name.c_str());
|
||||
out->addInt("Id", ID );
|
||||
out->addString("Caption", getText());
|
||||
out->addRect("Rect", DesiredRect);
|
||||
|
@ -1017,7 +1017,7 @@ protected:
|
|||
|
||||
//! tooltip
|
||||
core::stringw ToolTipText;
|
||||
|
||||
|
||||
//! users can set this for identificating the element by string
|
||||
core::stringc Name;
|
||||
|
||||
|
|
|
@ -87,8 +87,8 @@ public:
|
|||
virtual IGUIElement* getFocus() const = 0;
|
||||
|
||||
//! Returns the element which was last under the mouse cursor
|
||||
/** NOTE: This information is updated _after_ the user-eventreceiver
|
||||
received it's mouse-events. To find the hovered element while catching
|
||||
/** NOTE: This information is updated _after_ the user-eventreceiver
|
||||
received it's mouse-events. To find the hovered element while catching
|
||||
mouse events you have to use instead:
|
||||
IGUIEnvironment::getRootGUIElement()->getElementFromPoint(mousePos);
|
||||
\return Pointer to the element under the mouse. */
|
||||
|
@ -215,7 +215,7 @@ public:
|
|||
//! Returns the root gui element.
|
||||
/** This is the first gui element, the (direct or indirect) parent of all
|
||||
other gui elements. It is a valid IGUIElement, with dimensions the same
|
||||
size as the screen.
|
||||
size as the screen.
|
||||
\return Pointer to the root element of the GUI. The returned pointer
|
||||
should not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
|
@ -584,8 +584,8 @@ public:
|
|||
|
||||
//! Loads the gui. Note that the current gui is not cleared before.
|
||||
/** When a parent is set the elements will be added below the parent, the parent itself does not deserialize.
|
||||
When the file contains skin-settings from the gui-environment those are always serialized into the
|
||||
guienvironment independent of the parent setting.
|
||||
When the file contains skin-settings from the gui-environment those are always serialized into the
|
||||
guienvironment independent of the parent setting.
|
||||
\param filename Name of the file.
|
||||
\param parent Parent for the loaded GUI, root if 0.
|
||||
\return True if loading succeeded, else false. */
|
||||
|
@ -593,8 +593,8 @@ public:
|
|||
|
||||
//! Loads the gui. Note that the current gui is not cleared before.
|
||||
/** When a parent is set the elements will be added below the parent, the parent itself does not deserialize.
|
||||
When the file contains skin-settings from the gui-environment those are always serialized into the
|
||||
guienvironment independent of the parent setting.
|
||||
When the file contains skin-settings from the gui-environment those are always serialized into the
|
||||
guienvironment independent of the parent setting.
|
||||
\param file The file to load from.
|
||||
\param parent Parent for the loaded GUI, root if 0.
|
||||
\return True if loading succeeded, else false. */
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace gui
|
|||
virtual bool hasChildren() const = 0;
|
||||
|
||||
//! returns true if this node has child nodes
|
||||
/** \deprecated Deprecated in 1.8, use hasChildren() instead.
|
||||
/** \deprecated Deprecated in 1.8, use hasChildren() instead.
|
||||
This method may be removed by Irrlicht 1.9 */
|
||||
_IRR_DEPRECATED_ bool hasChilds() const
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace gui
|
|||
So to get absolute positions you have to add the resulting rectangle to getAbsolutePosition().UpperLeftCorner.<br>
|
||||
To get it relative to the parent element you have to add the resulting rectangle to getRelativePosition().UpperLeftCorner.
|
||||
Beware that adding a menu will not change the clientRect as menus are own gui elements, so in that case you might want to subtract
|
||||
the menu area additionally. */
|
||||
the menu area additionally. */
|
||||
virtual core::rect<s32> getClientRect() const = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace scene
|
|||
}
|
||||
|
||||
//! Renames a loaded mesh.
|
||||
/** \deprecated Use renameMesh() instead. This method may be removed by
|
||||
/** \deprecated Use renameMesh() instead. This method may be removed by
|
||||
Irrlicht 1.9 */
|
||||
_IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename)
|
||||
{
|
||||
|
@ -125,12 +125,12 @@ namespace scene
|
|||
|
||||
//! Get the name of a loaded mesh, based on its index.
|
||||
/** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
|
||||
\return The name if mesh was found and has a name, else the path is empty. */
|
||||
\return The name if mesh was found and has a name, else the path is empty. */
|
||||
virtual const io::SNamedPath& getMeshName(u32 index) const = 0;
|
||||
|
||||
//! Get the name of the loaded mesh if there is any.
|
||||
/** \param mesh Pointer to mesh to query.
|
||||
\return The name if mesh was found and has a name, else the path is empty. */
|
||||
\return The name if mesh was found and has a name, else the path is empty. */
|
||||
virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0;
|
||||
|
||||
//! Renames a loaded mesh.
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace scene
|
|||
}
|
||||
|
||||
//! Scales the actual mesh, not a scene node.
|
||||
/** \deprecated Use scale() instead. This method may be removed by Irrlicht 1.9
|
||||
/** \deprecated Use scale() instead. This method may be removed by Irrlicht 1.9
|
||||
\param mesh Mesh on which the operation is performed.
|
||||
\param factor Scale factor for each axis. */
|
||||
_IRR_DEPRECATED_ void scaleMesh(IMesh* mesh, const core::vector3df& factor) const {return scale(mesh,factor);}
|
||||
|
@ -159,7 +159,7 @@ namespace scene
|
|||
}
|
||||
|
||||
//! Applies a transformation to a mesh
|
||||
/** \deprecated Use transform() instead. This method may be removed by Irrlicht 1.9
|
||||
/** \deprecated Use transform() instead. This method may be removed by Irrlicht 1.9
|
||||
\param mesh Mesh on which the operation is performed.
|
||||
\param m transformation matrix. */
|
||||
_IRR_DEPRECATED_ virtual void transformMesh(IMesh* mesh, const core::matrix4& m) const {return transform(mesh,m);}
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
//! Set the maximum particle life-time in milliseconds
|
||||
virtual void setMaxLifeTime( u32 lifeTimeMax ) = 0;
|
||||
|
||||
//! Set maximal random derivation from the direction
|
||||
//! Set maximal random derivation from the direction
|
||||
virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) = 0;
|
||||
|
||||
//! Get direction the emitter emits particles
|
||||
|
@ -111,10 +111,9 @@ public:
|
|||
//! Get the maximum particle life-time in milliseconds
|
||||
virtual u32 getMaxLifeTime() const = 0;
|
||||
|
||||
//! Get maximal random derivation from the direction
|
||||
//! 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; }
|
||||
};
|
||||
|
|
|
@ -68,8 +68,9 @@ public:
|
|||
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.
|
||||
/** 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.
|
||||
|
|
|
@ -371,50 +371,48 @@ namespace quake3
|
|||
|
||||
enum eQ3ModifierFunction
|
||||
{
|
||||
TCMOD = 0,
|
||||
TCMOD = 0,
|
||||
DEFORMVERTEXES = 1,
|
||||
RGBGEN = 2,
|
||||
TCGEN = 3,
|
||||
MAP = 4,
|
||||
ALPHAGEN = 5,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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
|
||||
NOISE = WAVE_MODIFIER_FUNCTION + 7,
|
||||
|
||||
UNKNOWN = -2
|
||||
};
|
||||
|
||||
struct SModifierFunction
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
|
||||
#include "leakHunter.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
|
|
@ -702,17 +702,17 @@ namespace scene
|
|||
{
|
||||
if (!out)
|
||||
return;
|
||||
out->addString ("Name", Name.c_str());
|
||||
out->addInt ("Id", ID );
|
||||
out->addString("Name", Name.c_str());
|
||||
out->addInt("Id", ID );
|
||||
|
||||
out->addVector3d("Position", getPosition() );
|
||||
out->addVector3d("Rotation", getRotation() );
|
||||
out->addVector3d("Scale", getScale() );
|
||||
|
||||
out->addBool ("Visible", IsVisible );
|
||||
out->addInt ("AutomaticCulling", AutomaticCullingState);
|
||||
out->addInt ("DebugDataVisible", DebugDataVisible );
|
||||
out->addBool ("IsDebugObject", IsDebugObject );
|
||||
out->addBool("Visible", IsVisible );
|
||||
out->addInt("AutomaticCulling", AutomaticCullingState);
|
||||
out->addInt("DebugDataVisible", DebugDataVisible );
|
||||
out->addBool("IsDebugObject", IsDebugObject );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ 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
|
||||
like a first person shooter
|
||||
*/
|
||||
class ISceneNodeAnimatorCameraFPS : public ISceneNodeAnimator
|
||||
{
|
||||
|
@ -45,15 +45,15 @@ namespace scene
|
|||
virtual void setKeyMap(SKeyMap *map, u32 count) = 0;
|
||||
|
||||
//! Sets the keyboard mapping for this animator
|
||||
//! \param keymap The new keymap array
|
||||
//! \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
|
||||
/** 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;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
//! Called when the scene manager create a scene node while loading a file.
|
||||
virtual void OnCreateNode(ISceneNode* node) = 0;
|
||||
|
||||
|
||||
//! Called when the scene manager read a scene node while loading a file.
|
||||
/** The userData pointer contains a list of attributes with userData which
|
||||
were attached to the scene node in the read scene file.*/
|
||||
|
|
|
@ -152,7 +152,7 @@ namespace scene
|
|||
\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,
|
||||
virtual bool loadHeightMap(io::IReadFile* file,
|
||||
video::SColor vertexColor=video::SColor(255,255,255,255),
|
||||
s32 smoothFactor=0) =0;
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
// Day of the year, from 1 to 366
|
||||
u32 Yearday;
|
||||
// Whether daylight saving is on
|
||||
bool IsDST;
|
||||
bool IsDST;
|
||||
};
|
||||
|
||||
virtual RealTimeDate getRealTimeAndDate() const = 0;
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace io
|
|||
{
|
||||
|
||||
//! Interface providing methods for making it easier to write XML files.
|
||||
/** This XML Writer writes xml files using in the platform dependent
|
||||
/** This XML Writer writes xml files using in the platform dependent
|
||||
wchar_t format and sets the xml-encoding correspondingly. */
|
||||
class IXMLWriter : public virtual IReferenceCounted
|
||||
{
|
||||
|
|
|
@ -161,7 +161,7 @@ If not defined, Windows Multimedia library is used, which offers also broad supp
|
|||
#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
|
||||
#endif
|
||||
// can't get this to compile currently under borland, can be removed if someone has a better solution
|
||||
#if defined(__BORLANDC__)
|
||||
#if defined(__BORLANDC__)
|
||||
#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
|
||||
#endif
|
||||
|
||||
|
@ -391,7 +391,7 @@ B3D, MS3D or X meshes */
|
|||
#ifdef NO_IRR_COMPILE_WITH_OGRE_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_OGRE_LOADER_
|
||||
#endif
|
||||
#endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
#endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_IRR_MESH_LOADER_ if you want to load Irrlicht Engine .irrmesh files
|
||||
#define _IRR_COMPILE_WITH_IRR_MESH_LOADER_
|
||||
|
@ -845,7 +845,6 @@ precision will be lower but speed higher. currently X86 only
|
|||
#define _tfindnext __tfindnext
|
||||
typedef long intptr_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __IRR_COMPILE_CONFIG_H_INCLUDED__
|
||||
|
|
|
@ -429,14 +429,14 @@ namespace video
|
|||
{
|
||||
u16 * dest = (u16*)data;
|
||||
*dest = video::A8R8G8B8toA1R5G5B5( color );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ECF_R5G6B5:
|
||||
{
|
||||
u16 * dest = (u16*)data;
|
||||
*dest = video::A8R8G8B8toR5G6B5( color );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ECF_R8G8B8:
|
||||
|
@ -445,14 +445,14 @@ namespace video
|
|||
dest[0] = (u8)getRed();
|
||||
dest[1] = (u8)getGreen();
|
||||
dest[2] = (u8)getBlue();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ECF_A8R8G8B8:
|
||||
{
|
||||
u32 * dest = (u32*)data;
|
||||
*dest = color;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -22,15 +22,15 @@ namespace video
|
|||
//! Flag for EMT_ONETEXTURE_BLEND, ( BlendFactor ) BlendFunc = source * sourceFactor + dest * destFactor
|
||||
enum E_BLEND_FACTOR
|
||||
{
|
||||
EBF_ZERO = 0, //!< src & dest (0, 0, 0, 0)
|
||||
EBF_ONE, //!< src & dest (1, 1, 1, 1)
|
||||
EBF_DST_COLOR, //!< src (destR, destG, destB, destA)
|
||||
EBF_ZERO = 0, //!< src & dest (0, 0, 0, 0)
|
||||
EBF_ONE, //!< src & dest (1, 1, 1, 1)
|
||||
EBF_DST_COLOR, //!< src (destR, destG, destB, destA)
|
||||
EBF_ONE_MINUS_DST_COLOR, //!< src (1-destR, 1-destG, 1-destB, 1-destA)
|
||||
EBF_SRC_COLOR, //!< dest (srcR, srcG, srcB, srcA)
|
||||
EBF_ONE_MINUS_SRC_COLOR, //!< dest (1-srcR, 1-srcG, 1-srcB, 1-srcA)
|
||||
EBF_SRC_ALPHA, //!< src & dest (srcA, srcA, srcA, srcA)
|
||||
EBF_SRC_COLOR, //!< dest (srcR, srcG, srcB, srcA)
|
||||
EBF_ONE_MINUS_SRC_COLOR, //!< dest (1-srcR, 1-srcG, 1-srcB, 1-srcA)
|
||||
EBF_SRC_ALPHA, //!< src & dest (srcA, srcA, srcA, srcA)
|
||||
EBF_ONE_MINUS_SRC_ALPHA, //!< src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA)
|
||||
EBF_DST_ALPHA, //!< src & dest (destA, destA, destA, destA)
|
||||
EBF_DST_ALPHA, //!< src & dest (destA, destA, destA, destA)
|
||||
EBF_ONE_MINUS_DST_ALPHA, //!< src & dest (1-destA, 1-destA, 1-destA, 1-destA)
|
||||
EBF_SRC_ALPHA_SATURATE //!< src (min(srcA, 1-destA), idem, ...)
|
||||
};
|
||||
|
@ -39,11 +39,11 @@ namespace video
|
|||
enum E_BLEND_OPERATION
|
||||
{
|
||||
EBO_NONE = 0, //!< No blending happens
|
||||
EBO_ADD, //!< Default blending adds the color values
|
||||
EBO_ADD, //!< Default blending adds the color values
|
||||
EBO_SUBTRACT, //!< This mode subtracts the color values
|
||||
EBO_REVSUBTRACT,//!< This modes subtracts destination from source
|
||||
EBO_MIN, //!< Choose minimum value of each color channel
|
||||
EBO_MAX, //!< Choose maximum value of each color channel
|
||||
EBO_MIN, //!< Choose minimum value of each color channel
|
||||
EBO_MAX, //!< Choose maximum value of each color channel
|
||||
EBO_MIN_FACTOR, //!< Choose minimum value of each color channel after applying blend factors, not widely supported
|
||||
EBO_MAX_FACTOR, //!< Choose maximum value of each color channel after applying blend factors, not widely supported
|
||||
EBO_MIN_ALPHA, //!< Choose minimum value of each color channel based on alpha value, not widely supported
|
||||
|
@ -128,7 +128,7 @@ namespace video
|
|||
{
|
||||
const u32 state = IR(param);
|
||||
alphaSource = (state & 0x0000F000) >> 12;
|
||||
modulo = E_MODULATE_FUNC( ( state & 0x00000F00 ) >> 8 );
|
||||
modulo = E_MODULATE_FUNC( ( state & 0x00000F00 ) >> 8 );
|
||||
srcFact = E_BLEND_FACTOR ( ( state & 0x000000F0 ) >> 4 );
|
||||
dstFact = E_BLEND_FACTOR ( ( state & 0x0000000F ) );
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ namespace video
|
|||
u8 ZBuffer;
|
||||
|
||||
//! Sets the antialiasing mode
|
||||
/** Values are chosen from E_ANTI_ALIASING_MODE. Default is
|
||||
/** Values are chosen from E_ANTI_ALIASING_MODE. Default is
|
||||
EAAM_SIMPLE|EAAM_LINE_SMOOTH, i.e. simple multi-sample
|
||||
anti-aliasing and lime smoothing is enabled. */
|
||||
u8 AntiAliasing;
|
||||
|
@ -384,7 +384,7 @@ namespace video
|
|||
|
||||
//! Defines the interpretation of vertex color in the lighting equation
|
||||
/** Values should be chosen from E_COLOR_MATERIAL.
|
||||
When lighting is enabled, vertex color can be used instead of the
|
||||
When lighting is enabled, vertex color can be used instead of the
|
||||
material values for light modulation. This allows to easily change e.g. the
|
||||
diffuse light behavior of each face. The default, ECM_DIFFUSE, will result in
|
||||
a very similar rendering as with lighting turned off, just with light shading. */
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace video
|
|||
~SMaterialLayer()
|
||||
{
|
||||
MatrixAllocator.destruct(TextureMatrix);
|
||||
MatrixAllocator.deallocate(TextureMatrix);
|
||||
MatrixAllocator.deallocate(TextureMatrix);
|
||||
}
|
||||
|
||||
//! Assignment operator
|
||||
|
@ -93,7 +93,7 @@ namespace video
|
|||
else
|
||||
{
|
||||
MatrixAllocator.destruct(TextureMatrix);
|
||||
MatrixAllocator.deallocate(TextureMatrix);
|
||||
MatrixAllocator.deallocate(TextureMatrix);
|
||||
TextureMatrix = 0;
|
||||
}
|
||||
}
|
||||
|
@ -200,8 +200,8 @@ namespace video
|
|||
/** In Irrlicht you can use anisotropic texture filtering
|
||||
in conjunction with bilinear or trilinear texture
|
||||
filtering to improve rendering results. Primitives
|
||||
will look less blurry with this flag switched on. The number gives
|
||||
the maximal anisotropy degree, and is often in the range 2-16.
|
||||
will look less blurry with this flag switched on. The number gives
|
||||
the maximal anisotropy degree, and is often in the range 2-16.
|
||||
Value 1 is equivalent to 0, but should be avoided. */
|
||||
u8 AnisotropicFilter;
|
||||
|
||||
|
|
|
@ -20,27 +20,26 @@ namespace core
|
|||
// ----------- some basic quite often used string functions -----------------
|
||||
|
||||
//! search if a filename has a proper extension
|
||||
inline s32 isFileExtension ( const io::path& filename,
|
||||
const io::path& ext0,
|
||||
const io::path& ext1,
|
||||
const io::path& ext2)
|
||||
inline s32 isFileExtension (const io::path& filename, const io::path& ext0,
|
||||
const io::path& ext1, const io::path& ext2)
|
||||
{
|
||||
s32 extPos = filename.findLast ( '.' );
|
||||
if ( extPos < 0 )
|
||||
return 0;
|
||||
|
||||
extPos += 1;
|
||||
if ( filename.equals_substring_ignore_case ( ext0, extPos ) ) return 1;
|
||||
if ( filename.equals_substring_ignore_case ( ext1, extPos ) ) return 2;
|
||||
if ( filename.equals_substring_ignore_case ( ext2, extPos ) ) return 3;
|
||||
if ( filename.equals_substring_ignore_case ( ext0, extPos ) )
|
||||
return 1;
|
||||
if ( filename.equals_substring_ignore_case ( ext1, extPos ) )
|
||||
return 2;
|
||||
if ( filename.equals_substring_ignore_case ( ext2, extPos ) )
|
||||
return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//! search if a filename has a proper extension
|
||||
inline bool hasFileExtension ( const io::path& filename,
|
||||
const io::path& ext0,
|
||||
const io::path& ext1 = "",
|
||||
const io::path& ext2 = "")
|
||||
inline bool hasFileExtension(const io::path& filename, const io::path& ext0,
|
||||
const io::path& ext1 = "", const io::path& ext2 = "")
|
||||
{
|
||||
return isFileExtension ( filename, ext0, ext1, ext2 ) > 0;
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ namespace irr
|
|||
namespace core
|
||||
{
|
||||
//! Selection of characters which count as decimal point in fast_atof
|
||||
// TODO: This should probably also be used in irr::core::string, but the float-to-string code
|
||||
// used there has to be rewritten first.
|
||||
// TODO: This should probably also be used in irr::core::string, but
|
||||
// the float-to-string code used there has to be rewritten first.
|
||||
IRRLICHT_API extern irr::core::stringc LOCALE_DECIMAL_POINTS;
|
||||
|
||||
// we write [17] here instead of [] to work around a swig bug
|
||||
|
|
|
@ -25,8 +25,7 @@ class array
|
|||
public:
|
||||
|
||||
//! Default constructor for empty array.
|
||||
array()
|
||||
: data(0), allocated(0), used(0),
|
||||
array() : data(0), allocated(0), used(0),
|
||||
strategy(ALLOC_STRATEGY_DOUBLE), free_when_destroyed(true), is_sorted(true)
|
||||
{
|
||||
}
|
||||
|
@ -34,9 +33,9 @@ public:
|
|||
|
||||
//! Constructs an array and allocates an initial chunk of memory.
|
||||
/** \param start_count Amount of elements to pre-allocate. */
|
||||
array(u32 start_count)
|
||||
: data(0), allocated(0), used(0),
|
||||
strategy(ALLOC_STRATEGY_DOUBLE), free_when_destroyed(true), is_sorted(true)
|
||||
array(u32 start_count) : data(0), allocated(0), used(0),
|
||||
strategy(ALLOC_STRATEGY_DOUBLE),
|
||||
free_when_destroyed(true), is_sorted(true)
|
||||
{
|
||||
reallocate(start_count);
|
||||
}
|
||||
|
@ -468,8 +467,8 @@ public:
|
|||
//! it is used for searching a multiset
|
||||
/** The array will be sorted before the binary search if it is not
|
||||
already sorted.
|
||||
\param element Element to search for.
|
||||
\param &last return lastIndex of equal elements
|
||||
\param element Element to search for.
|
||||
\param &last return lastIndex of equal elements
|
||||
\return Position of the first searched element if it was found,
|
||||
otherwise -1 is returned. */
|
||||
s32 binary_search_multi(const T& element, s32 &last)
|
||||
|
@ -567,12 +566,12 @@ public:
|
|||
|
||||
for (i=index+count; i<used; ++i)
|
||||
{
|
||||
if (i-count >= index+count) // not already destructed before loop
|
||||
if (i-count >= index+count) // not already destructed before loop
|
||||
allocator.destruct(&data[i-count]);
|
||||
|
||||
allocator.construct(&data[i-count], data[i]); // data[i-count] = data[i];
|
||||
|
||||
if (i >= used-count) // those which are not overwritten
|
||||
if (i >= used-count) // those which are not overwritten
|
||||
allocator.destruct(&data[i]);
|
||||
}
|
||||
|
||||
|
@ -590,14 +589,14 @@ public:
|
|||
//! Swap the content of this array container with the content of another array
|
||||
/** Afterwards this object will contain the content of the other object and the other
|
||||
object will contain the content of this object.
|
||||
\param other Swap content with this object */
|
||||
\param other Swap content with this object */
|
||||
void swap(array<T, TAlloc>& other)
|
||||
{
|
||||
core::swap(data, other.data);
|
||||
core::swap(allocated, other.allocated);
|
||||
core::swap(used, other.used);
|
||||
core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation
|
||||
eAllocStrategy helper_strategy(strategy); // can't use core::swap with bitfields
|
||||
core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation
|
||||
eAllocStrategy helper_strategy(strategy); // can't use core::swap with bitfields
|
||||
strategy = other.strategy;
|
||||
other.strategy = helper_strategy;
|
||||
bool helper_free_when_destroyed(free_when_destroyed);
|
||||
|
|
|
@ -389,13 +389,13 @@ public:
|
|||
/** Afterwards this object will contain the content of the other object and the other
|
||||
object will contain the content of this object. Iterators will afterwards be valid for
|
||||
the swapped object.
|
||||
\param other Swap content with this object */
|
||||
\param other Swap content with this object */
|
||||
void swap(list<T>& other)
|
||||
{
|
||||
core::swap(First, other.First);
|
||||
core::swap(Last, other.Last);
|
||||
core::swap(Size, other.Size);
|
||||
core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation
|
||||
core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -41,16 +41,16 @@ class map
|
|||
p->setParent(this);
|
||||
}
|
||||
|
||||
void setParent(RBTree* p) { Parent=p; }
|
||||
void setParent(RBTree* p) { Parent=p; }
|
||||
|
||||
void setValue(const ValueTypeRB& v) { Value = v; }
|
||||
void setValue(const ValueTypeRB& v) { Value = v; }
|
||||
|
||||
void setRed() { IsRed = true; }
|
||||
void setBlack() { IsRed = false; }
|
||||
void setRed() { IsRed = true; }
|
||||
void setBlack() { IsRed = false; }
|
||||
|
||||
RBTree* getLeftChild() const { return LeftChild; }
|
||||
RBTree* getRightChild() const { return RightChild; }
|
||||
RBTree* getParent() const { return Parent; }
|
||||
RBTree* getLeftChild() const { return LeftChild; }
|
||||
RBTree* getRightChild() const { return RightChild; }
|
||||
RBTree* getParent() const { return Parent; }
|
||||
|
||||
const ValueTypeRB& getValue() const
|
||||
{
|
||||
|
@ -118,13 +118,13 @@ class map
|
|||
private:
|
||||
RBTree();
|
||||
|
||||
RBTree* LeftChild;
|
||||
RBTree* RightChild;
|
||||
RBTree* LeftChild;
|
||||
RBTree* RightChild;
|
||||
|
||||
RBTree* Parent;
|
||||
RBTree* Parent;
|
||||
|
||||
KeyTypeRB Key;
|
||||
ValueTypeRB Value;
|
||||
KeyTypeRB Key;
|
||||
ValueTypeRB Value;
|
||||
|
||||
bool IsRed;
|
||||
}; // RBTree
|
||||
|
@ -442,7 +442,7 @@ class map
|
|||
{
|
||||
public:
|
||||
|
||||
ParentFirstIterator() : Root(0), Cur(0) {}
|
||||
ParentFirstIterator() : Root(0), Cur(0) {}
|
||||
|
||||
explicit ParentFirstIterator(Node* root) : Root(root), Cur(0)
|
||||
{
|
||||
|
@ -938,7 +938,7 @@ class map
|
|||
/** Afterwards this object will contain the content of the other object and the other
|
||||
object will contain the content of this object. Iterators will afterwards be valid for
|
||||
the swapped object.
|
||||
\param other Swap content with this object */
|
||||
\param other Swap content with this object */
|
||||
void swap(map<KeyType, ValueType>& other)
|
||||
{
|
||||
core::swap(Root, other.Root);
|
||||
|
|
|
@ -53,19 +53,19 @@ namespace core
|
|||
#undef PI
|
||||
#endif
|
||||
//! Constant for PI.
|
||||
const f32 PI = 3.14159265359f;
|
||||
const f32 PI = 3.14159265359f;
|
||||
|
||||
//! Constant for reciprocal of PI.
|
||||
const f32 RECIPROCAL_PI = 1.0f/PI;
|
||||
const f32 RECIPROCAL_PI = 1.0f/PI;
|
||||
|
||||
//! Constant for half of PI.
|
||||
const f32 HALF_PI = PI/2.0f;
|
||||
const f32 HALF_PI = PI/2.0f;
|
||||
|
||||
#ifdef PI64 // make sure we don't collide with a define
|
||||
#undef PI64
|
||||
#endif
|
||||
//! Constant for 64bit PI.
|
||||
const f64 PI64 = 3.1415926535897932384626433832795028841971693993751;
|
||||
const f64 PI64 = 3.1415926535897932384626433832795028841971693993751;
|
||||
|
||||
//! Constant for 64bit reciprocal of PI.
|
||||
const f64 RECIPROCAL_PI64 = 1.0/PI64;
|
||||
|
@ -84,7 +84,7 @@ namespace core
|
|||
|
||||
//! Utility function to convert a radian value to degrees
|
||||
/** Provided as it can be clearer to write radToDeg(X) than RADTODEG * X
|
||||
\param radians The radians value to convert to degrees.
|
||||
\param radians The radians value to convert to degrees.
|
||||
*/
|
||||
inline f32 radToDeg(f32 radians)
|
||||
{
|
||||
|
@ -93,7 +93,7 @@ namespace core
|
|||
|
||||
//! Utility function to convert a radian value to degrees
|
||||
/** Provided as it can be clearer to write radToDeg(X) than RADTODEG * X
|
||||
\param radians The radians value to convert to degrees.
|
||||
\param radians The radians value to convert to degrees.
|
||||
*/
|
||||
inline f64 radToDeg(f64 radians)
|
||||
{
|
||||
|
@ -102,7 +102,7 @@ namespace core
|
|||
|
||||
//! Utility function to convert a degrees value to radians
|
||||
/** Provided as it can be clearer to write degToRad(X) than DEGTORAD * X
|
||||
\param degrees The degrees value to convert to radians.
|
||||
\param degrees The degrees value to convert to radians.
|
||||
*/
|
||||
inline f32 degToRad(f32 degrees)
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ namespace core
|
|||
|
||||
//! Utility function to convert a degrees value to radians
|
||||
/** Provided as it can be clearer to write degToRad(X) than DEGTORAD * X
|
||||
\param degrees The degrees value to convert to radians.
|
||||
\param degrees The degrees value to convert to radians.
|
||||
*/
|
||||
inline f64 degToRad(f64 degrees)
|
||||
{
|
||||
|
@ -348,26 +348,26 @@ namespace core
|
|||
//! code is taken from IceFPU
|
||||
//! Integer representation of a floating-point value.
|
||||
#ifdef IRRLICHT_FAST_MATH
|
||||
#define IR(x) ((u32&)(x))
|
||||
#define IR(x) ((u32&)(x))
|
||||
#else
|
||||
inline u32 IR(f32 x) {inttofloat tmp; tmp.f=x; return tmp.u;}
|
||||
#endif
|
||||
|
||||
//! Absolute integer representation of a floating-point value
|
||||
#define AIR(x) (IR(x)&0x7fffffff)
|
||||
#define AIR(x) (IR(x)&0x7fffffff)
|
||||
|
||||
//! Floating-point representation of an integer value.
|
||||
#ifdef IRRLICHT_FAST_MATH
|
||||
#define FR(x) ((f32&)(x))
|
||||
#define FR(x) ((f32&)(x))
|
||||
#else
|
||||
inline f32 FR(u32 x) {inttofloat tmp; tmp.u=x; return tmp.f;}
|
||||
inline f32 FR(s32 x) {inttofloat tmp; tmp.s=x; return tmp.f;}
|
||||
#endif
|
||||
|
||||
//! integer representation of 1.0
|
||||
#define IEEE_1_0 0x3f800000
|
||||
#define IEEE_1_0 0x3f800000
|
||||
//! integer representation of 255.0
|
||||
#define IEEE_255_0 0x437f0000
|
||||
#define IEEE_255_0 0x437f0000
|
||||
|
||||
#ifdef IRRLICHT_FAST_MATH
|
||||
#define F32_LOWER_0(f) (F32_AS_U32(f) > F32_SIGN_BIT)
|
||||
|
|
|
@ -74,7 +74,7 @@ typedef signed int s32;
|
|||
typedef unsigned __int64 u64;
|
||||
#elif __GNUC__
|
||||
#if __WORDSIZE == 64
|
||||
typedef unsigned long int u64;
|
||||
typedef unsigned long int u64;
|
||||
#else
|
||||
__extension__ typedef unsigned long long u64;
|
||||
#endif
|
||||
|
@ -88,7 +88,7 @@ typedef unsigned long long u64;
|
|||
typedef __int64 s64;
|
||||
#elif __GNUC__
|
||||
#if __WORDSIZE == 64
|
||||
typedef long int s64;
|
||||
typedef long int s64;
|
||||
#else
|
||||
__extension__ typedef long long s64;
|
||||
#endif
|
||||
|
@ -164,18 +164,18 @@ strings
|
|||
//! define a break macro for debugging.
|
||||
#if defined(_DEBUG)
|
||||
#if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && !defined (_WIN32_WCE)
|
||||
#if defined(WIN64) || defined(_WIN64) // using portable common solution for x64 configuration
|
||||
#include <crtdbg.h>
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();}
|
||||
#else
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3}
|
||||
#endif
|
||||
#if defined(WIN64) || defined(_WIN64) // using portable common solution for x64 configuration
|
||||
#include <crtdbg.h>
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();}
|
||||
#else
|
||||
#include "assert.h"
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) assert( !(_CONDITION_) );
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3}
|
||||
#endif
|
||||
#else
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
|
||||
#include "assert.h"
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) assert( !(_CONDITION_) );
|
||||
#endif
|
||||
#else
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
|
||||
#endif
|
||||
|
||||
//! Defines a deprecated macro which generates a warning at compile time
|
||||
|
|
|
@ -381,7 +381,7 @@ namespace io
|
|||
xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {}
|
||||
xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {}
|
||||
xmlChar<T>(unsigned long in) : c(static_cast<T>(in)) {}
|
||||
#else
|
||||
#else
|
||||
explicit xmlChar<T>(unsigned char in) : c(static_cast<T>(in)) {}
|
||||
explicit xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {}
|
||||
explicit xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {}
|
||||
|
|
|
@ -13,40 +13,40 @@
|
|||
namespace irr
|
||||
{
|
||||
class IReferenceCounted;
|
||||
|
||||
|
||||
//! A calls helping to find unrelease objects of type IReferenceCounted.
|
||||
/** To use this you have recompile Irrlicht with _IRR_COMPILE_WITH_LEAK_HUNTER_.
|
||||
Note that this will slow down your application and should only be used for debugging.
|
||||
Note that this will slow down your application and should only be used for debugging.
|
||||
The way to use is that you can check after you closed and dropped your last Irrlicht device
|
||||
if there are still any IReferenceCounted left over which have not been deleted.
|
||||
*/
|
||||
class LeakHunter
|
||||
class LeakHunter
|
||||
{
|
||||
public:
|
||||
friend class IReferenceCounted;
|
||||
|
||||
|
||||
//! Clear all IReferenceCounted objects inside LeakHunter
|
||||
/** This does not affect the IReferenceCounted themselfes only the
|
||||
counting of them. Usually you don't ever need to clear, but
|
||||
sometimes it helps when for example you want for to ignore
|
||||
/** This does not affect the IReferenceCounted themselfes only the
|
||||
counting of them. Usually you don't ever need to clear, but
|
||||
sometimes it helps when for example you want for to ignore
|
||||
certain leaks.
|
||||
*/
|
||||
static void clearReferenceCountedObjects()
|
||||
static void clearReferenceCountedObjects()
|
||||
{
|
||||
ReferenceCountedObjects.clear();
|
||||
}
|
||||
|
||||
|
||||
static inline irr::core::array<const IReferenceCounted*> getReferenceCountedObjects()
|
||||
{
|
||||
return ReferenceCountedObjects;
|
||||
return ReferenceCountedObjects;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
protected:
|
||||
static inline void addObject(const IReferenceCounted* object)
|
||||
{
|
||||
ReferenceCountedObjects.push_back(object);
|
||||
}
|
||||
|
||||
|
||||
static inline void removeObject(const IReferenceCounted* object)
|
||||
{
|
||||
irr::s32 idx = ReferenceCountedObjects.linear_search(object );
|
||||
|
@ -56,10 +56,10 @@ namespace irr
|
|||
ReferenceCountedObjects.erase( ReferenceCountedObjects.size()-1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
// NOTE: We don't do additional grab()/drop()'s here as we want to supervise reference counted objects and not affect them otherwise.
|
||||
IRRLICHT_API static irr::core::array<const IReferenceCounted*> ReferenceCountedObjects;
|
||||
IRRLICHT_API static irr::core::array<const IReferenceCounted*> ReferenceCountedObjects;
|
||||
};
|
||||
} // end namespace irr
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ class line2d
|
|||
vector2d<f64> c((f64)(point.X-start.X), (f64)(point.Y- start.Y));
|
||||
vector2d<f64> v((f64)(end.X-start.X), (f64)(end.Y-start.Y));
|
||||
f64 d = v.getLength();
|
||||
if ( d == 0 ) // can't tell much when the line is just a single point
|
||||
if ( d == 0 ) // can't tell much when the line is just a single point
|
||||
return start;
|
||||
v /= d;
|
||||
f64 t = v.dotProduct(c);
|
||||
|
@ -246,7 +246,7 @@ class line2d
|
|||
vector2df c = point - start;
|
||||
vector2df v = end - start;
|
||||
f32 d = (f32)v.getLength();
|
||||
if ( d == 0 ) // can't tell much when the line is just a single point
|
||||
if ( d == 0 ) // can't tell much when the line is just a single point
|
||||
return start;
|
||||
v /= d;
|
||||
f32 t = v.dotProduct(c);
|
||||
|
|
|
@ -947,18 +947,18 @@ namespace core
|
|||
template <class T>
|
||||
inline CMatrix4<T>& CMatrix4<T>::setRotationAxisRadians( const T& angle, const vector3d<T>& axis )
|
||||
{
|
||||
const f64 c = cos(angle);
|
||||
const f64 c = cos(angle);
|
||||
const f64 s = sin(angle);
|
||||
const f64 t = 1.0 - c;
|
||||
|
||||
const f64 tx = t * axis.X;
|
||||
const f64 ty = t * axis.Y;
|
||||
const f64 ty = t * axis.Y;
|
||||
const f64 tz = t * axis.Z;
|
||||
|
||||
const f64 sx = s * axis.X;
|
||||
const f64 sy = s * axis.Y;
|
||||
const f64 sz = s * axis.Z;
|
||||
|
||||
|
||||
M[0] = (T)(tx * axis.X + c);
|
||||
M[1] = (T)(tx * axis.Y + sz);
|
||||
M[2] = (T)(tx * axis.Z - sy);
|
||||
|
|
|
@ -37,14 +37,14 @@ class plane3d
|
|||
// Constructors
|
||||
|
||||
plane3d(): Normal(0,1,0) { recalculateD(vector3d<T>(0,0,0)); }
|
||||
|
||||
|
||||
plane3d(const vector3d<T>& MPoint, const vector3d<T>& Normal) : Normal(Normal) { recalculateD(MPoint); }
|
||||
|
||||
|
||||
plane3d(T px, T py, T pz, T nx, T ny, T nz) : Normal(nx, ny, nz) { recalculateD(vector3d<T>(px, py, pz)); }
|
||||
|
||||
|
||||
plane3d(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3)
|
||||
{ setPlane(point1, point2, point3); }
|
||||
|
||||
|
||||
plane3d(const vector3d<T> & normal, const T d) : Normal(normal), D(d) { }
|
||||
|
||||
// operators
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "vector3d.h"
|
||||
|
||||
// Between Irrlicht 1.7 and Irrlicht 1.8 the quaternion-matrix conversions got fixed.
|
||||
// This define disables all involved functions completely to allow finding all places
|
||||
// This define disables all involved functions completely to allow finding all places
|
||||
// where the wrong conversions had been in use.
|
||||
#define IRR_TEST_BROKEN_QUATERNION_USE 0
|
||||
|
||||
|
@ -101,7 +101,7 @@ class quaternion
|
|||
#if !IRR_TEST_BROKEN_QUATERNION_USE
|
||||
//! Creates a matrix from this quaternion
|
||||
matrix4 getMatrix() const;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//! Creates a matrix from this quaternion
|
||||
void getMatrix( matrix4 &dest, const core::vector3df &translation=core::vector3df() ) const;
|
||||
|
|
|
@ -93,8 +93,8 @@ namespace core
|
|||
vector3d<f64> cf64((f64)pointC.X, (f64)pointC.Y, (f64)pointC.Z);
|
||||
vector3d<f64> pf64((f64)p.X, (f64)p.Y, (f64)p.Z);
|
||||
return (isOnSameSide(pf64, af64, bf64, cf64) &&
|
||||
isOnSameSide(pf64, bf64, af64, cf64) &&
|
||||
isOnSameSide(pf64, cf64, af64, bf64));
|
||||
isOnSameSide(pf64, bf64, af64, cf64) &&
|
||||
isOnSameSide(pf64, cf64, af64, bf64));
|
||||
}
|
||||
|
||||
//! Check if a point is inside the triangle (border-points count also as inside)
|
||||
|
@ -254,9 +254,9 @@ namespace core
|
|||
// This catches some floating point troubles.
|
||||
// Unfortunately slightly expensive and we don't really know the best epsilon for iszero.
|
||||
vector3d<f64> cp1 = bminusa.normalize().crossProduct((p1 - a).normalize());
|
||||
if ( core::iszero(cp1.X, (f64)ROUNDING_ERROR_f32)
|
||||
&& core::iszero(cp1.Y, (f64)ROUNDING_ERROR_f32)
|
||||
&& core::iszero(cp1.Z, (f64)ROUNDING_ERROR_f32) )
|
||||
if (core::iszero(cp1.X, (f64)ROUNDING_ERROR_f32)
|
||||
&& core::iszero(cp1.Y, (f64)ROUNDING_ERROR_f32)
|
||||
&& core::iszero(cp1.Z, (f64)ROUNDING_ERROR_f32) )
|
||||
{
|
||||
res = 0.f;
|
||||
}
|
||||
|
|
|
@ -67,28 +67,28 @@ public:
|
|||
//! sort in order X, Y. Equality with rounding tolerance.
|
||||
bool operator<=(const vector2d<T>&other) const
|
||||
{
|
||||
return (X<other.X || core::equals(X, other.X)) ||
|
||||
return (X<other.X || core::equals(X, other.X)) ||
|
||||
(core::equals(X, other.X) && (Y<other.Y || core::equals(Y, other.Y)));
|
||||
}
|
||||
|
||||
//! sort in order X, Y. Equality with rounding tolerance.
|
||||
bool operator>=(const vector2d<T>&other) const
|
||||
{
|
||||
return (X>other.X || core::equals(X, other.X)) ||
|
||||
return (X>other.X || core::equals(X, other.X)) ||
|
||||
(core::equals(X, other.X) && (Y>other.Y || core::equals(Y, other.Y)));
|
||||
}
|
||||
|
||||
//! sort in order X, Y. Difference must be above rounding tolerance.
|
||||
bool operator<(const vector2d<T>&other) const
|
||||
{
|
||||
return (X<other.X && !core::equals(X, other.X)) ||
|
||||
return (X<other.X && !core::equals(X, other.X)) ||
|
||||
(core::equals(X, other.X) && Y<other.Y && !core::equals(Y, other.Y));
|
||||
}
|
||||
|
||||
//! sort in order X, Y. Difference must be above rounding tolerance.
|
||||
bool operator>(const vector2d<T>&other) const
|
||||
{
|
||||
return (X>other.X && !core::equals(X, other.X)) ||
|
||||
return (X>other.X && !core::equals(X, other.X)) ||
|
||||
(core::equals(X, other.X) && Y>other.Y && !core::equals(Y, other.Y));
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace core
|
|||
//! sort in order X, Y, Z. Equality with rounding tolerance.
|
||||
bool operator<=(const vector3d<T>&other) const
|
||||
{
|
||||
return (X<other.X || core::equals(X, other.X)) ||
|
||||
return (X<other.X || core::equals(X, other.X)) ||
|
||||
(core::equals(X, other.X) && (Y<other.Y || core::equals(Y, other.Y))) ||
|
||||
(core::equals(X, other.X) && core::equals(Y, other.Y) && (Z<other.Z || core::equals(Z, other.Z)));
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ namespace core
|
|||
//! sort in order X, Y, Z. Equality with rounding tolerance.
|
||||
bool operator>=(const vector3d<T>&other) const
|
||||
{
|
||||
return (X>other.X || core::equals(X, other.X)) ||
|
||||
return (X>other.X || core::equals(X, other.X)) ||
|
||||
(core::equals(X, other.X) && (Y>other.Y || core::equals(Y, other.Y))) ||
|
||||
(core::equals(X, other.X) && core::equals(Y, other.Y) && (Z>other.Z || core::equals(Z, other.Z)));
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ namespace core
|
|||
//! sort in order X, Y, Z. Difference must be above rounding tolerance.
|
||||
bool operator<(const vector3d<T>&other) const
|
||||
{
|
||||
return (X<other.X && !core::equals(X, other.X)) ||
|
||||
return (X<other.X && !core::equals(X, other.X)) ||
|
||||
(core::equals(X, other.X) && Y<other.Y && !core::equals(Y, other.Y)) ||
|
||||
(core::equals(X, other.X) && core::equals(Y, other.Y) && Z<other.Z && !core::equals(Z, other.Z));
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ namespace core
|
|||
//! sort in order X, Y, Z. Difference must be above rounding tolerance.
|
||||
bool operator>(const vector3d<T>&other) const
|
||||
{
|
||||
return (X>other.X && !core::equals(X, other.X)) ||
|
||||
return (X>other.X && !core::equals(X, other.X)) ||
|
||||
(core::equals(X, other.X) && Y>other.Y && !core::equals(Y, other.Y)) ||
|
||||
(core::equals(X, other.X) && core::equals(Y, other.Y) && Z>other.Z && !core::equals(Z, other.Z));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue