Commit 9eb99c5b authored by hybrid's avatar hybrid

Fixed quaternion warnings. Fixed returned interface pointers for newly...

Fixed quaternion warnings. Fixed returned interface pointers for newly introduced scene node changes.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1299 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 7ad9b812
...@@ -107,6 +107,7 @@ namespace scene ...@@ -107,6 +107,7 @@ namespace scene
class IMetaTriangleSelector; class IMetaTriangleSelector;
class IMeshManipulator; class IMeshManipulator;
class ITextSceneNode; class ITextSceneNode;
class IVolumeLightSceneNode;
class ISceneNodeFactory; class ISceneNodeFactory;
class ISceneNodeAnimatorFactory; class ISceneNodeAnimatorFactory;
class ISceneUserDataSerializer; class ISceneUserDataSerializer;
...@@ -308,7 +309,7 @@ namespace scene ...@@ -308,7 +309,7 @@ namespace scene
//! adds Volume Lighting Scene Node. //! adds Volume Lighting Scene Node.
//! the returned pointer must not be dropped. //! the returned pointer must not be dropped.
/** Example Usage: /** Example Usage:
scene::ISceneNode * n = smgr->addVolumeLightSceneNode(NULL, -1, scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(NULL, -1,
32, 32, //Subdivide U/V 32, 32, //Subdivide U/V
video::SColor(0, 180, 180, 180), //foot color video::SColor(0, 180, 180, 180), //foot color
video::SColor(0, 0, 0, 0) //tail color video::SColor(0, 0, 0, 0) //tail color
...@@ -319,7 +320,7 @@ namespace scene ...@@ -319,7 +320,7 @@ namespace scene
n->getMaterial(0).setTexture(0, smgr->getVideoDriver()->getTexture("lightFalloff.png")); n->getMaterial(0).setTexture(0, smgr->getVideoDriver()->getTexture("lightFalloff.png"));
} }
**/ **/
virtual ISceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1, virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1,
const u32 subdivU = 32, const u32 subdivV = 32, const u32 subdivU = 32, const u32 subdivV = 32,
const video::SColor foot = video::SColor(51, 0, 230, 180), const video::SColor foot = video::SColor(51, 0, 230, 180),
const video::SColor tail = video::SColor(0, 0, 0, 0), const video::SColor tail = video::SColor(0, 0, 0, 0),
...@@ -339,7 +340,7 @@ namespace scene ...@@ -339,7 +340,7 @@ namespace scene
\param scale: Initial scale of the scene node. \param scale: Initial scale of the scene node.
\return Returns pointer to the created test scene node. \return Returns pointer to the created test scene node.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1, virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0), const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0), const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
...@@ -356,7 +357,7 @@ namespace scene ...@@ -356,7 +357,7 @@ namespace scene
\param scale: Initial scale of the scene node. \param scale: Initial scale of the scene node.
\return Returns pointer to the created test scene node. \return Returns pointer to the created test scene node.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16, ISceneNode* parent=0, s32 id=-1, virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16, ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0), const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0), const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
......
...@@ -480,7 +480,7 @@ inline void quaternion::toEuler(vector3df& euler) const ...@@ -480,7 +480,7 @@ inline void quaternion::toEuler(vector3df& euler) const
euler.X = (f32) (atan2(2.0 * (Y*Z +X*W),(-sqx - sqy + sqz + sqw))); euler.X = (f32) (atan2(2.0 * (Y*Z +X*W),(-sqx - sqy + sqz + sqw)));
// attitude = rotation about y-axis // attitude = rotation about y-axis
euler.Y = asinf( clamp(-2.0 * (X*Z - Y*W), -1.0, 1.0) ); euler.Y = asinf( clamp(-2.0f * (X*Z - Y*W), -1.0f, 1.0f) );
} }
......
...@@ -233,7 +233,7 @@ namespace core ...@@ -233,7 +233,7 @@ namespace core
/** Thanks to Arras on the Irrlicht forums to add this method. /** Thanks to Arras on the Irrlicht forums to add this method.
\return A vector representing the rotation in degrees of \return A vector representing the rotation in degrees of
this vector. The Z component of the vector will always be 0. */ this vector. The Z component of the vector will always be 0. */
vector3d<T> getHorizontalAngle() vector3d<T> getHorizontalAngle() const
{ {
vector3d<T> angle; vector3d<T> angle;
...@@ -243,7 +243,7 @@ namespace core ...@@ -243,7 +243,7 @@ namespace core
if (angle.Y < 0.0f) angle.Y += 360.0f; if (angle.Y < 0.0f) angle.Y += 360.0f;
if (angle.Y >= 360.0f) angle.Y -= 360.0f; if (angle.Y >= 360.0f) angle.Y -= 360.0f;
f32 z1 = sqrtf(X*X + Z*Z); const f64 z1 = sqrt(X*X + Z*Z);
angle.X = (T)atan2(z1, Y); angle.X = (T)atan2(z1, Y);
angle.X *= (f32)RADTODEG64; angle.X *= (f32)RADTODEG64;
......
...@@ -251,13 +251,13 @@ void COpenGLTexture::copyTexture(bool newTexture) ...@@ -251,13 +251,13 @@ void COpenGLTexture::copyTexture(bool newTexture)
{ {
glBindTexture(GL_TEXTURE_2D, TextureName); glBindTexture(GL_TEXTURE_2D, TextureName);
if (Driver->testGLError()) if (Driver->testGLError())
os::Printer::log("Could not bind Texture", ELL_ERROR); os::Printer::log("Could not bind Texture", ELL_ERROR);
if (!Image) if (!Image)
{ {
os::Printer::log("No image for OpenGL texture to upload", ELL_ERROR); os::Printer::log("No image for OpenGL texture to upload", ELL_ERROR);
return; return;
} }
switch (Image->getColorFormat()) switch (Image->getColorFormat())
{ {
......
...@@ -424,7 +424,7 @@ ISceneNode* CSceneManager::addQuake3SceneNode(IMeshBuffer* meshBuffer, ...@@ -424,7 +424,7 @@ ISceneNode* CSceneManager::addQuake3SceneNode(IMeshBuffer* meshBuffer,
//! adds Volume Lighting Scene Node. //! adds Volume Lighting Scene Node.
//! the returned pointer must not be dropped. //! the returned pointer must not be dropped.
ISceneNode* CSceneManager::addVolumeLightSceneNode(ISceneNode* parent, s32 id, IVolumeLightSceneNode* CSceneManager::addVolumeLightSceneNode(ISceneNode* parent, s32 id,
const u32 subdivU, const u32 subdivV, const u32 subdivU, const u32 subdivV,
const video::SColor foot, const video::SColor tail, const video::SColor foot, const video::SColor tail,
const core::vector3df& position, const core::vector3df& rotation, const core::vector3df& scale) const core::vector3df& position, const core::vector3df& rotation, const core::vector3df& scale)
...@@ -432,7 +432,7 @@ ISceneNode* CSceneManager::addVolumeLightSceneNode(ISceneNode* parent, s32 id, ...@@ -432,7 +432,7 @@ ISceneNode* CSceneManager::addVolumeLightSceneNode(ISceneNode* parent, s32 id,
if (!parent) if (!parent)
parent = this; parent = this;
ISceneNode* node = new CVolumeLightSceneNode(parent, this, id, subdivU, subdivV, foot, tail, position, rotation, scale); IVolumeLightSceneNode* node = new CVolumeLightSceneNode(parent, this, id, subdivU, subdivV, foot, tail, position, rotation, scale);
node->drop(); node->drop();
return node; return node;
...@@ -440,14 +440,14 @@ ISceneNode* CSceneManager::addVolumeLightSceneNode(ISceneNode* parent, s32 id, ...@@ -440,14 +440,14 @@ ISceneNode* CSceneManager::addVolumeLightSceneNode(ISceneNode* parent, s32 id,
//! adds a test scene node for test purposes to the scene. It is a simple cube of (1,1,1) size. //! adds a test scene node for test purposes to the scene. It is a simple cube of (1,1,1) size.
//! the returned pointer must not be dropped. //! the returned pointer must not be dropped.
ISceneNode* CSceneManager::addCubeSceneNode(f32 size, ISceneNode* parent, IMeshSceneNode* CSceneManager::addCubeSceneNode(f32 size, ISceneNode* parent,
s32 id, const core::vector3df& position, s32 id, const core::vector3df& position,
const core::vector3df& rotation, const core::vector3df& scale) const core::vector3df& rotation, const core::vector3df& scale)
{ {
if (!parent) if (!parent)
parent = this; parent = this;
ISceneNode* node = new CCubeSceneNode(size, parent, this, id, position, rotation, scale); IMeshSceneNode* node = new CCubeSceneNode(size, parent, this, id, position, rotation, scale);
node->drop(); node->drop();
return node; return node;
...@@ -455,14 +455,14 @@ ISceneNode* CSceneManager::addCubeSceneNode(f32 size, ISceneNode* parent, ...@@ -455,14 +455,14 @@ ISceneNode* CSceneManager::addCubeSceneNode(f32 size, ISceneNode* parent,
//! Adds a sphere scene node for test purposes to the scene. //! Adds a sphere scene node for test purposes to the scene.
ISceneNode* CSceneManager::addSphereSceneNode(f32 radius, s32 polyCount, IMeshSceneNode* CSceneManager::addSphereSceneNode(f32 radius, s32 polyCount,
ISceneNode* parent, s32 id, const core::vector3df& position, ISceneNode* parent, s32 id, const core::vector3df& position,
const core::vector3df& rotation, const core::vector3df& scale) const core::vector3df& rotation, const core::vector3df& scale)
{ {
if (!parent) if (!parent)
parent = this; parent = this;
ISceneNode* node = new CSphereSceneNode(radius, polyCount, polyCount, parent, this, id, position, rotation, scale); IMeshSceneNode* node = new CSphereSceneNode(radius, polyCount, polyCount, parent, this, id, position, rotation, scale);
node->drop(); node->drop();
return node; return node;
......
...@@ -52,7 +52,7 @@ namespace scene ...@@ -52,7 +52,7 @@ namespace scene
//! adds Volume Lighting Scene Node. //! adds Volume Lighting Scene Node.
//! the returned pointer must not be dropped. //! the returned pointer must not be dropped.
virtual ISceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1, virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1,
const u32 subdivU = 32, const u32 subdivV = 32, const u32 subdivU = 32, const u32 subdivV = 32,
const video::SColor foot = video::SColor(51, 0, 230, 180), const video::SColor foot = video::SColor(51, 0, 230, 180),
const video::SColor tail = video::SColor(0, 0, 0, 0), const video::SColor tail = video::SColor(0, 0, 0, 0),
...@@ -60,11 +60,11 @@ namespace scene ...@@ -60,11 +60,11 @@ namespace scene
//! adds a cube scene node to the scene. It is a simple cube of (1,1,1) size. //! adds a cube scene node to the scene. It is a simple cube of (1,1,1) size.
//! the returned pointer must not be dropped. //! the returned pointer must not be dropped.
virtual ISceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1, virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0), const core::vector3df& rotation = core::vector3df(0,0,0), const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)); const core::vector3df& position = core::vector3df(0,0,0), const core::vector3df& rotation = core::vector3df(0,0,0), const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
//! Adds a sphere scene node to the scene. //! Adds a sphere scene node to the scene.
virtual ISceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16, ISceneNode* parent=0, s32 id=-1, virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16, ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0), const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0), const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)); const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
......
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