Hey I saw this in the manual:
GameActor* actor = GameCreateActor();
b2BodyDef bodyDef;
bodyDef.userData = actor;
actor->body = box2Dworld->CreateDynamicBody(&bodyDef);
Is this possible in AS3 in any way? I know pointers are necissarily supported...I was wondering because I would like to have a function in my "actor" class
that when called will destroy its related body from the world...how can I do this?
Inside of my class initialization here is basically what I did:
initialize(){
//code...
bodyDef.userData = this;
world.createBody(bodyDef);
//code...
}
and I have :
destroy(){
//code...
//need to destroy the body here, how?
//code...
Hopefully that made sense.
Thanks!
GameActor* actor = GameCreateActor();
b2BodyDef bodyDef;
bodyDef.userData = actor;
actor->body = box2Dworld->CreateDynamicBody(&bodyDef);
Is this possible in AS3 in any way? I know pointers are necissarily supported...I was wondering because I would like to have a function in my "actor" class
that when called will destroy its related body from the world...how can I do this?
Inside of my class initialization here is basically what I did:
initialize(){
//code...
bodyDef.userData = this;
world.createBody(bodyDef);
//code...
}
and I have :
destroy(){
//code...
//need to destroy the body here, how?
//code...
Hopefully that made sense.
Thanks!