From a4ad52f1aaa1c8ed0d2f1345cbff99769f353ae9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 25 Feb 2009 17:19:30 +0000 Subject: New Pulse option for the collision sensor (off by default wont change existing logic) Previously only the first collision would trigger an event (no collisions a negative event ofcourse) With the Pulse option enabled, any change to the set of colliding objects will trigger an event. Added this because there was no way to count how many sheep were on a platform in YoFrankie without running a script periodically. Changes in collision are detected by comparing the number of objects colliding with the last event, as well as a hash made from the object pointers. Also changed the touch sensors internal list of colliding objects to only contain objects that match the property or material. - pulse isnt a great name, could change this. --- source/gameengine/Ketsji/KX_NearSensor.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source/gameengine/Ketsji/KX_NearSensor.cpp') diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index 5b1df8b1fe1..a4aebdd8b6b 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -52,6 +52,7 @@ KX_NearSensor::KX_NearSensor(SCA_EventManager* eventmgr, :KX_TouchSensor(eventmgr, gameobj, bFindMaterial, + false, touchedpropname, /* scene, */ T), -- cgit v1.2.3