xtreampb Posted April 23, 2013 Share Posted April 23, 2013 ok i got the physics and shapes and collisionhook working on my windows. Now my issue is basically casting an entity object to one of my objects. here is what is called on collision void CollHook(Entity *entity0, Entity *entity1, float *position, float *normal, float speed) { if(Stone *mStone=reinterpret_cast<Stone*> (entity0)) mStone->Break();//line here crashes the program. if i comment out this, works no problem } here is the function that the coll hook object (mStone) calls void Stone::Break() { this->Full->Hide(); this->P1->Show(); this->P2->Show(); this->P3->Show(); this->P4->Show(); this->P5->Show(); } if i comment out all the stuff inside the break function no issues. thank you for your help ~Xtreampb~ Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
xtreampb Posted April 23, 2013 Author Share Posted April 23, 2013 so after some review of an older thread i was able to get things working. my solution is this replace if(Stone *mStone=reinterpret_cast<Stone*> (entity0)) with Stone *mStone=(Stone*)entity0->GetUserData(); add this->Full->SetUserData(this); in your setup routine when your object gets called. Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.