[Bf-blender-cvs] [94b34c9] master: BGE Scenegraph clean up: double-promotion warnings

Jorge Bernal noreply at git.blender.org
Mon Dec 14 06:57:18 CET 2015


Commit: 94b34c9d44dea4c3f22384a76122d57aec53b6ef
Author: Jorge Bernal
Date:   Mon Dec 14 06:39:52 2015 +0100
Branches: master
https://developer.blender.org/rB94b34c9d44dea4c3f22384a76122d57aec53b6ef

BGE Scenegraph clean up: double-promotion warnings

===================================================================

M	source/gameengine/SceneGraph/SG_BBox.cpp
M	source/gameengine/SceneGraph/SG_BBox.h
M	source/gameengine/SceneGraph/SG_Spatial.cpp
M	source/gameengine/SceneGraph/SG_Tree.cpp

===================================================================

diff --git a/source/gameengine/SceneGraph/SG_BBox.cpp b/source/gameengine/SceneGraph/SG_BBox.cpp
index 0ecf628..f9d83d3 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 cd1c523..3c524dc 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 f30c80d..5cb7587 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 bef2465..87feb2c 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;




More information about the Bf-blender-cvs mailing list