Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/Ketsji/KX_CollisionSensor.cpp
- This file was moved from source/gameengine/Ketsji/KX_TouchSensor.cpp.
| Context not available. | |||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file gameengine/Ketsji/KX_TouchSensor.cpp | /** \file gameengine/Ketsji/KX_CollisionSensor.cpp | ||||
| * \ingroup ketsji | * \ingroup ketsji | ||||
| */ | */ | ||||
| #include "KX_TouchSensor.h" | #include "KX_CollisionSensor.h" | ||||
| #include "SCA_EventManager.h" | #include "SCA_EventManager.h" | ||||
| #include "SCA_LogicManager.h" | #include "SCA_LogicManager.h" | ||||
| #include "KX_GameObject.h" | #include "KX_GameObject.h" | ||||
| #include "KX_TouchEventManager.h" | #include "KX_CollisionEventManager.h" | ||||
| #include "PHY_IPhysicsController.h" | #include "PHY_IPhysicsController.h" | ||||
| #include "RAS_MeshObject.h" | #include "RAS_MeshObject.h" | ||||
| #include <iostream> | #include <iostream> | ||||
| #include "BLI_utildefines.h" | |||||
| #include "PHY_IPhysicsEnvironment.h" | #include "PHY_IPhysicsEnvironment.h" | ||||
| /* ------------------------------------------------------------------------- */ | /* ------------------------------------------------------------------------- */ | ||||
| /* Native functions */ | /* Native functions */ | ||||
| /* ------------------------------------------------------------------------- */ | /* ------------------------------------------------------------------------- */ | ||||
| void KX_TouchSensor::SynchronizeTransform() | void KX_CollisionSensor::SynchronizeTransform() | ||||
| { | { | ||||
| // the touch sensor does not require any synchronization: it uses | // the touch sensor does not require any synchronization: it uses | ||||
| // the same physical object which is already synchronized by Blender | // the same physical object which is already synchronized by Blender | ||||
| } | } | ||||
| void KX_CollisionSensor::EndFrame() | |||||
| void KX_TouchSensor::EndFrame() | |||||
| { | { | ||||
| m_colliders->ReleaseAndRemoveAll(); | m_colliders->ReleaseAndRemoveAll(); | ||||
| m_hitObject = NULL; | m_hitObject = NULL; | ||||
| Context not available. | |||||
| m_bColliderHash = 0; | m_bColliderHash = 0; | ||||
| } | } | ||||
| void KX_TouchSensor::UnregisterToManager() | void KX_CollisionSensor::UnregisterToManager() | ||||
| { | { | ||||
| // before unregistering the sensor, make sure we release all references | // before unregistering the sensor, make sure we release all references | ||||
| EndFrame(); | EndFrame(); | ||||
| SCA_ISensor::UnregisterToManager(); | SCA_ISensor::UnregisterToManager(); | ||||
| } | } | ||||
| bool KX_TouchSensor::Evaluate() | bool KX_CollisionSensor::Evaluate() | ||||
| { | { | ||||
| bool result = false; | bool result = false; | ||||
| bool reset = m_reset && m_level; | bool reset = m_reset && m_level; | ||||
| m_reset = false; | m_reset = false; | ||||
| if (m_bTriggered != m_bLastTriggered) | if (m_bTriggered != m_bLastTriggered) { | ||||
| { | |||||
| m_bLastTriggered = m_bTriggered; | m_bLastTriggered = m_bTriggered; | ||||
| if (!m_bTriggered) | if (!m_bTriggered) { | ||||
| m_hitObject = NULL; | m_hitObject = NULL; | ||||
| } | |||||
| result = true; | result = true; | ||||
| } | } | ||||
| if (reset) | if (reset) { | ||||
| // force an event | // force an event | ||||
| result = true; | result = true; | ||||
| } | |||||
| if (m_bTouchPulse) { /* pulse on changes to the colliders */ | |||||
| if (m_bCollisionPulse) { // pulse on changes to the colliders | |||||
| int count = m_colliders->GetCount(); | int count = m_colliders->GetCount(); | ||||
| if (m_bLastCount!=count || m_bColliderHash!=m_bLastColliderHash) { | if (m_bLastCount != count || m_bColliderHash != m_bLastColliderHash) { | ||||
| m_bLastCount = count; | m_bLastCount = count; | ||||
| m_bLastColliderHash= m_bColliderHash; | m_bLastColliderHash = m_bColliderHash; | ||||
| result = true; | result = true; | ||||
| } | } | ||||
| } | } | ||||
| return result; | return result; | ||||
| } | } | ||||
| KX_TouchSensor::KX_TouchSensor(SCA_EventManager* eventmgr,KX_GameObject* gameobj,bool bFindMaterial,bool bTouchPulse,const STR_String& touchedpropname) | KX_CollisionSensor::KX_CollisionSensor(SCA_EventManager *eventmgr, KX_GameObject *gameobj, bool bFindMaterial, bool bCollisionPulse, const std::string& touchedpropname) | ||||
| :SCA_ISensor(gameobj,eventmgr), | :SCA_ISensor(gameobj, eventmgr), | ||||
| m_touchedpropname(touchedpropname), | m_touchedpropname(touchedpropname), | ||||
| m_bFindMaterial(bFindMaterial), | m_bFindMaterial(bFindMaterial), | ||||
| m_bTouchPulse(bTouchPulse), | m_bCollisionPulse(bCollisionPulse), | ||||
| m_hitMaterial("") | m_hitMaterial("") | ||||
| /*m_sumoObj(sumoObj),*/ | |||||
| { | { | ||||
| // KX_TouchEventManager* touchmgr = (KX_TouchEventManager*) eventmgr; | |||||
| // m_resptable = touchmgr->GetResponseTable(); | |||||
| // m_solidHandle = m_sumoObj->getObjectHandle(); | |||||
| m_colliders = new CListValue(); | m_colliders = new CListValue(); | ||||
| KX_ClientObjectInfo *client_info = gameobj->getClientInfo(); | KX_ClientObjectInfo *client_info = gameobj->getClientInfo(); | ||||
| //client_info->m_gameobject = gameobj; | |||||
| //client_info->m_auxilary_info = NULL; | |||||
| client_info->m_sensors.push_back(this); | client_info->m_sensors.push_back(this); | ||||
| m_physCtrl = gameobj->GetPhysicsController(); | m_physCtrl = gameobj->GetPhysicsController(); | ||||
| MT_assert( !gameobj->GetPhysicsController() || m_physCtrl ); | BLI_assert(!gameobj->GetPhysicsController() || m_physCtrl); | ||||
| Init(); | Init(); | ||||
| } | } | ||||
| void KX_TouchSensor::Init() | void KX_CollisionSensor::Init() | ||||
| { | { | ||||
| m_bCollision = false; | m_bCollision = false; | ||||
| m_bTriggered = false; | m_bTriggered = false; | ||||
| m_bLastTriggered = (m_invert)?true:false; | m_bLastTriggered = (m_invert) ? true : false; | ||||
| m_bLastCount = 0; | m_bLastCount = 0; | ||||
| m_bColliderHash = m_bLastColliderHash = 0; | m_bColliderHash = m_bLastColliderHash = 0; | ||||
| m_hitObject = NULL; | m_hitObject = NULL; | ||||
| m_reset = true; | m_reset = true; | ||||
| } | } | ||||
| KX_TouchSensor::~KX_TouchSensor() | KX_CollisionSensor::~KX_CollisionSensor() | ||||
| { | { | ||||
| //DT_ClearObjectResponse(m_resptable,m_solidHandle); | |||||
| m_colliders->Release(); | m_colliders->Release(); | ||||
| } | } | ||||
| CValue* KX_TouchSensor::GetReplica() | CValue *KX_CollisionSensor::GetReplica() | ||||
| { | { | ||||
| KX_TouchSensor* replica = new KX_TouchSensor(*this); | KX_CollisionSensor *replica = new KX_CollisionSensor(*this); | ||||
| replica->ProcessReplica(); | replica->ProcessReplica(); | ||||
| return replica; | return replica; | ||||
| } | } | ||||
| void KX_TouchSensor::ProcessReplica() | void KX_CollisionSensor::ProcessReplica() | ||||
| { | { | ||||
| SCA_ISensor::ProcessReplica(); | SCA_ISensor::ProcessReplica(); | ||||
| m_colliders = new CListValue(); | m_colliders = new CListValue(); | ||||
| Init(); | Init(); | ||||
| } | } | ||||
| void KX_TouchSensor::ReParent(SCA_IObject* parent) | void KX_CollisionSensor::ReParent(SCA_IObject *parent) | ||||
| { | { | ||||
| KX_GameObject *gameobj = static_cast<KX_GameObject *>(parent); | KX_GameObject *gameobj = static_cast<KX_GameObject *>(parent); | ||||
| PHY_IPhysicsController *sphy = ((KX_GameObject*)parent)->GetPhysicsController(); | PHY_IPhysicsController *sphy = ((KX_GameObject *)parent)->GetPhysicsController(); | ||||
| if (sphy) | if (sphy) { | ||||
| m_physCtrl = sphy; | m_physCtrl = sphy; | ||||
| } | |||||
| // m_solidHandle = m_sumoObj->getObjectHandle(); | |||||
| KX_ClientObjectInfo *client_info = gameobj->getClientInfo(); | KX_ClientObjectInfo *client_info = gameobj->getClientInfo(); | ||||
| //client_info->m_gameobject = gameobj; | |||||
| //client_info->m_auxilary_info = NULL; | |||||
| client_info->m_sensors.push_back(this); | client_info->m_sensors.push_back(this); | ||||
| SCA_ISensor::ReParent(parent); | SCA_ISensor::ReParent(parent); | ||||
| } | } | ||||
| void KX_TouchSensor::RegisterSumo(KX_TouchEventManager *touchman) | void KX_CollisionSensor::RegisterSumo(KX_CollisionEventManager *collisionman) | ||||
| { | { | ||||
| if (m_physCtrl) | if (m_physCtrl) { | ||||
| { | if (collisionman->GetPhysicsEnvironment()->RequestCollisionCallback(m_physCtrl)) { | ||||
| if (touchman->GetPhysicsEnvironment()->RequestCollisionCallback(m_physCtrl)) | KX_ClientObjectInfo *client_info = static_cast<KX_ClientObjectInfo *>(m_physCtrl->GetNewClientInfo()); | ||||
| { | if (client_info->isSensor()) { | ||||
| KX_ClientObjectInfo *client_info = static_cast<KX_ClientObjectInfo*>(m_physCtrl->GetNewClientInfo()); | collisionman->GetPhysicsEnvironment()->AddSensor(m_physCtrl); | ||||
| if (client_info->isSensor()) | } | ||||
| touchman->GetPhysicsEnvironment()->AddSensor(m_physCtrl); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void KX_TouchSensor::UnregisterSumo(KX_TouchEventManager* touchman) | void KX_CollisionSensor::UnregisterSumo(KX_CollisionEventManager *collisionman) | ||||
| { | { | ||||
| if (m_physCtrl) | if (m_physCtrl) { | ||||
| { | if (collisionman->GetPhysicsEnvironment()->RemoveCollisionCallback(m_physCtrl)) { | ||||
| if (touchman->GetPhysicsEnvironment()->RemoveCollisionCallback(m_physCtrl)) | |||||
| { | |||||
| // no more sensor on the controller, can remove it if it is a sensor object | // no more sensor on the controller, can remove it if it is a sensor object | ||||
| KX_ClientObjectInfo *client_info = static_cast<KX_ClientObjectInfo*>(m_physCtrl->GetNewClientInfo()); | KX_ClientObjectInfo *client_info = static_cast<KX_ClientObjectInfo *>(m_physCtrl->GetNewClientInfo()); | ||||
| if (client_info->isSensor()) | if (client_info->isSensor()) { | ||||
| touchman->GetPhysicsEnvironment()->RemoveSensor(m_physCtrl); | collisionman->GetPhysicsEnvironment()->RemoveSensor(m_physCtrl); | ||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| // this function is called only for sensor objects | // this function is called only for sensor objects | ||||
| // return true if the controller can collide with the object | // return true if the controller can collide with the object | ||||
| bool KX_TouchSensor::BroadPhaseSensorFilterCollision(void*obj1,void*obj2) | bool KX_CollisionSensor::BroadPhaseSensorFilterCollision(void *obj1, void *obj2) | ||||
| { | { | ||||
| assert(obj1==m_physCtrl && obj2); | BLI_assert(obj1 == m_physCtrl && obj2); | ||||
| KX_GameObject* myobj = (KX_GameObject*)GetParent(); | KX_GameObject *myobj = (KX_GameObject *)GetParent(); | ||||
| KX_GameObject* myparent = myobj->GetParent(); | KX_GameObject *myparent = myobj->GetParent(); | ||||
| KX_ClientObjectInfo *client_info = static_cast<KX_ClientObjectInfo*>(((PHY_IPhysicsController*)obj2)->GetNewClientInfo()); | KX_ClientObjectInfo *client_info = static_cast<KX_ClientObjectInfo *>(((PHY_IPhysicsController *)obj2)->GetNewClientInfo()); | ||||
| KX_ClientObjectInfo *my_client_info = static_cast<KX_ClientObjectInfo*>(m_physCtrl->GetNewClientInfo()); | KX_ClientObjectInfo *my_client_info = static_cast<KX_ClientObjectInfo *>(m_physCtrl->GetNewClientInfo()); | ||||
| KX_GameObject* otherobj = ( client_info ? client_info->m_gameobject : NULL); | KX_GameObject *otherobj = (client_info ? client_info->m_gameobject : NULL); | ||||
| // we can only check on persistent characteristic: m_link and m_suspended are not | // we can only check on persistent characteristic: m_link and m_suspended are not | ||||
| // good candidate because they are transient. That must be handled at another level | // good candidate because they are transient. That must be handled at another level | ||||
| if (!otherobj || | if (!otherobj || | ||||
| otherobj == myparent || // don't interact with our parent | otherobj == myparent || // don't interact with our parent | ||||
| (my_client_info->m_type == KX_ClientObjectInfo::OBACTORSENSOR && | (my_client_info->m_type == KX_ClientObjectInfo::OBACTORSENSOR && | ||||
| client_info->m_type != KX_ClientObjectInfo::ACTOR)) // only with actor objects | client_info->m_type != KX_ClientObjectInfo::ACTOR)) // only with actor objects | ||||
| return false; | |||||
| bool found = m_touchedpropname.IsEmpty(); | |||||
| if (!found) | |||||
| { | { | ||||
| return false; | |||||
| } | |||||
| bool found = m_touchedpropname.empty(); | |||||
| if (!found) { | |||||
| if (m_bFindMaterial) { | if (m_bFindMaterial) { | ||||
| for (unsigned int i = 0; i < otherobj->GetMeshCount(); ++i) { | for (unsigned int i = 0; i < otherobj->GetMeshCount(); ++i) { | ||||
| RAS_MeshObject *meshObj = otherobj->GetMesh(i); | RAS_MeshObject *meshObj = otherobj->GetMesh(i); | ||||
| for (unsigned int j = 0; j < meshObj->NumMaterials(); ++j) { | for (unsigned int j = 0; j < meshObj->NumMaterials(); ++j) { | ||||
| found = strcmp(m_touchedpropname.ReadPtr(), meshObj->GetMaterialName(j).ReadPtr() + 2) == 0; | found = (m_touchedpropname == std::string(meshObj->GetMaterialName(j), 2)); | ||||
| if (found) | if (found) { | ||||
| break; | break; | ||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| return found; | return found; | ||||
| } | } | ||||
| bool KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_CollData* colldata) | bool KX_CollisionSensor::NewHandleCollision(void *object1, void *object2, const PHY_CollData *colldata) | ||||
| { | { | ||||
| // KX_TouchEventManager* toucheventmgr = (KX_TouchEventManager*)m_eventmgr; | KX_GameObject *parent = (KX_GameObject *)GetParent(); | ||||
| KX_GameObject* parent = (KX_GameObject*)GetParent(); | |||||
| // need the mapping from PHY_IPhysicsController to gameobjects now | // need the mapping from PHY_IPhysicsController to gameobjects now | ||||
| KX_ClientObjectInfo *client_info = static_cast<KX_ClientObjectInfo*> (object1 == m_physCtrl? | KX_ClientObjectInfo *client_info = static_cast<KX_ClientObjectInfo *> (object1 == m_physCtrl ? | ||||
| ((PHY_IPhysicsController*)object2)->GetNewClientInfo(): | ((PHY_IPhysicsController *)object2)->GetNewClientInfo() : | ||||
| ((PHY_IPhysicsController*)object1)->GetNewClientInfo()); | ((PHY_IPhysicsController *)object1)->GetNewClientInfo()); | ||||
| KX_GameObject* gameobj = ( client_info ? | KX_GameObject *gameobj = (client_info ? | ||||
| client_info->m_gameobject : | client_info->m_gameobject : | ||||
| NULL); | NULL); | ||||
| // add the same check as in SCA_ISensor::Activate(), | // add the same check as in SCA_ISensor::Activate(), | ||||
| // we don't want to record collision when the sensor is not active. | // we don't want to record collision when the sensor is not active. | ||||
| if (m_links && !m_suspended && | if (m_links && !m_suspended && | ||||
| gameobj && (gameobj != parent) && client_info->isActor()) | gameobj && (gameobj != parent) && client_info->isActor()) | ||||
| { | { | ||||
| bool found = m_touchedpropname.IsEmpty(); | bool found = m_touchedpropname.empty(); | ||||
| bool hitMaterial = false; | bool hitMaterial = false; | ||||
| if (!found) | if (!found) { | ||||
| { | |||||
| if (m_bFindMaterial) { | if (m_bFindMaterial) { | ||||
| for (unsigned int i = 0; i < gameobj->GetMeshCount(); ++i) { | for (unsigned int i = 0; i < gameobj->GetMeshCount(); ++i) { | ||||
| RAS_MeshObject *meshObj = gameobj->GetMesh(i); | RAS_MeshObject *meshObj = gameobj->GetMesh(i); | ||||
| for (unsigned int j = 0; j < meshObj->NumMaterials(); ++j) { | for (unsigned int j = 0; j < meshObj->NumMaterials(); ++j) { | ||||
| found = strcmp(m_touchedpropname.ReadPtr(), meshObj->GetMaterialName(j).ReadPtr() + 2) == 0; | found = (m_touchedpropname == std::string(meshObj->GetMaterialName(j), 2)); | ||||
| if (found) { | if (found) { | ||||
| hitMaterial = true; | hitMaterial = true; | ||||
| break; | break; | ||||
| Context not available. | |||||
| found = (gameobj->GetProperty(m_touchedpropname) != NULL); | found = (gameobj->GetProperty(m_touchedpropname) != NULL); | ||||
| } | } | ||||
| } | } | ||||
| if (found) | if (found) { | ||||
| { | |||||
| if (!m_colliders->SearchValue(gameobj)) { | if (!m_colliders->SearchValue(gameobj)) { | ||||
| m_colliders->Add(gameobj->AddRef()); | m_colliders->Add(gameobj->AddRef()); | ||||
| if (m_bTouchPulse) | if (m_bCollisionPulse) { | ||||
| m_bColliderHash += (uint_ptr)(static_cast<void *>(&gameobj)); | m_bColliderHash += (uint_ptr)(static_cast<void *>(&gameobj)); | ||||
| } | |||||
| } | } | ||||
| m_bTriggered = true; | m_bTriggered = true; | ||||
| m_hitObject = gameobj; | m_hitObject = gameobj; | ||||
| m_hitMaterial = hitMaterial; | m_hitMaterial = hitMaterial; | ||||
| //printf("KX_TouchSensor::HandleCollision\n"); | |||||
| } | } | ||||
| } | } | ||||
| return false; // was DT_CONTINUE but this was defined in sumo as false. | return false; | ||||
| } | } | ||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| Context not available. | |||||
| /* Python functions */ | /* Python functions */ | ||||
| /* ------------------------------------------------------------------------- */ | /* ------------------------------------------------------------------------- */ | ||||
| /* Integration hooks ------------------------------------------------------- */ | /* Integration hooks ------------------------------------------------------- */ | ||||
| PyTypeObject KX_TouchSensor::Type = { | PyTypeObject KX_CollisionSensor::Type = { | ||||
| PyVarObject_HEAD_INIT(NULL, 0) | PyVarObject_HEAD_INIT(NULL, 0) | ||||
| "KX_TouchSensor", | "KX_CollisionSensor", | ||||
| sizeof(PyObjectPlus_Proxy), | sizeof(PyObjectPlus_Proxy), | ||||
| 0, | 0, | ||||
| py_base_dealloc, | py_base_dealloc, | ||||
| Context not available. | |||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| py_base_repr, | py_base_repr, | ||||
| 0,0,0,0,0,0,0,0,0, | 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||||
| Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, | ||||
| 0,0,0,0,0,0,0, | 0, 0, 0, 0, 0, 0, 0, | ||||
| Methods, | Methods, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| &SCA_ISensor::Type, | &SCA_ISensor::Type, | ||||
| 0,0,0,0,0,0, | 0, 0, 0, 0, 0, 0, | ||||
| py_base_new | py_base_new | ||||
| }; | }; | ||||
| PyMethodDef KX_TouchSensor::Methods[] = { | PyMethodDef KX_CollisionSensor::Methods[] = { | ||||
| {NULL,NULL} //Sentinel | {NULL, NULL} //Sentinel | ||||
| }; | }; | ||||
| PyAttributeDef KX_TouchSensor::Attributes[] = { | PyAttributeDef KX_CollisionSensor::Attributes[] = { | ||||
| KX_PYATTRIBUTE_STRING_RW("propName",0,MAX_PROP_NAME,false,KX_TouchSensor,m_touchedpropname), | KX_PYATTRIBUTE_STRING_RW("propName", 0, MAX_PROP_NAME, false, KX_CollisionSensor, m_touchedpropname), | ||||
| KX_PYATTRIBUTE_BOOL_RW("useMaterial",KX_TouchSensor,m_bFindMaterial), | KX_PYATTRIBUTE_BOOL_RW("useMaterial", KX_CollisionSensor, m_bFindMaterial), | ||||
| KX_PYATTRIBUTE_BOOL_RW("usePulseCollision",KX_TouchSensor,m_bTouchPulse), | KX_PYATTRIBUTE_BOOL_RW("usePulseCollision", KX_CollisionSensor, m_bCollisionPulse), | ||||
| KX_PYATTRIBUTE_STRING_RO("hitMaterial", KX_TouchSensor, m_hitMaterial), | KX_PYATTRIBUTE_STRING_RO("hitMaterial", KX_CollisionSensor, m_hitMaterial), | ||||
| KX_PYATTRIBUTE_RO_FUNCTION("hitObject", KX_TouchSensor, pyattr_get_object_hit), | KX_PYATTRIBUTE_RO_FUNCTION("hitObject", KX_CollisionSensor, pyattr_get_object_hit), | ||||
| KX_PYATTRIBUTE_RO_FUNCTION("hitObjectList", KX_TouchSensor, pyattr_get_object_hit_list), | KX_PYATTRIBUTE_RO_FUNCTION("hitObjectList", KX_CollisionSensor, pyattr_get_object_hit_list), | ||||
| { NULL } //Sentinel | KX_PYATTRIBUTE_NULL //Sentinel | ||||
| }; | }; | ||||
| /* Python API */ | /* Python API */ | ||||
| PyObject *KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) | PyObject *KX_CollisionSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) | ||||
| { | { | ||||
| KX_TouchSensor* self = static_cast<KX_TouchSensor*>(self_v); | KX_CollisionSensor *self = static_cast<KX_CollisionSensor *>(self_v); | ||||
| if (self->m_hitObject) | if (self->m_hitObject) { | ||||
| return self->m_hitObject->GetProxy(); | return self->m_hitObject->GetProxy(); | ||||
| else | } | ||||
| else { | |||||
| Py_RETURN_NONE; | Py_RETURN_NONE; | ||||
| } | |||||
| } | } | ||||
| PyObject *KX_TouchSensor::pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) | PyObject *KX_CollisionSensor::pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) | ||||
| { | { | ||||
| KX_TouchSensor* self = static_cast<KX_TouchSensor*>(self_v); | KX_CollisionSensor *self = static_cast<KX_CollisionSensor *>(self_v); | ||||
| return self->m_colliders->GetProxy(); | return self->m_colliders->GetProxy(); | ||||
| } | } | ||||
| #endif | #endif | ||||
| /* eof */ | |||||
| Context not available. | |||||