diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-20 19:06:46 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-20 19:06:46 +0400 |
commit | 874c29cea8e6f9bc411fccf2d6f4cb07e94328d0 (patch) | |
tree | 5971e577cf7c02e05a1e37b5ad058c71a6744877 /source/gameengine/Ketsji/KX_NearSensor.cpp | |
parent | 7555bfa793a2b0fc187c6211c56986f35b2d7b09 (diff) | |
parent | c5bc4e4fb1a33eda8c31f2ea02e91f32f74c8fa5 (diff) |
2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
Diffstat (limited to 'source/gameengine/Ketsji/KX_NearSensor.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_NearSensor.cpp | 51 |
1 files changed, 21 insertions, 30 deletions
diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index 993a6b3d86c..0489b7090e9 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -127,13 +127,10 @@ CValue* KX_NearSensor::GetReplica() } } - //static_cast<KX_TouchEventManager*>(m_eventmgr)->RegisterSensor(this); - //todo: make sure replication works fine - //>m_sumoObj = new SM_Object(DT_NewSphere(0.0),NULL,NULL,NULL); - //replica->m_sumoObj->setMargin(m_Margin); - //replica->m_sumoObj->setClientObject(replica->m_client_info); - - ((KX_GameObject*)replica->GetParent())->GetSGNode()->ComputeWorldTransforms(NULL); + //Wrong: the parent object could be a child, this code works only if it is a root parent. + //Anyway, at this stage, the parent object is already synchronized, nothing to do. + //bool parentUpdated = false; + //((KX_GameObject*)replica->GetParent())->GetSGNode()->ComputeWorldTransforms(NULL, parentUpdated); replica->SynchronizeTransform(); return replica; @@ -154,8 +151,10 @@ void KX_NearSensor::ReParent(SCA_IObject* parent) client_info->m_sensors.push_back(this); SCA_ISensor::ReParent(parent); */ - ((KX_GameObject*)GetParent())->GetSGNode()->ComputeWorldTransforms(NULL); - SynchronizeTransform(); + //Not needed, was done in GetReplica() already + //bool parentUpdated = false; + //((KX_GameObject*)GetParent())->GetSGNode()->ComputeWorldTransforms(NULL,parentUpdated); + //SynchronizeTransform(); SCA_ISensor::ReParent(parent); } @@ -287,22 +286,22 @@ bool KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData /* ------------------------------------------------------------------------- */ PyTypeObject KX_NearSensor::Type = { - PyObject_HEAD_INIT(&PyType_Type) + PyObject_HEAD_INIT(NULL) 0, "KX_NearSensor", - sizeof(KX_NearSensor), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, - __getattr, - __setattr, - 0, //&MyPyCompare, - __repr, - 0, //&cvalue_as_number, 0, 0, 0, - 0 + py_base_repr, + 0,0,0,0,0,0, + py_base_getattro, + py_base_setattro, + 0,0,0,0,0,0,0,0,0, + Methods }; @@ -330,20 +329,12 @@ PyAttributeDef KX_NearSensor::Attributes[] = { }; -PyObject* KX_NearSensor::_getattr(const char *attr) +PyObject* KX_NearSensor::py_getattro(PyObject *attr) { - PyObject* object = _getattr_self(Attributes, this, attr); - if (object != NULL) - return object; - - _getattr_up(KX_TouchSensor); + py_getattro_up(KX_TouchSensor); } -int KX_NearSensor::_setattr(const char *attr, PyObject* value) +int KX_NearSensor::py_setattro(PyObject*attr, PyObject* value) { - int ret = _setattr_self(Attributes, this, attr, value); - if (ret >= 0) - return ret; - - return KX_TouchSensor::_setattr(attr, value); + py_setattro_up(KX_TouchSensor); } |