BGE Scenegraph clean up: double-promotion warnings
authorJorge Bernal <jbernalmartinez@gmail.com>
Mon, 14 Dec 2015 05:39:52 +0000 (06:39 +0100)
committerJorge Bernal <jbernalmartinez@gmail.com>
Mon, 14 Dec 2015 05:56:50 +0000 (06:56 +0100)
source/gameengine/SceneGraph/SG_BBox.cpp
source/gameengine/SceneGraph/SG_BBox.h
source/gameengine/SceneGraph/SG_Spatial.cpp
source/gameengine/SceneGraph/SG_Tree.cpp

index 0ecf6284a1410beeb08af2cbba6b78f5dc10f9ae..f9d83d3738419c1c338d4add48fa2bdfa9969906 100644 (file)
@@ -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;
                }
index cd1c523ff4085ad07880b54228038d34d74fcfa0..3c524dc7f1878401ae6385002ef559a971f31dbe 100644 (file)
@@ -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;
        /**
index f30c80da434e7acb276473c3811471c43961755b..5cb758732370adc776877403bc272fea7c2549a7 100644 (file)
@@ -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)
 {
index bef246533a6bb78895e7276e3d22d009fce709b0..87feb2c012a2cedbf2f366cacf03b349e26c5d2a 100644 (file)
@@ -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;