diff options
author | Kent Mein <mein@cs.umn.edu> | 2007-02-20 00:46:57 +0300 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2007-02-20 00:46:57 +0300 |
commit | 6c17f1187e79eed2552ac06c91d51b24ee34f738 (patch) | |
tree | 44339abee54b92e26aeebf279cfb90c5185746dd /source/gameengine | |
parent | 316df82cb421811a28c09d332b0ea8327a2db6b9 (diff) |
Patch provided by Carsten,
KX_RaySensor::Evaluate returns false when hit was detected and it was
already marked as hit. (no change in state)
Kent
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_RaySensor.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index b7e672213ef..ef3ec3e0be3 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -237,9 +237,9 @@ bool KX_RaySensor::Evaluate(CValue* event) result = KX_RayCast::RayTest(spc, physics_environment, frompoint, topoint, resultpoint, resultnormal, KX_RayCast::Callback<KX_RaySensor>(this)); - /* now pass this result to some controller */ - if (m_rayHit) + + if (m_rayHit) { if (!m_bTriggered) { @@ -248,19 +248,23 @@ bool KX_RaySensor::Evaluate(CValue* event) m_bTriggered = true; } else - { - - } + { + // notify logicsystem that ray is STILL hitting ... + result = false; + + } } - else - { + else + { if (m_bTriggered) { m_bTriggered = false; - // notify logicsystem that ray is not hitting anymore + // notify logicsystem that ray JUST left the Object result = true; } - } + + } + return result; } |