pramod.s Posted August 10, 2012 Share Posted August 10, 2012 Hi, I have added PhysicalTrigger to editor through script using below step trigger = add_editor( new PhysicalTrigger( Shape_BOX, myposition ) ); trigger.setEnterCallback("enterCallBack"); trigger.setLeaveCallback("leaveCallBack"); When I run the application, I am able to view the trigger & access it in Enter & Leave event. Now I want to know is there a possibility to remove this PhysicalTrigger using the script. I tried to search in documentation, but unable to find it. Can anyone point the same. Thanks Link to comment
ulf.schroeter Posted August 10, 2012 Share Posted August 10, 2012 trigger.setEnterCallback(0); trigger.setLeaveCallback(0); Link to comment
pramod.s Posted August 10, 2012 Author Share Posted August 10, 2012 thanks for solution Link to comment
pramod.s Posted September 7, 2012 Author Share Posted September 7, 2012 Hello, The trigger.setEnterCallback(0); works if I have only one trigger, but when I have more trigger it is not working. Below is the scenario where I have issue. int size = 0; for(int x = 0; x <= size; x++) { ObjectMesh mesh = add_editor(new ObjectMesh("TestWork/assest/worlds/meshes/sphere_00.mesh")); mesh.setWorldTransform(translate(Vec3(x, 0, 0.25f))); } For each mesh Object I place an Physical Trigger using my custom object "trigger" over it's location & set respective callback (Enter & Leave) trigger.setEnterCallback("enter_callback", x); Now I am set triggerEnterCallback(0, x) in enter_callback() function after all my operation are done in this function But the trigger is till existing, how can I remove the trigger in above mentioned problem. Thanks Link to comment
manguste Posted September 11, 2012 Share Posted September 11, 2012 delete trigger; // for triggers created in script Link to comment
Recommended Posts