Problem with Trigger T3D 1.2
by Scott Meyers · in Technical Issues · 11/22/2011 (9:37 pm) · 2 replies
Looking at the code in Trigger.cpp
Trigger::testObject is the function used to test when a potential object is within a trigger volume. The interesting thing is that it calls buildPolyList on the entering object with the world box of the trigger and a sphere it calculates. But the Player class overrides the buildPolyList in ShapeBase with one that does not do anything with either of these variables. It seems to me that the trigger should never fire on the player object at all, which were the results I was seeing.
I know some people have seen triggers working so I wonder if it could be something on my player datablock? My solution was simply to check that the trigger world box and the object world box overlapped.
const Box3F box = enter->getWorldBox();
return box.isOverlapped(mWorldBox);
Has anyone else experienced this?
Trigger::testObject is the function used to test when a potential object is within a trigger volume. The interesting thing is that it calls buildPolyList on the entering object with the world box of the trigger and a sphere it calculates. But the Player class overrides the buildPolyList in ShapeBase with one that does not do anything with either of these variables. It seems to me that the trigger should never fire on the player object at all, which were the results I was seeing.
I know some people have seen triggers working so I wonder if it could be something on my player datablock? My solution was simply to check that the trigger world box and the object world box overlapped.
const Box3F box = enter->getWorldBox();
return box.isOverlapped(mWorldBox);
Has anyone else experienced this?
About the author
C++ Developer in the HFT industry for 8 years.
Recent Threads
#2
12/09/2011 (3:03 pm)
No I was simply stepping through the code to determine why my triggers were not firing when my player entered the trigger volume. All my callbacks and datablocks are in script. My project is an "empty project" from the torque dashboard with a stripped down player datablock and a simple trigger. When stepping through the code while my player was in the trigger volume, I noticed an instance of player was being considered by the trigger class as potentially firing the trigger but was being rejected. It appeared to me that this was due to player having an implementation of buildPolyList that seemed odd in that it ignored any passed in info. I'm wondering two things. Why does player implement buildPolyList the way it does, and is there something I might be missing on my player datablock (or the trigger for that matter) that will cause my triggers to work. My above fix is working for me at the moment but may cause some problems latter I have not foreseen.
Associate Scott Burns
GG Alumni