-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPBGE: Refactor physics constraints initialization and python access.
Previously two issues were noticed in the sources, first the constraint were were not represented by an object and so the attribute were modified by the physics environment functions with as first argument the constraint id, e.g: SetConstraintParam/GetConstraintParam. Second, the vehicle constraint were created in the physics environment by the same function than regular constraitn even if they behave differntly. To fix these both issue the constraint are not represented by a new class named PHY_IConstraint inherited in CcdConstraint for bullet constraint, this class contains function to set and get paramater, get id and type without any dependencies to the physics environment. The physics environment is now returing an instance of PHY_IConstraint in CreateConstraint and a PHY_IVehicle in the new function CreateVehicle. This last function is called in python thanks to the new function: bge.constraint.createVehicle(chassisPhysicsId) The two constraint python proxy classes KX_ConstraintWrapper and KX_VehicleWrapper now take as constructor respectively PHY_IConstraint and PHY_IVehicle and so remove the dependency to PHY_IPhsicsEnvironment. To keep the compatitliby the vehicle wrapper define the attribute constraint_id and constrant_type (sorry sdfgeoff :)) to look as a property and be still useable with contraint.getVehicleConstraint. In the same time constraints.createConstraint return a KX_VehicleWrapper when the type specified is PHY_VEHICLE_CONSTRAINT. Note that the file in Physics/Common are now targeted in a separate cmake in the same directory isntead of in the cmake of Ketsji/
- Loading branch information
1 parent
676f604
commit 3341047
Showing
19 changed files
with
459 additions
and
367 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
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.