santosh.a Posted May 18, 2015 Share Posted May 18, 2015 Hi, I was trying to do a simple detection of collision objects right in front of my walking AI to make it move aside. I added a child WorldTrigger/PhysicalTrigger to the AI such that it covers AI's front side, which seems perfect for my purpose but they are doing callbacks on bounding box intrusion, not surfaces. Another approach was using engine.world.getCollisionObjects() but that was detecting terrain, sky object etc in the level (maybe its doing bounding box checks too?). If using engine.world.getIntersection() rays, I might need to do many checks (knee, torso and head, on both left and right side) for accurate reading. I prefer using a Trigger but is there a way to make them detect the presence of object surfaces rather than bounding box? Thanks. Link to comment
unclebob Posted May 19, 2015 Share Posted May 19, 2015 Hi Santosh, In your case PhysicalTrigger should do what you want to achieve as it's working with physical bodies and surfaces with collision flag enabled. WorldTrigger is working with bounding volumes only though you can set it to "touching mode" (https://developer.unigine.com/en/docs/1.0/scripting/library/worlds/class.worldtrigger#setTouch_int_void) Link to comment
santosh.a Posted May 22, 2015 Author Share Posted May 22, 2015 Thanks Andrey, I guess my use of PhysicalTrigger was incorrect. Meanwhile I implemented the collision check using 4 intersection rays, 2 horizontal rays from knee height and 2 rays upwards from where horizontals ended. You can consider this issue closed, thanks again. Link to comment
Recommended Posts