[Bf-blender-cvs] [5f903a5] temp_bge_moto: BGE: Moto: merge MT_Tuple and MT_Point in MT_Vector.

Porteries Tristan noreply at git.blender.org
Sat Oct 31 22:48:56 CET 2015


Commit: 5f903a5eddd7f922a93c79bace3b1572521b8d25
Author: Porteries Tristan
Date:   Sat Oct 31 11:38:06 2015 +0100
Branches: temp_bge_moto
https://developer.blender.org/rB5f903a5eddd7f922a93c79bace3b1572521b8d25

BGE: Moto: merge MT_Tuple and MT_Point in MT_Vector.

This commit also replace MT_Tuple and MT_Point in ik solver and BGE with command :

find . -type f -exec sed -i 's/MT_Tuple/MT_Vector/g' {} +
find . -type f -exec sed -i 's/MT_Point/MT_Vector/g' {} +

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

M	intern/iksolver/intern/IK_QJacobianSolver.cpp
M	intern/iksolver/intern/IK_QSegment.h
M	intern/iksolver/test/ik_glut_test/intern/ChainDrawer.h
M	intern/moto/CMakeLists.txt
M	intern/moto/include/MT_CmMatrix4x4.h
M	intern/moto/include/MT_Plane3.h
M	intern/moto/include/MT_Plane3.inl
D	intern/moto/include/MT_Point2.h
D	intern/moto/include/MT_Point2.inl
D	intern/moto/include/MT_Point3.h
D	intern/moto/include/MT_Point3.inl
M	intern/moto/include/MT_Transform.h
D	intern/moto/include/MT_Tuple2.h
D	intern/moto/include/MT_Tuple3.h
D	intern/moto/include/MT_Tuple4.h
M	intern/moto/include/MT_Vector2.h
M	intern/moto/include/MT_Vector2.inl
M	intern/moto/include/MT_Vector3.h
M	intern/moto/include/MT_Vector3.inl
M	intern/moto/include/MT_Vector4.h
M	intern/moto/intern/MT_CmMatrix4x4.cpp
D	intern/moto/intern/MT_Point3.cpp
M	source/gameengine/Converter/BL_ActionActuator.h
M	source/gameengine/Converter/BL_ArmatureObject.cpp
M	source/gameengine/Converter/BL_BlenderDataConversion.cpp
M	source/gameengine/Converter/BL_MeshDeformer.h
M	source/gameengine/Converter/BL_ModifierDeformer.cpp
M	source/gameengine/Converter/BL_ShapeActionActuator.cpp
M	source/gameengine/Converter/BL_ShapeActionActuator.h
M	source/gameengine/Converter/BL_ShapeDeformer.cpp
M	source/gameengine/Converter/BL_SkinDeformer.cpp
M	source/gameengine/Converter/KX_BlenderSceneConverter.cpp
M	source/gameengine/Converter/KX_SoftBodyDeformer.cpp
M	source/gameengine/GameLogic/SCA_IObject.cpp
M	source/gameengine/GameLogic/SCA_IObject.h
M	source/gameengine/Ketsji/BL_BlenderShader.h
M	source/gameengine/Ketsji/BL_Material.h
M	source/gameengine/Ketsji/BL_Shader.cpp
M	source/gameengine/Ketsji/BL_Shader.h
M	source/gameengine/Ketsji/KX_BlenderMaterial.cpp
M	source/gameengine/Ketsji/KX_Camera.cpp
M	source/gameengine/Ketsji/KX_Camera.h
M	source/gameengine/Ketsji/KX_CameraActuator.cpp
M	source/gameengine/Ketsji/KX_ConstraintActuator.cpp
M	source/gameengine/Ketsji/KX_GameObject.cpp
M	source/gameengine/Ketsji/KX_GameObject.h
M	source/gameengine/Ketsji/KX_IPOTransform.h
M	source/gameengine/Ketsji/KX_IPO_SGController.cpp
M	source/gameengine/Ketsji/KX_IPO_SGController.h
M	source/gameengine/Ketsji/KX_IpoConvert.cpp
M	source/gameengine/Ketsji/KX_KetsjiEngine.cpp
M	source/gameengine/Ketsji/KX_MotionState.cpp
M	source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
M	source/gameengine/Ketsji/KX_MouseFocusSensor.h
M	source/gameengine/Ketsji/KX_NavMeshObject.cpp
M	source/gameengine/Ketsji/KX_NavMeshObject.h
M	source/gameengine/Ketsji/KX_NearSensor.cpp
M	source/gameengine/Ketsji/KX_ObjectActuator.cpp
M	source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
M	source/gameengine/Ketsji/KX_ObstacleSimulation.h
M	source/gameengine/Ketsji/KX_PositionInterpolator.cpp
M	source/gameengine/Ketsji/KX_PositionInterpolator.h
M	source/gameengine/Ketsji/KX_PyMath.cpp
M	source/gameengine/Ketsji/KX_PyMath.h
M	source/gameengine/Ketsji/KX_PythonInit.cpp
M	source/gameengine/Ketsji/KX_RadarSensor.cpp
M	source/gameengine/Ketsji/KX_RadarSensor.h
M	source/gameengine/Ketsji/KX_RayCast.cpp
M	source/gameengine/Ketsji/KX_RayCast.h
M	source/gameengine/Ketsji/KX_RaySensor.cpp
M	source/gameengine/Ketsji/KX_RaySensor.h
M	source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp
M	source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp
M	source/gameengine/Ketsji/KX_Scene.cpp
M	source/gameengine/Ketsji/KX_SoundActuator.cpp
M	source/gameengine/Ketsji/KX_SteeringActuator.cpp
M	source/gameengine/Ketsji/KX_TrackToActuator.cpp
M	source/gameengine/Ketsji/KX_VertexProxy.cpp
M	source/gameengine/Physics/Bullet/CcdGraphicController.cpp
M	source/gameengine/Physics/Bullet/CcdGraphicController.h
M	source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
M	source/gameengine/Physics/Bullet/CcdPhysicsController.h
M	source/gameengine/Physics/common/PHY_IPhysicsController.h
M	source/gameengine/Rasterizer/RAS_BucketManager.cpp
M	source/gameengine/Rasterizer/RAS_IRasterizer.h
M	source/gameengine/Rasterizer/RAS_MeshObject.cpp
M	source/gameengine/Rasterizer/RAS_MeshObject.h
M	source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
M	source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
M	source/gameengine/Rasterizer/RAS_TexMatrix.h
M	source/gameengine/Rasterizer/RAS_TexVert.cpp
M	source/gameengine/Rasterizer/RAS_TexVert.h
M	source/gameengine/Rasterizer/RAS_texmatrix.cpp
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_Spatial.h
M	source/gameengine/SceneGraph/SG_Tree.cpp
M	source/gameengine/SceneGraph/SG_Tree.h
M	source/gameengine/VideoTexture/ImageRender.cpp
M	source/gameengine/VideoTexture/ImageRender.h

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

diff --git a/intern/iksolver/intern/IK_QJacobianSolver.cpp b/intern/iksolver/intern/IK_QJacobianSolver.cpp
index 75f51f5..1fd8f16 100644
--- a/intern/iksolver/intern/IK_QJacobianSolver.cpp
+++ b/intern/iksolver/intern/IK_QJacobianSolver.cpp
@@ -257,7 +257,7 @@ void IK_QJacobianSolver::ConstrainPoleVector(IK_QSegment *root, std::list<IK_QTa
 		// desired rotation based on the pole vector constraint. we use
 		// transpose instead of inverse because we have orthogonal matrices
 		// anyway, and in case of a singular matrix we don't get NaN's.
-		MT_Transform trans(MT_Point3(0, 0, 0), polemat.transposed() * mat);
+		MT_Transform trans(MT_Vector3(0, 0, 0), polemat.transposed() * mat);
 		m_rootmatrix = trans * m_rootmatrix;
 	}
 }
diff --git a/intern/iksolver/intern/IK_QSegment.h b/intern/iksolver/intern/IK_QSegment.h
index b40bf37..28ec475 100644
--- a/intern/iksolver/intern/IK_QSegment.h
+++ b/intern/iksolver/intern/IK_QSegment.h
@@ -117,10 +117,10 @@ public:
 	MT_Vector3 TranslationChange() const;
 
 	// the start and end of the segment
-	const MT_Point3 &GlobalStart() const
+	const MT_Vector3 &GlobalStart() const
 	{ return m_global_start; }
 
-	const MT_Point3 &GlobalEnd() const
+	const MT_Vector3 &GlobalEnd() const
 	{ return m_global_transform.getOrigin(); }
 
 	// the global transformation at the end of the segment
@@ -201,7 +201,7 @@ protected:
 	MT_Scalar m_max_extension;
 
 	// accumulated transformations starting from root
-	MT_Point3 m_global_start;
+	MT_Vector3 m_global_start;
 	MT_Transform m_global_transform;
 
 	// number degrees of freedom, (first) id of this segments DOF's
diff --git a/intern/iksolver/test/ik_glut_test/intern/ChainDrawer.h b/intern/iksolver/test/ik_glut_test/intern/ChainDrawer.h
index f286380..5c9ae49 100644
--- a/intern/iksolver/test/ik_glut_test/intern/ChainDrawer.h
+++ b/intern/iksolver/test/ik_glut_test/intern/ChainDrawer.h
@@ -184,7 +184,7 @@ private :
 
 		
 				MT_Transform seg_t_pre_rot(
-					MT_Point3(
+					MT_Vector3(
 						seg_start->seg_start[0],
 						seg_start->seg_start[1],
 						seg_start->seg_start[2]
@@ -196,11 +196,11 @@ private :
 
 				
 
-				MT_Transform seg_t_rot(MT_Point3(0,0,0),seg_rot);
+				MT_Transform seg_t_rot(MT_Vector3(0,0,0),seg_rot);
 				MT_Transform seg_local = seg_t_pre_rot * seg_t_rot * translation;
 
 				MT_Vector3 bone_start = global_transform * 	
-					MT_Point3(
+					MT_Vector3(
 						seg_start->seg_start[0],
 						seg_start->seg_start[1],
 						seg_start->seg_start[2]
diff --git a/intern/moto/CMakeLists.txt b/intern/moto/CMakeLists.txt
index 8075c66..01bc2f2 100644
--- a/intern/moto/CMakeLists.txt
+++ b/intern/moto/CMakeLists.txt
@@ -37,7 +37,6 @@ set(SRC
 	intern/MT_Matrix3x3.cpp
 	intern/MT_Matrix4x4.cpp
 	intern/MT_Plane3.cpp
-	intern/MT_Point3.cpp
 	intern/MT_Quaternion.cpp
 	intern/MT_Transform.cpp
 	intern/MT_Vector2.cpp
@@ -53,15 +52,10 @@ set(SRC
 	include/MT_MinMax.h
 	include/MT_Optimize.h
 	include/MT_Plane3.h
-	include/MT_Point2.h
-	include/MT_Point3.h
 	include/MT_Quaternion.h
 	include/MT_Scalar.h
 	include/MT_Stream.h
 	include/MT_Transform.h
-	include/MT_Tuple2.h
-	include/MT_Tuple3.h
-	include/MT_Tuple4.h
 	include/MT_Vector2.h
 	include/MT_Vector3.h
 	include/MT_Vector4.h
@@ -71,9 +65,6 @@ set(SRC
 
 	include/MT_Matrix3x3.inl
 	include/MT_Matrix4x4.inl
-	include/MT_Plane3.inl
-	include/MT_Point2.inl
-	include/MT_Point3.inl
 	include/MT_Quaternion.inl
 	include/MT_Vector2.inl
 	include/MT_Vector3.inl
diff --git a/intern/moto/include/MT_CmMatrix4x4.h b/intern/moto/include/MT_CmMatrix4x4.h
index 962451c..5c89b86 100644
--- a/intern/moto/include/MT_CmMatrix4x4.h
+++ b/intern/moto/include/MT_CmMatrix4x4.h
@@ -46,7 +46,6 @@
 
 #include "MT_Scalar.h"
 
-class MT_Point3;
 class MT_Vector3;
 
 class MT_CmMatrix4x4
@@ -72,7 +71,7 @@ public :
 	);
 
 	MT_CmMatrix4x4(
-		const MT_Point3& orig,
+		const MT_Vector3& orig,
 		const MT_Vector3& dir,
 		const MT_Vector3 up
 	);
@@ -113,7 +112,7 @@ public :
 	GetDir(
 	) const;
 
-		MT_Point3
+		MT_Vector3
 	GetPos(
 	) const;
 
diff --git a/intern/moto/include/MT_Plane3.h b/intern/moto/include/MT_Plane3.h
index f208b37..cdc767a 100644
--- a/intern/moto/include/MT_Plane3.h
+++ b/intern/moto/include/MT_Plane3.h
@@ -33,8 +33,8 @@
 #ifndef MT_PLANE3
 #define MT_PLANE3
 
-#include "MT_Tuple4.h"
-#include "MT_Point3.h"
+#include "MT_Vector4.h"
+#include "MT_Vector3.h"
 
 /**
  * A simple 3d plane class.
@@ -42,12 +42,12 @@
  * This class represents a plane in 3d. The internal parameterization used
  * is n.x + d =0 where n is a unit vector and d is a scalar.
  *
- * It inherits data from MT_Tuple4 please see this class for low level
+ * It inherits data from MT_Vector4 please see this class for low level
  * access to the internal representation.
  * 
  */
 
-class MT_Plane3 : public MT_Tuple4
+class MT_Plane3 : public MT_Vector4
 {
 public :
 	/**
@@ -81,7 +81,7 @@ public :
 	MT_Plane3(
 		const MT_Plane3 & p
 	):
-		MT_Tuple4(p)
+		MT_Vector4(p)
 	{
 	}
 
diff --git a/intern/moto/include/MT_Plane3.inl b/intern/moto/include/MT_Plane3.inl
index 77db9b3..780ed5d 100644
--- a/intern/moto/include/MT_Plane3.inl
+++ b/intern/moto/include/MT_Plane3.inl
@@ -48,7 +48,7 @@ GEN_INLINE
 MT_Plane3::
 MT_Plane3(
 ):
-	MT_Tuple4()
+	MT_Vector4()
 {
 	m_co[0] = MT_Scalar(1);
 	m_co[1] = MT_Scalar(0);
diff --git a/intern/moto/include/MT_Point2.h b/intern/moto/include/MT_Point2.h
deleted file mode 100644
index 53eba1d..0000000
--- a/intern/moto/include/MT_Point2.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file moto/include/MT_Point2.h
- *  \ingroup moto
- */
-
-
-/*
-
- * Copyright (c) 2000 Gino van den Bergen <gino at acm.org>
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.  Gino van den Bergen makes no
- * representations about the suitability of this software for any
- * purpose.  It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef MT_POINT2_H
-#define MT_POINT2_H
-
-#include "MT_Vector2.h"
-
-class MT_Point2 : public MT_Vector2 {
-public:
-    MT_Point2() {}
-    template <typename T>
-    MT_Point2(const T *v2) : MT_Vector2(v2) {} 
-    MT_Point2(MT_Scalar x2, MT_Scalar y2) : MT_Vector2(x2, y2) {}
-
-    MT_Point2& operator+=(const MT_Vector2& v);
-    MT_Point2& operator-=(const MT_Vector2& v);
-    MT_Point2& operator=(const MT_Vector2& v);
-
-    MT_Scalar  distance(const MT_Point2& p) const;
-    MT_Scalar  distance2(const MT_Point2& p) const;
-
-    MT_Point2  lerp(const MT_Point2& p, MT_Scalar t) const;
-};
-
-MT_Point2  operator+(const MT_Point2& p, const MT_Vector2& v);
-MT_Point2  operator-(const MT_Point2& p, const MT_Vector2& v);
-MT_Vector2 operator-(const MT_Point2& p1, const MT_Point2& p2);
-
-MT_Scalar MT_distance(const MT_Point2& p1, const MT_Point2& p2);
-MT_Scalar MT_distance2(const MT_Point2& p1, const MT_Point2& p2);
-
-MT_Point2 MT_lerp(const MT_Point2& p1, const MT_Point2& p2, MT_Scalar t);
-
-#ifdef GEN_INLINED
-#include "MT_Point2.inl"
-#endif
-
-#endif
-
diff --git a/intern/moto/include/MT_Point2.inl b/intern/moto/include/MT_Point2.inl
deleted file mode 100644
index ec09a32..0000000
--- a/intern/moto/include/MT_Point2.inl
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "MT_Optimize.h"
-
-GEN_INLINE MT_Point2& MT_Point2::operator+=(const MT_Vector2& v) {
-    m_co[0] += v[0]; m_co[1] += v[1]; 
-    return *this;
-}
-
-GEN_INLINE MT_Point2& MT_Point2::operator-=(const MT_Vector2& v) {
-    m_co[0] -= v[0]; m_co[1] -= v[1]; 
-    return *this;
-}
-
-GEN_INLINE MT_Point2& MT_Point2::operator=(const MT_Vector2& v) {
-    m_co[0] = v[0]; m_co[1] = v[1]; 
-    return *this;
-}
-
-GEN_INLINE MT_Scalar MT_Point2::distance(const MT_Point2& p) const {
-    return (p - *this).length();
-}
-
-GEN_INLINE MT_Scalar MT_Point2::distance2(const MT_Point2& p) const {
-    return (p - *this).length2();
-}
-
-GEN_INLINE MT_Point2 MT_Point2::lerp(const MT_Point2& p, MT_Scalar t) const {
-    return MT_Point2(m_co[0] + (p[0] - m_co[0]) * t,
-                     m_co[1] + (p[1] - m_co[1]) * t);
-}
-
-GEN_INLINE MT_Point2  operator+(const MT_Point2& p, const MT_Vector2& v) {
-    return MT_Point2(p[0] + v[0], p[1] + v[1]);
-}
-
-GEN_INLINE MT_Point2  operator-(const MT_Point2& p, const MT_Vector2& v) {
-    return MT_Point2(p[0] - v[0], p[1] - v[1]);
-}
-
-GEN_INLINE MT_Vector2 operator-(const MT_Point2& p1, const MT_Point2& p2) {
-    return MT_Vector2(p1[0] - p2[0], p1[1] - p2[1]);
-}
-
-GEN_INLINE MT_Scalar MT_distance(const MT_Point2& p1, const MT_Point2& p2) { 
-    return p1.distance(p2); 
-}
-
-GEN_INLINE MT_Scalar MT_distance2(const MT_Point2& p1, const MT_Point2& p2) { 
-    return p1.distance2(p2); 
-}
-
-GEN_INLINE MT_Point2 MT_lerp(const MT_Point2& p1, const MT_Point2& p2, MT_Scalar t) {
-    return p1.lerp(p2, t);
-}
-
diff --git a/intern/moto/include/MT_Point3.h b/intern/moto/include/MT_Point3.h
deleted file mode 100644
index 8b0431c..0000000
--- a/intern/moto/include/MT_Point3.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BL

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list