void ETHDestructionListener::SayGoodbye(b2Joint* joint) { ETHEntity *jointOwner = static_cast<ETHEntity*>(joint->GetUserData()); // Set joint pointer to NULL for safety jointOwner->AddRef(); ETHPhysicsEntityControllerPtr ownerController = boost::dynamic_pointer_cast<ETHPhysicsEntityController>(jointOwner->GetController()); assert(ownerController); ownerController->KillJoint(joint); jointOwner->Release(); }
ETHEntity *ETHScriptWrapper::SeekEntity(const int id) { if (WarnIfRunsInMainFunction(GS_L("SeekEntity"))) return 0; ETHEntity *pEntity = m_pScene->GetBucketManager().SeekEntity(id); if (pEntity) { // don't let it return temporary handles if (pEntity->IsTemporary()) { return 0; } else { pEntity->AddRef(); return pEntity; } } return 0; }