diff options
author | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-12-14 08:39:52 +0300 |
---|---|---|
committer | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-12-14 08:56:50 +0300 |
commit | 94b34c9d44dea4c3f22384a76122d57aec53b6ef (patch) | |
tree | 26f27ce23bb73aa8173166de245749be0aaccd0e /source/gameengine/SceneGraph | |
parent | 9c53e55db50d1e745af4d85aa32a3d43a119a7c6 (diff) |
BGE Scenegraph clean up: double-promotion warnings
Diffstat (limited to 'source/gameengine/SceneGraph')
-rw-r--r-- | source/gameengine/SceneGraph/SG_BBox.cpp | 20 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_BBox.h | 2 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_Spatial.cpp | 16 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_Tree.cpp | 12 |
4 files changed, 25 insertions, 25 deletions
diff --git a/source/gameengine/SceneGraph/SG_BBox.cpp b/source/gameengine/SceneGraph/SG_BBox.cpp index 0ecf6284a14..f9d83d37384 100644 --- a/source/gameengine/SceneGraph/SG_BBox.cpp +++ b/source/gameengine/SceneGraph/SG_BBox.cpp @@ -37,8 +37,8 @@ #include "SG_Node.h" SG_BBox::SG_BBox() : - m_min(0.0, 0.0, 0.0), - m_max(0.0, 0.0, 0.0) + m_min(0.0f, 0.0f, 0.0f), + m_max(0.0f, 0.0f, 0.0f) { } @@ -209,11 +209,11 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const { left.m_min = m_min; left.m_max[0] = m_max[0]; - left.m_max[1] = m_min[1] + sizey/2.0; + left.m_max[1] = m_min[1] + sizey/2.0f; left.m_max[2] = m_max[2]; right.m_min[0] = m_min[0]; - right.m_min[1] = m_min[1] + sizey/2.0; + right.m_min[1] = m_min[1] + sizey/2.0f; right.m_min[2] = m_min[2]; right.m_max = m_max; std::cout << "splity" << std::endl; @@ -222,11 +222,11 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const left.m_min = m_min; left.m_max[0] = m_max[0]; left.m_max[1] = m_max[1]; - left.m_max[2] = m_min[2] + sizez/2.0; + left.m_max[2] = m_min[2] + sizez/2.0f; right.m_min[0] = m_min[0]; right.m_min[1] = m_min[1]; - right.m_min[2] = m_min[2] + sizez/2.0; + right.m_min[2] = m_min[2] + sizez/2.0f; right.m_max = m_max; std::cout << "splitz" << std::endl; } @@ -234,11 +234,11 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const else { if (sizex > sizez) { left.m_min = m_min; - left.m_max[0] = m_min[0] + sizex/2.0; + left.m_max[0] = m_min[0] + sizex/2.0f; left.m_max[1] = m_max[1]; left.m_max[2] = m_max[2]; - right.m_min[0] = m_min[0] + sizex/2.0; + right.m_min[0] = m_min[0] + sizex/2.0f; right.m_min[1] = m_min[1]; right.m_min[2] = m_min[2]; right.m_max = m_max; @@ -248,11 +248,11 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const left.m_min = m_min; left.m_max[0] = m_max[0]; left.m_max[1] = m_max[1]; - left.m_max[2] = m_min[2] + sizez/2.0; + left.m_max[2] = m_min[2] + sizez/2.0f; right.m_min[0] = m_min[0]; right.m_min[1] = m_min[1]; - right.m_min[2] = m_min[2] + sizez/2.0; + right.m_min[2] = m_min[2] + sizez/2.0f; right.m_max = m_max; std::cout << "splitz" << std::endl; } diff --git a/source/gameengine/SceneGraph/SG_BBox.h b/source/gameengine/SceneGraph/SG_BBox.h index cd1c523ff40..3c524dc7f18 100644 --- a/source/gameengine/SceneGraph/SG_BBox.h +++ b/source/gameengine/SceneGraph/SG_BBox.h @@ -81,7 +81,7 @@ public: /** * Scales the bounding box about the optional point. */ - void scale(const MT_Vector3 &size, const MT_Point3 &point = MT_Point3(0.0, 0.0, 0.0)); + void scale(const MT_Vector3 &size, const MT_Point3 &point = MT_Point3(0.0f, 0.0f, 0.0f)); #endif SG_BBox transform(const MT_Transform &world) const; /** diff --git a/source/gameengine/SceneGraph/SG_Spatial.cpp b/source/gameengine/SceneGraph/SG_Spatial.cpp index f30c80da434..5cb75873237 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.cpp +++ b/source/gameengine/SceneGraph/SG_Spatial.cpp @@ -43,18 +43,18 @@ SG_Spatial( ): SG_IObject(clientobj,clientinfo,callbacks), - m_localPosition(0.0,0.0,0.0), - m_localRotation(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0), - m_localScaling(1.f,1.f,1.f), + m_localPosition(0.0f,0.0f,0.0f), + m_localRotation(1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f), + m_localScaling(1.0f,1.0f,1.0f), - m_worldPosition(0.0,0.0,0.0), - m_worldRotation(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0), - m_worldScaling(1.f,1.f,1.f), + m_worldPosition(0.0f,0.0f,0.0f), + m_worldRotation(1.0f,0.0f,0.0f,0.0f,1.0f,0.0f,0.0f,0.0f,1.0f), + m_worldScaling(1.0f,1.0f,1.0f), m_parent_relation (NULL), - m_bbox(MT_Point3(-1.0, -1.0, -1.0), MT_Point3(1.0, 1.0, 1.0)), - m_radius(1.0), + m_bbox(MT_Point3(-1.0f, -1.0f, -1.0f), MT_Point3(1.0f, 1.0f, 1.0f)), + m_radius(1.0f), m_modified(false), m_ogldirty(false) { diff --git a/source/gameengine/SceneGraph/SG_Tree.cpp b/source/gameengine/SceneGraph/SG_Tree.cpp index bef246533a6..87feb2c012a 100644 --- a/source/gameengine/SceneGraph/SG_Tree.cpp +++ b/source/gameengine/SceneGraph/SG_Tree.cpp @@ -41,7 +41,7 @@ SG_Tree::SG_Tree() : m_left(NULL), m_right(NULL), m_parent(NULL), - m_radius(0.0), + m_radius(0.0f), m_client_object(NULL) { } @@ -62,7 +62,7 @@ SG_Tree::SG_Tree(SG_Tree* left, SG_Tree* right) : m_bbox += m_right->m_bbox; m_right->m_parent = this; } - m_center = (m_bbox.m_min + m_bbox.m_max)/2.0; + m_center = (m_bbox.m_min + m_bbox.m_max)/2.0f; m_radius = (m_bbox.m_max - m_bbox.m_min).length(); } @@ -73,7 +73,7 @@ SG_Tree::SG_Tree(SG_Node* client) : m_client_object(client) { m_bbox = SG_BBox(client->BBox(), client->GetWorldTransform()); - m_center = (m_bbox.m_min + m_bbox.m_max)/2.0; + m_center = (m_bbox.m_min + m_bbox.m_max)/2.0f; m_radius = (m_bbox.m_max - m_bbox.m_min).length(); } @@ -162,7 +162,7 @@ void SG_Tree::SetLeft(SG_Tree *left) { m_left = left; m_bbox += left->m_bbox; - m_center = (m_bbox.m_min + m_bbox.m_max)/2.0; + m_center = (m_bbox.m_min + m_bbox.m_max)/2.0f; m_radius = (m_bbox.m_max - m_bbox.m_min).length(); } @@ -170,7 +170,7 @@ void SG_Tree::SetRight(SG_Tree *right) { m_right = right; m_bbox += right->m_bbox; - m_center = (m_bbox.m_min + m_bbox.m_max)/2.0; + m_center = (m_bbox.m_min + m_bbox.m_max)/2.0f; m_radius = (m_bbox.m_max - m_bbox.m_min).length(); } @@ -263,7 +263,7 @@ SG_Tree* SG_TreeFactory::MakeTreeDown(SG_BBox &bbox) return root; } - if (bbox.volume() < 1.0) + if (bbox.volume() < 1.0f) return MakeTreeUp(); SG_TreeFactory lefttree; |