synched with trunk at revision 32129
[blender.git] / source / gameengine / Ketsji / KX_GameObject.cpp
index 2d89782393d5f1da055e986fb962ed56a1813b66..e955c344f0ab84c0b03f9b144f47f6dcdcb3d9c4 100644 (file)
@@ -34,7 +34,7 @@ typedef unsigned __int64 uint_ptr;
 typedef unsigned long uint_ptr;
 #endif
 
-#ifdef WIN32
+#if defined(WIN32) && !defined(FREE_WINDOWS)
 // This warning tells us about truncation of __long__ stl-generated names.
 // It can occasionally cause DevStudio to have internal compiler warnings.
 #pragma warning( disable : 4786 )     
@@ -102,7 +102,7 @@ KX_GameObject::KX_GameObject(
        m_pGraphicController(NULL),
        m_xray(false),
        m_pHitObject(NULL),
-       m_pObstacle(NULL),
+       m_pObstacleSimulation(NULL),
        m_isDeformable(false)
 #ifndef DISABLE_PYTHON
        , m_attr_dict(NULL)
@@ -151,11 +151,9 @@ KX_GameObject::~KX_GameObject()
                delete m_pGraphicController;
        }
 
-       if (m_pObstacle)
+       if (m_pObstacleSimulation)
        {
-               KX_Scene *scene = KX_GetActiveScene();
-               KX_ObstacleSimulation* obstacleSimulation = scene->GetObstacleSimulation();
-               obstacleSimulation->DestroyObstacle(m_pObstacle);
+               m_pObstacleSimulation->DestroyObstacleForObj(this);
        }
 
 #ifndef DISABLE_PYTHON
@@ -864,7 +862,7 @@ void KX_GameObject::AlignAxisToVect(const MT_Vector3& dir, int axis, float fac)
        {       
                case 0: //x axis
                        ori.setValue(orimat[0][2], orimat[1][2], orimat[2][2]); //pivot axis
-                       if (MT_abs(vect.dot(ori)) > 1.0-3.0*MT_EPSILON) //is the vector paralell to the pivot?
+                       if (MT_abs(vect.dot(ori)) > 1.0-3.0*MT_EPSILON) //is the vector parallel to the pivot?
                                ori.setValue(orimat[0][1], orimat[1][1], orimat[2][1]); //change the pivot!
                        if (fac == 1.0) {
                                x = vect;
@@ -1347,7 +1345,8 @@ static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype)
                        self->NodeUpdateGS(0.f);
                        break;
                case MATHUTILS_VEC_CB_SCALE_GLOBAL:
-                       break;
+                       PyErr_SetString(PyExc_AttributeError, "KX_GameObject.worldScale is read-only");
+                       return 0;
                case MATHUTILS_VEC_CB_INERTIA_LOCAL:
                        /* read only */
                        break;
@@ -1388,9 +1387,7 @@ static int mathutils_kxgameob_vector_set_index(BaseMathObject *bmo, int subtype,
                return 0;
        
        bmo->data[index]= f;
-       mathutils_kxgameob_vector_set(bmo, subtype);
-       
-       return 1;
+       return mathutils_kxgameob_vector_set(bmo, subtype);
 }
 
 Mathutils_Callback mathutils_kxgameob_vector_cb = {