-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPBGE: Fix removed constraints when suspending physics.
Previously when we was suspending physics of an object using constraints, they were removed. This behaviour could be needed in some rare case but for the most case where the user just want to optimize physics computation the engine should keep the constraints. To do so the constraints have to be removed from the dynamic world but not removed from the controller or deleted in RemoveCcdPhysicsController. In the same time AddCcdPhysicsController iterate over all the constraint in the activated controller and add they in the dynamic world. Unfortunately there's some limitation, first we could not do redundant operation in removing and adding of the constraint in the world, second we have to keep the disable collision between bodies flag used when adding a constraint into world. To solve both of these issues the user pointer of the constraint are used to store a new type: CcdConstraint (in CcdPhysicsController). This new type only store the disable collision flag and a boolean named m_active set to true when the constraint is added in world else to false when removed. Two functions are added to clean the code: RemoveConstraint and RestoreConstraint. On python API side the user could specify to remove or not the constraints when calling KX_GameObject.suspendPhysics(freeConstraints=False).
- Loading branch information
1 parent
114230c
commit 00836b4
Showing
14 changed files
with
146 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.