Correct way to remove SIO2sensor?

View previous topic View next topic Go down

Correct way to remove SIO2sensor?

Post  yarri on Tue Apr 28, 2009 4:29 pm

Hi, I've set up a distance sensor with sio2SensorInitDistance() and "rendering" it using the SIO2_EVALUATE_SENSOR flag in my sio2ResourceRender() call. I trigger the sensor but having trouble removing or disabling the sensor. A immediate call to sio2SensorFree() in the sensor callback function isn't thread safe it seems, do I have to set up a queue to remove sensors?

Thanks,
--yarri

yarri

Posts : 81
Join date : 2009-04-10

View user profile

Back to top Go down

Re: Correct way to remove SIO2sensor?

Post  sio2interactive on Tue Apr 28, 2009 4:35 pm

Simply use a tag and remove it after calling sio2PhysicRender

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Correct way to remove SIO2sensor?

Post  LuisLee on Mon Sep 28, 2009 1:44 am

sio2interactive wrote:Simply use a tag and remove it after calling sio2PhysicRender

I tried it many times,but I didn't remove it safe?

I do not Understand what you mean,beacuse my poor english.

Could you said that specific point? thank you very much.
Very Happy

LuisLee

Posts : 85
Join date : 2009-04-26
Age : 30

View user profile

Back to top Go down

Re: Correct way to remove SIO2sensor?

Post  yarri on Mon Sep 28, 2009 9:15 pm

Hi, it means either set a list of all sensors to be removed (or "tag" them by setting the userData pointer and iterate over all sensors to remove the "tagged" ones) and remove them in the physics thread. Works great.

--yarri

yarri

Posts : 81
Join date : 2009-04-10

View user profile

Back to top Go down

Re: Correct way to remove SIO2sensor?

Post  LuisLee on Mon Sep 28, 2009 9:31 pm

yarri wrote:Hi, it means either set a list of all sensors to be removed (or "tag" them by setting the userData pointer and iterate over all sensors to remove the "tagged" ones) and remove them in the physics thread. Works great.

--yarri


OK!thank you very much! I got it!

LuisLee

Posts : 85
Join date : 2009-04-26
Age : 30

View user profile

Back to top Go down

Re: Correct way to remove SIO2sensor?

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum