Optimized physics object spawn time and optimized shape usage when the shape is not scaled
This commit is contained in:
parent
d360e6fb46
commit
7709a83493
12 changed files with 204 additions and 71 deletions
|
|
@ -164,7 +164,7 @@ void AreaBullet::main_shape_changed() {
|
|||
btGhost->setCollisionShape(get_main_shape());
|
||||
}
|
||||
|
||||
void AreaBullet::reload_body() {
|
||||
void AreaBullet::do_reload_body() {
|
||||
if (space) {
|
||||
space->remove_area(this);
|
||||
space->add_area(this);
|
||||
|
|
@ -177,13 +177,15 @@ void AreaBullet::set_space(SpaceBullet *p_space) {
|
|||
isScratched = false;
|
||||
|
||||
// Remove this object form the physics world
|
||||
space->unregister_collision_object(this);
|
||||
space->remove_area(this);
|
||||
}
|
||||
|
||||
space = p_space;
|
||||
|
||||
if (space) {
|
||||
space->add_area(this);
|
||||
space->register_collision_object(this);
|
||||
reload_body();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue