Sensor again

View previous topic View next topic Go down

Sensor again

Post  LuisLee on Thu Oct 15, 2009 1:33 am

Hi,I want to remove the Sensor,beause I want this to be executed once,I use this methods:

Code:

mySIO2sensorcollision(void *_ptr)
{
    SIO2sensor *_SIO2sensor = ( SIO2sensor * )sio2ResourceGet( sio2->_SIO2resource,
                                    SIO2_SENSOR,
                                    "colide" );
  _SIO2sensor = sio2SensorFree( _SIO2sensor );
}
init()
{
    SIO2object *player = sio2ResourceGetObject( sio2->_SIO2resource, "object/player" );
    SIO2object *target = sio2ResourceGetObject( sio2->_SIO2resource, "object/target" );
    sio2SensorInitCollision("colide", player, target, mySIO2sensorcollision);
}

but breakpoint at sio2PhysicCollisionCallback() funtion;
-> [ if( _SIO2sensor->_SIO2sensorcollision )] ///breakpoint

the _SIO2sensor is not NULL.



why? please help me,thank you very much,how to del. sensor?

Very Happy

LuisLee

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

View user profile

Back to top Go down

Re: Sensor again

Post  sio2interactive on Thu Oct 15, 2009 1:37 am

Don't delete sensor inside their callback function... just mark them and remove them inside your rendering loop.

_________________
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: Sensor again

Post  LuisLee on Thu Oct 15, 2009 1:47 am

thank you!Is my own wrong,thank you again!

LuisLee

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

View user profile

Back to top Go down

Re: Sensor again

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