Sensor again
2 posters
Sensor again
Hi,I want to remove the Sensor,beause I want this to be executed once,I use this methods:
-> [ if( _SIO2sensor->_SIO2sensorcollision )] ///breakpoint
the _SIO2sensor is not NULL.
why? please help me,thank you very much,how to del. sensor?
- 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);
}
-> [ if( _SIO2sensor->_SIO2sensorcollision )] ///breakpoint
the _SIO2sensor is not NULL.
why? please help me,thank you very much,how to del. sensor?
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: Sensor again
Don't delete sensor inside their callback function... just mark them and remove them inside your rendering loop.
Re: Sensor again
thank you!Is my own wrong,thank you again!
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Permissions in this forum:
You cannot reply to topics in this forum