FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Sensor again

2 posters

Go down

Sensor again Empty Sensor again

Post  LuisLee 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.

Sensor again Pictur15

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

Very Happy

LuisLee

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

Back to top Go down

Sensor again Empty Re: Sensor again

Post  sio2interactive 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.
sio2interactive
sio2interactive

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

http://sio2interactive.com

Back to top Go down

Sensor again Empty Re: Sensor again

Post  LuisLee 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 : 36

Back to top Go down

Sensor again Empty Re: Sensor again

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


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