Commit 5ee9c208 authored by cutealien's avatar cutealien

Ensure vector3df and all classes containing a vector3df are passed by...

Ensure vector3df and all classes containing a vector3df are passed by reference instead of per value. Thanks @Danyal Zia for the patch (#280).
This is breaking the IAttributes interface - so anyone who derived from that will have to update his implementation. More changes in that interface probably coming later today.
The idea behind the patch is preparing the engine for SSE support.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4725 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 0adb7500
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- IAttributes interface changed. Most parameters are not passed by const-ref instead of per value.
- Fix c::b project obj folder names. Some static builds had used the shared folders (thx @ gerdb for reporting) - Fix c::b project obj folder names. Some static builds had used the shared folders (thx @ gerdb for reporting)
- Add ITexture::getSource which can be used to check where the last IVideoDriver::getTexture call found the texture. - Add ITexture::getSource which can be used to check where the last IVideoDriver::getTexture call found the texture.
- Add IMeshTextureLoader interface and replace texture-loading algorithms in most meshloaders. - Add IMeshTextureLoader interface and replace texture-loading algorithms in most meshloaders.
......
...@@ -407,10 +407,10 @@ public: ...@@ -407,10 +407,10 @@ public:
*/ */
//! Adds an attribute as 3d vector //! Adds an attribute as 3d vector
virtual void addVector3d(const c8* attributeName, core::vector3df value) = 0; virtual void addVector3d(const c8* attributeName, const core::vector3df& value) = 0;
//! Sets a attribute as 3d vector //! Sets a attribute as 3d vector
virtual void setAttribute(const c8* attributeName, core::vector3df v) = 0; virtual void setAttribute(const c8* attributeName, const core::vector3df& v) = 0;
//! Gets an attribute as 3d vector //! Gets an attribute as 3d vector
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -423,7 +423,7 @@ public: ...@@ -423,7 +423,7 @@ public:
virtual core::vector3df getAttributeAsVector3d(s32 index) = 0; virtual core::vector3df getAttributeAsVector3d(s32 index) = 0;
//! Sets an attribute as vector //! Sets an attribute as vector
virtual void setAttribute(s32 index, core::vector3df v) = 0; virtual void setAttribute(s32 index, const core::vector3df& v) = 0;
/* /*
...@@ -432,10 +432,10 @@ public: ...@@ -432,10 +432,10 @@ public:
*/ */
//! Adds an attribute as 2d vector //! Adds an attribute as 2d vector
virtual void addVector2d(const c8* attributeName, core::vector2df value) = 0; virtual void addVector2d(const c8* attributeName, const core::vector2df& value) = 0;
//! Sets a attribute as 2d vector //! Sets a attribute as 2d vector
virtual void setAttribute(const c8* attributeName, core::vector2df v) = 0; virtual void setAttribute(const c8* attributeName, const core::vector2df& v) = 0;
//! Gets an attribute as vector //! Gets an attribute as vector
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -448,7 +448,7 @@ public: ...@@ -448,7 +448,7 @@ public:
virtual core::vector2df getAttributeAsVector2d(s32 index) = 0; virtual core::vector2df getAttributeAsVector2d(s32 index) = 0;
//! Sets an attribute as 2d vector //! Sets an attribute as 2d vector
virtual void setAttribute(s32 index, core::vector2df v) = 0; virtual void setAttribute(s32 index, const core::vector2df& v) = 0;
/* /*
...@@ -457,10 +457,10 @@ public: ...@@ -457,10 +457,10 @@ public:
*/ */
//! Adds an attribute as 2d position //! Adds an attribute as 2d position
virtual void addPosition2d(const c8* attributeName, core::position2di value) = 0; virtual void addPosition2d(const c8* attributeName, const core::position2di& value) = 0;
//! Sets a attribute as 2d position //! Sets a attribute as 2d position
virtual void setAttribute(const c8* attributeName, core::position2di v) = 0; virtual void setAttribute(const c8* attributeName, const core::position2di& v) = 0;
//! Gets an attribute as position //! Gets an attribute as position
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -473,7 +473,7 @@ public: ...@@ -473,7 +473,7 @@ public:
virtual core::position2di getAttributeAsPosition2d(s32 index) = 0; virtual core::position2di getAttributeAsPosition2d(s32 index) = 0;
//! Sets an attribute as 2d position //! Sets an attribute as 2d position
virtual void setAttribute(s32 index, core::position2di v) = 0; virtual void setAttribute(s32 index, const core::position2di& v) = 0;
/* /*
...@@ -581,10 +581,10 @@ public: ...@@ -581,10 +581,10 @@ public:
*/ */
//! Adds an attribute as axis aligned bounding box //! Adds an attribute as axis aligned bounding box
virtual void addBox3d(const c8* attributeName, core::aabbox3df v) = 0; virtual void addBox3d(const c8* attributeName, const core::aabbox3df& v) = 0;
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
virtual void setAttribute(const c8* attributeName, core::aabbox3df v) = 0; virtual void setAttribute(const c8* attributeName, const core::aabbox3df& v) = 0;
//! Gets an attribute as a axis aligned bounding box //! Gets an attribute as a axis aligned bounding box
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -597,7 +597,7 @@ public: ...@@ -597,7 +597,7 @@ public:
virtual core::aabbox3df getAttributeAsBox3d(s32 index) = 0; virtual core::aabbox3df getAttributeAsBox3d(s32 index) = 0;
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
virtual void setAttribute(s32 index, core::aabbox3df v) = 0; virtual void setAttribute(s32 index, const core::aabbox3df& v) = 0;
/* /*
...@@ -606,10 +606,10 @@ public: ...@@ -606,10 +606,10 @@ public:
*/ */
//! Adds an attribute as 3d plane //! Adds an attribute as 3d plane
virtual void addPlane3d(const c8* attributeName, core::plane3df v) = 0; virtual void addPlane3d(const c8* attributeName, const core::plane3df& v) = 0;
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
virtual void setAttribute(const c8* attributeName, core::plane3df v) = 0; virtual void setAttribute(const c8* attributeName, const core::plane3df& v) = 0;
//! Gets an attribute as a 3d plane //! Gets an attribute as a 3d plane
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -622,7 +622,7 @@ public: ...@@ -622,7 +622,7 @@ public:
virtual core::plane3df getAttributeAsPlane3d(s32 index) = 0; virtual core::plane3df getAttributeAsPlane3d(s32 index) = 0;
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
virtual void setAttribute(s32 index, core::plane3df v) = 0; virtual void setAttribute(s32 index, const core::plane3df& v) = 0;
/* /*
...@@ -632,10 +632,10 @@ public: ...@@ -632,10 +632,10 @@ public:
*/ */
//! Adds an attribute as 3d triangle //! Adds an attribute as 3d triangle
virtual void addTriangle3d(const c8* attributeName, core::triangle3df v) = 0; virtual void addTriangle3d(const c8* attributeName, const core::triangle3df& v) = 0;
//! Sets an attribute as 3d trianle //! Sets an attribute as 3d trianle
virtual void setAttribute(const c8* attributeName, core::triangle3df v) = 0; virtual void setAttribute(const c8* attributeName, const core::triangle3df& v) = 0;
//! Gets an attribute as a 3d triangle //! Gets an attribute as a 3d triangle
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -648,7 +648,7 @@ public: ...@@ -648,7 +648,7 @@ public:
virtual core::triangle3df getAttributeAsTriangle3d(s32 index) = 0; virtual core::triangle3df getAttributeAsTriangle3d(s32 index) = 0;
//! Sets an attribute as 3d triangle //! Sets an attribute as 3d triangle
virtual void setAttribute(s32 index, core::triangle3df v) = 0; virtual void setAttribute(s32 index, const core::triangle3df& v) = 0;
/* /*
...@@ -658,10 +658,10 @@ public: ...@@ -658,10 +658,10 @@ public:
*/ */
//! Adds an attribute as a 2d line //! Adds an attribute as a 2d line
virtual void addLine2d(const c8* attributeName, core::line2df v) = 0; virtual void addLine2d(const c8* attributeName, const core::line2df& v) = 0;
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
virtual void setAttribute(const c8* attributeName, core::line2df v) = 0; virtual void setAttribute(const c8* attributeName, const core::line2df& v) = 0;
//! Gets an attribute as a 2d line //! Gets an attribute as a 2d line
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -674,7 +674,7 @@ public: ...@@ -674,7 +674,7 @@ public:
virtual core::line2df getAttributeAsLine2d(s32 index) = 0; virtual core::line2df getAttributeAsLine2d(s32 index) = 0;
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
virtual void setAttribute(s32 index, core::line2df v) = 0; virtual void setAttribute(s32 index, const core::line2df& v) = 0;
/* /*
...@@ -684,10 +684,10 @@ public: ...@@ -684,10 +684,10 @@ public:
*/ */
//! Adds an attribute as a 3d line //! Adds an attribute as a 3d line
virtual void addLine3d(const c8* attributeName, core::line3df v) = 0; virtual void addLine3d(const c8* attributeName, const core::line3df& v) = 0;
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
virtual void setAttribute(const c8* attributeName, core::line3df v) = 0; virtual void setAttribute(const c8* attributeName, const core::line3df& v) = 0;
//! Gets an attribute as a 3d line //! Gets an attribute as a 3d line
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -700,7 +700,7 @@ public: ...@@ -700,7 +700,7 @@ public:
virtual core::line3df getAttributeAsLine3d(s32 index) = 0; virtual core::line3df getAttributeAsLine3d(s32 index) = 0;
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
virtual void setAttribute(s32 index, core::line3df v) = 0; virtual void setAttribute(s32 index, const core::line3df& v) = 0;
/* /*
......
...@@ -189,9 +189,9 @@ namespace scene ...@@ -189,9 +189,9 @@ namespace scene
\return Returns the scene node containing the hit triangle nearest to ray.start. \return Returns the scene node containing the hit triangle nearest to ray.start.
If no collision is detected, then 0 is returned. */ If no collision is detected, then 0 is returned. */
virtual ISceneNode* getSceneNodeAndCollisionPointFromRay( virtual ISceneNode* getSceneNodeAndCollisionPointFromRay(
core::line3df ray, const core::line3df& ray,
core::vector3df & outCollisionPoint, core::vector3df& outCollisionPoint,
core::triangle3df & outTriangle, core::triangle3df& outTriangle,
s32 idBitMask = 0, s32 idBitMask = 0,
ISceneNode * collisionRootNode = 0, ISceneNode * collisionRootNode = 0,
bool noDebugObjects = false) = 0; bool noDebugObjects = false) = 0;
......
...@@ -233,7 +233,7 @@ public: ...@@ -233,7 +233,7 @@ public:
} }
CNumbersAttribute(const char* name, core::vector3df value) : CNumbersAttribute(const char* name, const core::vector3df& value) :
ValueI(), ValueF(), Count(3), IsFloat(true) ValueI(), ValueF(), Count(3), IsFloat(true)
{ {
Name = name; Name = name;
...@@ -281,7 +281,7 @@ public: ...@@ -281,7 +281,7 @@ public:
ValueF.push_back(value.W); ValueF.push_back(value.W);
} }
CNumbersAttribute(const char* name, core::aabbox3d<f32> value) : CNumbersAttribute(const char* name, const core::aabbox3d<f32>& value) :
ValueI(), ValueF(), Count(6), IsFloat(true) ValueI(), ValueF(), Count(6), IsFloat(true)
{ {
Name = name; Name = name;
...@@ -293,7 +293,7 @@ public: ...@@ -293,7 +293,7 @@ public:
ValueF.push_back(value.MaxEdge.Z); ValueF.push_back(value.MaxEdge.Z);
} }
CNumbersAttribute(const char* name, core::plane3df value) : CNumbersAttribute(const char* name, const core::plane3df& value) :
ValueI(), ValueF(), Count(4), IsFloat(true) ValueI(), ValueF(), Count(4), IsFloat(true)
{ {
Name = name; Name = name;
...@@ -303,7 +303,7 @@ public: ...@@ -303,7 +303,7 @@ public:
ValueF.push_back(value.D); ValueF.push_back(value.D);
} }
CNumbersAttribute(const char* name, core::triangle3df value) : CNumbersAttribute(const char* name, const core::triangle3df& value) :
ValueI(), ValueF(), Count(9), IsFloat(true) ValueI(), ValueF(), Count(9), IsFloat(true)
{ {
Name = name; Name = name;
...@@ -354,7 +354,7 @@ public: ...@@ -354,7 +354,7 @@ public:
ValueF.push_back(value.end.Y); ValueF.push_back(value.end.Y);
} }
CNumbersAttribute(const char* name, core::line3df value) : CNumbersAttribute(const char* name, const core::line3df& value) :
ValueI(), ValueF(), Count(6), IsFloat(true) ValueI(), ValueF(), Count(6), IsFloat(true)
{ {
Name = name; Name = name;
...@@ -847,7 +847,7 @@ public: ...@@ -847,7 +847,7 @@ public:
} }
} }
virtual void setVector(core::vector3df v) _IRR_OVERRIDE_ virtual void setVector(const core::vector3df& v) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
...@@ -960,7 +960,7 @@ public: ...@@ -960,7 +960,7 @@ public:
} }
} }
virtual void setBoundingBox(core::aabbox3d<f32> value) virtual void setBoundingBox(const core::aabbox3d<f32>& value)
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
...@@ -983,7 +983,7 @@ public: ...@@ -983,7 +983,7 @@ public:
} }
} }
virtual void setPlane(core::plane3df value) _IRR_OVERRIDE_ virtual void setPlane(const core::plane3df& value) _IRR_OVERRIDE_
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
...@@ -1002,7 +1002,7 @@ public: ...@@ -1002,7 +1002,7 @@ public:
} }
} }
virtual void setTriangle3d(core::triangle3df value) virtual void setTriangle3d(const core::triangle3df& value)
{ {
reset(); reset();
if (IsFloat) if (IsFloat)
...@@ -1306,7 +1306,7 @@ class CVector3DAttribute : public CNumbersAttribute ...@@ -1306,7 +1306,7 @@ class CVector3DAttribute : public CNumbersAttribute
{ {
public: public:
CVector3DAttribute(const char* name, core::vector3df value) : CNumbersAttribute(name, value) {} CVector3DAttribute(const char* name, const core::vector3df& value) : CNumbersAttribute(name, value) {}
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
...@@ -1454,7 +1454,7 @@ class CBBoxAttribute : public CNumbersAttribute ...@@ -1454,7 +1454,7 @@ class CBBoxAttribute : public CNumbersAttribute
{ {
public: public:
CBBoxAttribute(const char* name, core::aabbox3df value) : CNumbersAttribute(name, value) { } CBBoxAttribute(const char* name, const core::aabbox3df& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
...@@ -1472,7 +1472,7 @@ class CPlaneAttribute : public CNumbersAttribute ...@@ -1472,7 +1472,7 @@ class CPlaneAttribute : public CNumbersAttribute
{ {
public: public:
CPlaneAttribute(const char* name, core::plane3df value) : CNumbersAttribute(name, value) { } CPlaneAttribute(const char* name, const core::plane3df& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
...@@ -1490,7 +1490,7 @@ class CTriangleAttribute : public CNumbersAttribute ...@@ -1490,7 +1490,7 @@ class CTriangleAttribute : public CNumbersAttribute
{ {
public: public:
CTriangleAttribute(const char* name, core::triangle3df value) : CNumbersAttribute(name, value) { } CTriangleAttribute(const char* name, const core::triangle3df& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
...@@ -1532,7 +1532,7 @@ class CLine3dAttribute : public CNumbersAttribute ...@@ -1532,7 +1532,7 @@ class CLine3dAttribute : public CNumbersAttribute
{ {
public: public:
CLine3dAttribute(const char* name, core::line3df value) : CNumbersAttribute(name, value) { } CLine3dAttribute(const char* name, const core::line3df& value) : CNumbersAttribute(name, value) { }
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_ virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{ {
......
...@@ -368,7 +368,7 @@ video::SColorf CAttributes::getAttributeAsColorf(const c8* attributeName, const ...@@ -368,7 +368,7 @@ video::SColorf CAttributes::getAttributeAsColorf(const c8* attributeName, const
} }
//! Sets a attribute as 2d position //! Sets a attribute as 2d position
void CAttributes::setAttribute(const c8* attributeName, core::position2di value) void CAttributes::setAttribute(const c8* attributeName, const core::position2di& value)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
...@@ -434,7 +434,7 @@ core::dimension2d<u32> CAttributes::getAttributeAsDimension2d(const c8* attribut ...@@ -434,7 +434,7 @@ core::dimension2d<u32> CAttributes::getAttributeAsDimension2d(const c8* attribut
} }
//! Sets a attribute as vector //! Sets a attribute as vector
void CAttributes::setAttribute(const c8* attributeName, core::vector3df value) void CAttributes::setAttribute(const c8* attributeName, const core::vector3df& value)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
...@@ -444,7 +444,7 @@ void CAttributes::setAttribute(const c8* attributeName, core::vector3df value) ...@@ -444,7 +444,7 @@ void CAttributes::setAttribute(const c8* attributeName, core::vector3df value)
} }
//! Sets a attribute as vector //! Sets a attribute as vector
void CAttributes::setAttribute(const c8* attributeName, core::vector2df value) void CAttributes::setAttribute(const c8* attributeName, const core::vector2df& value)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
...@@ -850,20 +850,20 @@ void CAttributes::addColorf(const c8* attributeName, video::SColorf value) ...@@ -850,20 +850,20 @@ void CAttributes::addColorf(const c8* attributeName, video::SColorf value)
} }
//! Adds an attribute as 3d vector //! Adds an attribute as 3d vector
void CAttributes::addVector3d(const c8* attributeName, core::vector3df value) void CAttributes::addVector3d(const c8* attributeName, const core::vector3df& value)
{ {
Attributes.push_back(new CVector3DAttribute(attributeName, value)); Attributes.push_back(new CVector3DAttribute(attributeName, value));
} }
//! Adds an attribute as 2d vector //! Adds an attribute as 2d vector
void CAttributes::addVector2d(const c8* attributeName, core::vector2df value) void CAttributes::addVector2d(const c8* attributeName, const core::vector2df& value)
{ {
Attributes.push_back(new CVector2DAttribute(attributeName, value)); Attributes.push_back(new CVector2DAttribute(attributeName, value));
} }
//! Adds an attribute as 2d position //! Adds an attribute as 2d position
void CAttributes::addPosition2d(const c8* attributeName, core::position2di value) void CAttributes::addPosition2d(const c8* attributeName, const core::position2di& value)
{ {
Attributes.push_back(new CPosition2DAttribute(attributeName, value)); Attributes.push_back(new CPosition2DAttribute(attributeName, value));
} }
...@@ -950,21 +950,21 @@ void CAttributes::setAttribute(s32 index, video::SColorf color) ...@@ -950,21 +950,21 @@ void CAttributes::setAttribute(s32 index, video::SColorf color)
} }
//! Sets a attribute as vector //! Sets a attribute as vector
void CAttributes::setAttribute(s32 index, core::vector3df v) void CAttributes::setAttribute(s32 index, const core::vector3df& v)
{ {
if ((u32)index < Attributes.size()) if ((u32)index < Attributes.size())
Attributes[index]->setVector(v); Attributes[index]->setVector(v);
} }
//! Sets a attribute as vector //! Sets a attribute as vector
void CAttributes::setAttribute(s32 index, core::vector2df v) void CAttributes::setAttribute(s32 index, const core::vector2df& v)
{ {
if ((u32)index < Attributes.size()) if ((u32)index < Attributes.size())
Attributes[index]->setVector2d(v); Attributes[index]->setVector2d(v);
} }
//! Sets a attribute as position //! Sets a attribute as position
void CAttributes::setAttribute(s32 index, core::position2di v) void CAttributes::setAttribute(s32 index, const core::position2di& v)
{ {
if ((u32)index < Attributes.size()) if ((u32)index < Attributes.size())
Attributes[index]->setPosition(v); Attributes[index]->setPosition(v);
...@@ -1101,13 +1101,13 @@ if (index >= 0 && index < (s32)Attributes.size() ) ...@@ -1101,13 +1101,13 @@ if (index >= 0 && index < (s32)Attributes.size() )
} }
//! Adds an attribute as axis aligned bounding box //! Adds an attribute as axis aligned bounding box
void CAttributes::addBox3d(const c8* attributeName, core::aabbox3df v) void CAttributes::addBox3d(const c8* attributeName, const core::aabbox3df& v)
{ {
Attributes.push_back(new CBBoxAttribute(attributeName, v)); Attributes.push_back(new CBBoxAttribute(attributeName, v));
} }
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
void CAttributes::setAttribute(const c8* attributeName, core::aabbox3df v) void CAttributes::setAttribute(const c8* attributeName, const core::aabbox3df& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
...@@ -1140,20 +1140,20 @@ core::aabbox3df CAttributes::getAttributeAsBox3d(s32 index) ...@@ -1140,20 +1140,20 @@ core::aabbox3df CAttributes::getAttributeAsBox3d(s32 index)
} }
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
void CAttributes::setAttribute(s32 index, core::aabbox3df v) void CAttributes::setAttribute(s32 index, const core::aabbox3df& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setBBox(v); Attributes[index]->setBBox(v);
} }
//! Adds an attribute as 3d plane //! Adds an attribute as 3d plane
void CAttributes::addPlane3d(const c8* attributeName, core::plane3df v) void CAttributes::addPlane3d(const c8* attributeName, const core::plane3df& v)
{ {
Attributes.push_back(new CPlaneAttribute(attributeName, v)); Attributes.push_back(new CPlaneAttribute(attributeName, v));
} }
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
void CAttributes::setAttribute(const c8* attributeName, core::plane3df v) void CAttributes::setAttribute(const c8* attributeName, const core::plane3df& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
...@@ -1186,20 +1186,20 @@ core::plane3df CAttributes::getAttributeAsPlane3d(s32 index) ...@@ -1186,20 +1186,20 @@ core::plane3df CAttributes::getAttributeAsPlane3d(s32 index)
} }
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
void CAttributes::setAttribute(s32 index, core::plane3df v) void CAttributes::setAttribute(s32 index, const core::plane3df& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setPlane(v); Attributes[index]->setPlane(v);
} }
//! Adds an attribute as 3d triangle //! Adds an attribute as 3d triangle
void CAttributes::addTriangle3d(const c8* attributeName, core::triangle3df v) void CAttributes::addTriangle3d(const c8* attributeName, const core::triangle3df& v)
{ {
Attributes.push_back(new CTriangleAttribute(attributeName, v)); Attributes.push_back(new CTriangleAttribute(attributeName, v));
} }
//! Sets an attribute as 3d triangle //! Sets an attribute as 3d triangle
void CAttributes::setAttribute(const c8* attributeName, core::triangle3df v) void CAttributes::setAttribute(const c8* attributeName, const core::triangle3df& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
...@@ -1233,20 +1233,20 @@ core::triangle3df CAttributes::getAttributeAsTriangle3d(s32 index) ...@@ -1233,20 +1233,20 @@ core::triangle3df CAttributes::getAttributeAsTriangle3d(s32 index)
} }
//! Sets an attribute as 3d triangle //! Sets an attribute as 3d triangle
void CAttributes::setAttribute(s32 index, core::triangle3df v) void CAttributes::setAttribute(s32 index, const core::triangle3df& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setTriangle(v); Attributes[index]->setTriangle(v);
} }
//! Adds an attribute as a 2d line //! Adds an attribute as a 2d line
void CAttributes::addLine2d(const c8* attributeName, core::line2df v) void CAttributes::addLine2d(const c8* attributeName, const core::line2df& v)
{ {
Attributes.push_back(new CLine2dAttribute(attributeName, v)); Attributes.push_back(new CLine2dAttribute(attributeName, v));
} }
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
void CAttributes::setAttribute(const c8* attributeName, core::line2df v) void CAttributes::setAttribute(const c8* attributeName, const core::line2df& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
...@@ -1279,20 +1279,20 @@ core::line2df CAttributes::getAttributeAsLine2d(s32 index) ...@@ -1279,20 +1279,20 @@ core::line2df CAttributes::getAttributeAsLine2d(s32 index)
} }
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
void CAttributes::setAttribute(s32 index, core::line2df v) void CAttributes::setAttribute(s32 index, const core::line2df& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setLine2d(v); Attributes[index]->setLine2d(v);
} }
//! Adds an attribute as a 3d line //! Adds an attribute as a 3d line
void CAttributes::addLine3d(const c8* attributeName, core::line3df v) void CAttributes::addLine3d(const c8* attributeName, const core::line3df& v)
{ {
Attributes.push_back(new CLine3dAttribute(attributeName, v)); Attributes.push_back(new CLine3dAttribute(attributeName, v));
} }
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
void CAttributes::setAttribute(const c8* attributeName, core::line3df v) void CAttributes::setAttribute(const c8* attributeName, const core::line3df& v)
{ {
IAttribute* att = getAttributeP(attributeName); IAttribute* att = getAttributeP(attributeName);
if (att) if (att)
...@@ -1325,7 +1325,7 @@ core::line3df CAttributes::getAttributeAsLine3d(s32 index) ...@@ -1325,7 +1325,7 @@ core::line3df CAttributes::getAttributeAsLine3d(s32 index)
} }
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
void CAttributes::setAttribute(s32 index, core::line3df v) void CAttributes::setAttribute(s32 index, const core::line3df& v)
{ {
if (index >= 0 && index < (s32)Attributes.size() ) if (index >= 0 && index < (s32)Attributes.size() )
Attributes[index]->setLine3d(v); Attributes[index]->setLine3d(v);
......
...@@ -370,10 +370,10 @@ public: ...@@ -370,10 +370,10 @@ public:
*/ */
//! Adds an attribute as 3d vector //! Adds an attribute as 3d vector
virtual void addVector3d(const c8* attributeName, core::vector3df value) _IRR_OVERRIDE_; virtual void addVector3d(const c8* attributeName, const core::vector3df& value) _IRR_OVERRIDE_;
//! Sets a attribute as 3d vector //! Sets a attribute as 3d vector
virtual void setAttribute(const c8* attributeName, core::vector3df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::vector3df& v) _IRR_OVERRIDE_;
//! Gets an attribute as 3d vector //! Gets an attribute as 3d vector
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -386,7 +386,7 @@ public: ...@@ -386,7 +386,7 @@ public:
virtual core::vector3df getAttributeAsVector3d(s32 index) _IRR_OVERRIDE_; virtual core::vector3df getAttributeAsVector3d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as vector //! Sets an attribute as vector
virtual void setAttribute(s32 index, core::vector3df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::vector3df& v) _IRR_OVERRIDE_;
/* /*
...@@ -396,10 +396,10 @@ public: ...@@ -396,10 +396,10 @@ public:
*/ */
//! Adds an attribute as 2d vector //! Adds an attribute as 2d vector
virtual void addVector2d(const c8* attributeName, core::vector2df value) _IRR_OVERRIDE_; virtual void addVector2d(const c8* attributeName, const core::vector2df& value) _IRR_OVERRIDE_;
//! Sets a attribute as 2d vector //! Sets a attribute as 2d vector
virtual void setAttribute(const c8* attributeName, core::vector2df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::vector2df& v) _IRR_OVERRIDE_;
//! Gets an attribute as 2d vector //! Gets an attribute as 2d vector
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -412,7 +412,7 @@ public: ...@@ -412,7 +412,7 @@ public:
virtual core::vector2df getAttributeAsVector2d(s32 index) _IRR_OVERRIDE_; virtual core::vector2df getAttributeAsVector2d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as vector //! Sets an attribute as vector
virtual void setAttribute(s32 index, core::vector2df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::vector2df& v) _IRR_OVERRIDE_;
/* /*
...@@ -422,10 +422,10 @@ public: ...@@ -422,10 +422,10 @@ public:
*/ */
//! Adds an attribute as 2d position //! Adds an attribute as 2d position
virtual void addPosition2d(const c8* attributeName, core::position2di value) _IRR_OVERRIDE_; virtual void addPosition2d(const c8* attributeName, const core::position2di& value) _IRR_OVERRIDE_;
//! Sets a attribute as 2d position //! Sets a attribute as 2d position
virtual void setAttribute(const c8* attributeName, core::position2di v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::position2di& v) _IRR_OVERRIDE_;
//! Gets an attribute as position //! Gets an attribute as position
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -438,7 +438,7 @@ public: ...@@ -438,7 +438,7 @@ public:
virtual core::position2di getAttributeAsPosition2d(s32 index) _IRR_OVERRIDE_; virtual core::position2di getAttributeAsPosition2d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as 2d position //! Sets an attribute as 2d position
virtual void setAttribute(s32 index, core::position2di v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::position2di& v) _IRR_OVERRIDE_;
/* /*
...@@ -548,10 +548,10 @@ public: ...@@ -548,10 +548,10 @@ public:
*/ */
//! Adds an attribute as axis aligned bounding box //! Adds an attribute as axis aligned bounding box
virtual void addBox3d(const c8* attributeName, core::aabbox3df v) _IRR_OVERRIDE_; virtual void addBox3d(const c8* attributeName, const core::aabbox3df& v) _IRR_OVERRIDE_;
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
virtual void setAttribute(const c8* attributeName, core::aabbox3df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::aabbox3df& v) _IRR_OVERRIDE_;
//! Gets an attribute as a axis aligned bounding box //! Gets an attribute as a axis aligned bounding box
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -564,7 +564,7 @@ public: ...@@ -564,7 +564,7 @@ public:
virtual core::aabbox3df getAttributeAsBox3d(s32 index) _IRR_OVERRIDE_; virtual core::aabbox3df getAttributeAsBox3d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as axis aligned bounding box //! Sets an attribute as axis aligned bounding box
virtual void setAttribute(s32 index, core::aabbox3df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::aabbox3df& v) _IRR_OVERRIDE_;
/* /*
...@@ -573,10 +573,10 @@ public: ...@@ -573,10 +573,10 @@ public:
*/ */
//! Adds an attribute as 3d plane //! Adds an attribute as 3d plane
virtual void addPlane3d(const c8* attributeName, core::plane3df v) _IRR_OVERRIDE_; virtual void addPlane3d(const c8* attributeName, const core::plane3df& v) _IRR_OVERRIDE_;
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
virtual void setAttribute(const c8* attributeName, core::plane3df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::plane3df& v) _IRR_OVERRIDE_;
//! Gets an attribute as a 3d plane //! Gets an attribute as a 3d plane
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -589,7 +589,7 @@ public: ...@@ -589,7 +589,7 @@ public:
virtual core::plane3df getAttributeAsPlane3d(s32 index) _IRR_OVERRIDE_; virtual core::plane3df getAttributeAsPlane3d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as 3d plane //! Sets an attribute as 3d plane
virtual void setAttribute(s32 index, core::plane3df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::plane3df& v) _IRR_OVERRIDE_;
/* /*
...@@ -599,10 +599,10 @@ public: ...@@ -599,10 +599,10 @@ public:
*/ */
//! Adds an attribute as 3d triangle //! Adds an attribute as 3d triangle
virtual void addTriangle3d(const c8* attributeName, core::triangle3df v) _IRR_OVERRIDE_; virtual void addTriangle3d(const c8* attributeName, const core::triangle3df& v) _IRR_OVERRIDE_;
//! Sets an attribute as 3d trianle //! Sets an attribute as 3d trianle
virtual void setAttribute(const c8* attributeName, core::triangle3df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::triangle3df& v) _IRR_OVERRIDE_;
//! Gets an attribute as a 3d triangle //! Gets an attribute as a 3d triangle
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -615,7 +615,7 @@ public: ...@@ -615,7 +615,7 @@ public:
virtual core::triangle3df getAttributeAsTriangle3d(s32 index) _IRR_OVERRIDE_; virtual core::triangle3df getAttributeAsTriangle3d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as 3d triangle //! Sets an attribute as 3d triangle
virtual void setAttribute(s32 index, core::triangle3df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::triangle3df& v) _IRR_OVERRIDE_;
/* /*
...@@ -625,10 +625,10 @@ public: ...@@ -625,10 +625,10 @@ public:
*/ */
//! Adds an attribute as a 2d line //! Adds an attribute as a 2d line
virtual void addLine2d(const c8* attributeName, core::line2df v) _IRR_OVERRIDE_; virtual void addLine2d(const c8* attributeName, const core::line2df& v) _IRR_OVERRIDE_;
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
virtual void setAttribute(const c8* attributeName, core::line2df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::line2df& v) _IRR_OVERRIDE_;
//! Gets an attribute as a 2d line //! Gets an attribute as a 2d line
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -641,7 +641,7 @@ public: ...@@ -641,7 +641,7 @@ public:
virtual core::line2df getAttributeAsLine2d(s32 index) _IRR_OVERRIDE_; virtual core::line2df getAttributeAsLine2d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as a 2d line //! Sets an attribute as a 2d line
virtual void setAttribute(s32 index, core::line2df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::line2df& v) _IRR_OVERRIDE_;
/* /*
...@@ -651,10 +651,10 @@ public: ...@@ -651,10 +651,10 @@ public:
*/ */
//! Adds an attribute as a 3d line //! Adds an attribute as a 3d line
virtual void addLine3d(const c8* attributeName, core::line3df v) _IRR_OVERRIDE_; virtual void addLine3d(const c8* attributeName, const core::line3df& v) _IRR_OVERRIDE_;
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
virtual void setAttribute(const c8* attributeName, core::line3df v) _IRR_OVERRIDE_; virtual void setAttribute(const c8* attributeName, const core::line3df& v) _IRR_OVERRIDE_;
//! Gets an attribute as a 3d line //! Gets an attribute as a 3d line
//! \param attributeName: Name of the attribute to get. //! \param attributeName: Name of the attribute to get.
...@@ -667,7 +667,7 @@ public: ...@@ -667,7 +667,7 @@ public:
virtual core::line3df getAttributeAsLine3d(s32 index) _IRR_OVERRIDE_; virtual core::line3df getAttributeAsLine3d(s32 index) _IRR_OVERRIDE_;
//! Sets an attribute as a 3d line //! Sets an attribute as a 3d line
virtual void setAttribute(s32 index, core::line3df v) _IRR_OVERRIDE_; virtual void setAttribute(s32 index, const core::line3df& v) _IRR_OVERRIDE_;
/* /*
......
...@@ -222,7 +222,7 @@ void CSceneCollisionManager::getPickedNodeBB(ISceneNode* root, ...@@ -222,7 +222,7 @@ void CSceneCollisionManager::getPickedNodeBB(ISceneNode* root,
ISceneNode* CSceneCollisionManager::getSceneNodeAndCollisionPointFromRay( ISceneNode* CSceneCollisionManager::getSceneNodeAndCollisionPointFromRay(
core::line3df ray, const core::line3df& ray,
core::vector3df & outCollisionPoint, core::vector3df & outCollisionPoint,
core::triangle3df & outTriangle, core::triangle3df & outTriangle,
s32 idBitMask, s32 idBitMask,
...@@ -258,7 +258,8 @@ ISceneNode* CSceneCollisionManager::getSceneNodeAndCollisionPointFromRay( ...@@ -258,7 +258,8 @@ ISceneNode* CSceneCollisionManager::getSceneNodeAndCollisionPointFromRay(
// node in order to find the nearest collision point, so sorting them by // node in order to find the nearest collision point, so sorting them by
// bounding box would be pointless. // bounding box would be pointless.
getPickedNodeFromBBAndSelector(collisionRootNode, ray, idBitMask, core::line3df rayRest(ray);
getPickedNodeFromBBAndSelector(collisionRootNode, rayRest, idBitMask,
noDebugObjects, bestDistanceSquared, bestNode, noDebugObjects, bestDistanceSquared, bestNode,
outCollisionPoint, outTriangle); outCollisionPoint, outTriangle);
return bestNode; return bestNode;
...@@ -754,7 +755,7 @@ core::vector3df CSceneCollisionManager::collideEllipsoidWithWorld( ...@@ -754,7 +755,7 @@ core::vector3df CSceneCollisionManager::collideEllipsoidWithWorld(
core::vector3df CSceneCollisionManager::collideWithWorld(s32 recursionDepth, core::vector3df CSceneCollisionManager::collideWithWorld(s32 recursionDepth,
SCollisionData &colData, core::vector3df pos, core::vector3df vel) SCollisionData &colData, const core::vector3df& pos, const core::vector3df& vel)
{ {
f32 veryCloseDistance = colData.slidingSpeed; f32 veryCloseDistance = colData.slidingSpeed;
......
...@@ -72,9 +72,9 @@ namespace scene ...@@ -72,9 +72,9 @@ namespace scene
//! Gets the scene node and nearest collision point for a ray based on //! Gets the scene node and nearest collision point for a ray based on
//! the nodes' id bitmasks, bounding boxes and triangle selectors. //! the nodes' id bitmasks, bounding boxes and triangle selectors.
virtual ISceneNode* getSceneNodeAndCollisionPointFromRay( virtual ISceneNode* getSceneNodeAndCollisionPointFromRay(
core::line3df ray, const core::line3df& ray,
core::vector3df & outCollisionPoint, core::vector3df& outCollisionPoint,
core::triangle3df & outTriangle, core::triangle3df& outTriangle,
s32 idBitMask = 0, s32 idBitMask = 0,
ISceneNode * collisionRootNode = 0, ISceneNode * collisionRootNode = 0,
bool noDebugObjects = false) _IRR_OVERRIDE_; bool noDebugObjects = false) _IRR_OVERRIDE_;
...@@ -141,7 +141,7 @@ namespace scene ...@@ -141,7 +141,7 @@ namespace scene
ISceneNode*& outNode); ISceneNode*& outNode);
core::vector3df collideWithWorld(s32 recursionDepth, SCollisionData &colData, core::vector3df collideWithWorld(s32 recursionDepth, SCollisionData &colData,
core::vector3df pos, core::vector3df vel); const core::vector3df& pos, const core::vector3df& vel);
inline bool getLowestRoot(f32 a, f32 b, f32 c, f32 maxR, f32* root); inline bool getLowestRoot(f32 a, f32 b, f32 c, f32 maxR, f32* root);
......
...@@ -75,21 +75,21 @@ public: ...@@ -75,21 +75,21 @@ public:
virtual void setColor(video::SColor color) {}; virtual void setColor(video::SColor color) {};
virtual void setBool(bool boolValue) {}; virtual void setBool(bool boolValue) {};
virtual void setBinary(void* data, s32 maxLenght) {}; virtual void setBinary(void* data, s32 maxLenght) {};
virtual void setVector(core::vector3df v) {}; virtual void setVector(const core::vector3df& v) {};
virtual void setPosition(core::position2di v) {}; virtual void setPosition(core::position2di v) {};
virtual void setRect(core::rect<s32> v) {}; virtual void setRect(core::rect<s32> v) {};
virtual void setQuaternion(core::quaternion v) {}; virtual void setQuaternion(core::quaternion v) {};
virtual void setMatrix(core::matrix4 v) {}; virtual void setMatrix(core::matrix4 v) {};
virtual void setTriangle(core::triangle3df v) {}; virtual void setTriangle(const core::triangle3df& v) {};
virtual void setVector2d(core::vector2df v) {}; virtual void setVector2d(core::vector2df v) {};
virtual void setVector2d(core::vector2di v) {}; virtual void setVector2d(core::vector2di v) {};
virtual void setLine2d(core::line2df v) {}; virtual void setLine2d(core::line2df v) {};
virtual void setLine2d(core::line2di v) {}; virtual void setLine2d(core::line2di v) {};
virtual void setLine3d(core::line3df v) {}; virtual void setLine3d(const core::line3df& v) {};
virtual void setLine3d(core::line3di v) {}; virtual void setLine3d(const core::line3di& v) {};
virtual void setDimension2d(core::dimension2du v) {}; virtual void setDimension2d(core::dimension2du v) {};
virtual void setBBox(core::aabbox3d<f32> v) {}; virtual void setBBox(const core::aabbox3d<f32>& v) {};
virtual void setPlane(core::plane3df v) {}; virtual void setPlane(const core::plane3df& v) {};
virtual void setUserPointer(void* v) {}; virtual void setUserPointer(void* v) {};
virtual void setEnum(const char* enumValue, const char* const* enumerationLiterals) {}; virtual void setEnum(const char* enumValue, const char* const* enumerationLiterals) {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment