Remove collider when noclip
This commit is contained in:
parent
1a6678537f
commit
37f46a2b94
@ -47,6 +47,11 @@ static void defaultKeyCallback(GLFWwindow *window, int key, int scancode, int ac
|
||||
if(key == Input::getKeyBinding(keyToggleNoclip).key && action == GLFW_PRESS) {
|
||||
kekData.player->noclip = !kekData.player->noclip;
|
||||
kekData.player->controller = kekData.player->noclip ? (PlayerController *) noclipController : (PlayerController *) defaultController;
|
||||
if(kekData.player->noclip) {
|
||||
kekData.physics->world->removeRigidBody(kekData.player->physics->body);
|
||||
}else {
|
||||
kekData.physics->world->addRigidBody(kekData.player->physics->body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user