Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-04-11 06:50:02 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-04-11 06:50:02 +0400
commitae9233a5b05ebfc925fd542afbdb3bb9220ed65c (patch)
tree46ed278ee54325ca98540163edf9ea5dd4a88c7f /source/gameengine/Ketsji/KX_TouchSensor.cpp
parentd3e88eae711e2fd5d678ed555268647e28a9fc18 (diff)
1. Check material names passed to the physics engine (for collision sensors.)
Consider: gameobj->getClientInfo()->m_auxilary_info = (matname ? (void*)(matname+2) : NULL); It works if matname is "MAblah", but not if matname is "". 2. Added constructor for struct RAS_CameraData. 3. Added initializers to the struct KX_ClientObjectInfo constructor 4. Collision sensors won't detect near sensors. 5. A stack of minor tweaks, adjusting whitespace, using ++it for stl stuff.
Diffstat (limited to 'source/gameengine/Ketsji/KX_TouchSensor.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_TouchSensor.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp
index 6ae670a842c..29d9109c272 100644
--- a/source/gameengine/Ketsji/KX_TouchSensor.cpp
+++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp
@@ -119,6 +119,19 @@ KX_TouchSensor::~KX_TouchSensor()
m_colliders->Release();
}
+CValue* KX_TouchSensor::GetReplica()
+{
+ KX_TouchSensor* replica = new KX_TouchSensor(*this);
+ replica->m_colliders = new CListValue();
+ replica->m_bCollision = false;
+ replica->m_bTriggered= false;
+ replica->m_hitObject = NULL;
+ replica->m_bLastTriggered = false;
+ // this will copy properties and so on...
+ CValue::AddDataToReplica(replica);
+ return replica;
+}
+
void KX_TouchSensor::ReParent(SCA_IObject* parent)
{
KX_GameObject *gameobj = static_cast<KX_GameObject *>(parent);
@@ -159,7 +172,7 @@ DT_Bool KX_TouchSensor::HandleCollision(void* obj1,void* obj2,const DT_CollDa
(KX_GameObject*)client_info->m_clientobject :
NULL);
- if (gameobj && (gameobj != parent))
+ if (gameobj && (gameobj != parent) && client_info->isActor())
{
if (!m_colliders->SearchValue(gameobj))
m_colliders->Add(gameobj->AddRef());
@@ -171,14 +184,8 @@ DT_Bool KX_TouchSensor::HandleCollision(void* obj1,void* obj2,const DT_CollDa
{
if (client_info->m_auxilary_info)
{
- found = (m_touchedpropname == ((char*)client_info->m_auxilary_info));
+ found = (m_touchedpropname == STR_String((char*)client_info->m_auxilary_info));
}
-
- if (found)
- {
- int i=0;
- }
-
} else
{
found = (gameobj->GetProperty(m_touchedpropname) != NULL);