File tree 3 files changed +7
-1
lines changed
3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ class Bomb : public PhysicsObject
13
13
14
14
virtual void setProperty (sp::string name, sp::string value) override ;
15
15
16
+ virtual bool isTriggerSource () override { return false ; }
16
17
private:
17
18
double velocity_average = 0.0 ;
18
19
enum class State
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ class PhysicsObject : public LevelObject
13
13
virtual void setProperty (sp::string name, sp::string value) override ;
14
14
15
15
bool isGoal () { return is_goal; }
16
+
17
+ virtual bool isTriggerSource () { return true ; }
16
18
private:
17
19
bool is_goal = false ;
18
20
};
Original file line number Diff line number Diff line change @@ -28,8 +28,11 @@ void Trigger::onFixedUpdate()
28
28
else if (source == " OBJECT" )
29
29
{
30
30
for (auto obj : getParent ()->getChildren ())
31
- if (sp::P<PhysicsObject>(sp::P<sp::Node>(obj)))
31
+ {
32
+ sp::P<PhysicsObject> po = sp::P<sp::Node>(obj);
33
+ if (po && po->isTriggerSource ())
32
34
source_objects.add (obj);
35
+ }
33
36
}
34
37
else
35
38
{
You can’t perform that action at this time.
0 commit comments