diff options
author | Thomas Szepe <HG1_public@gmx.net> | 2015-10-11 19:28:43 +0300 |
---|---|---|
committer | Thomas Szepe <HG1_public@gmx.net> | 2015-10-11 19:28:43 +0300 |
commit | 3dd83b533a032fe4e5e39a275e7f2fcff2beaf15 (patch) | |
tree | 279d9ffbd0b8ab0a1c2d723621b119c229fff66b /source/gameengine/Physics | |
parent | 88005475db5a774edfc3c408b553b04379dbd147 (diff) |
BGE: Adding a Max Jumps value to the character physic window
Actually we only have a Python API that allows to change the max jumps value.
The patch also allows non programmers to change the maximum numbers of jumps.
Reviewers: panzergame, sybren, campbellbarton, lordloki, moguri, agoose77
Reviewed By: lordloki, moguri
Projects: #game_engine
Differential Revision: https://developer.blender.org/D1302
Diffstat (limited to 'source/gameengine/Physics')
4 files changed, 5 insertions, 1 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 6a1e52c9263..f11d7ac017f 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -533,6 +533,7 @@ bool CcdPhysicsController::CreateCharacterController() m_characterController->setJumpSpeed(m_cci.m_jumpSpeed); m_characterController->setFallSpeed(m_cci.m_fallSpeed); + m_characterController->setMaxJumps(m_cci.m_maxJumps); return true; } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 2ae1ff8f25a..a0b04736bdf 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -316,7 +316,8 @@ struct CcdConstructionInfo float m_stepHeight; float m_jumpSpeed; float m_fallSpeed; - + unsigned char m_maxJumps; + int m_gamesoftFlag; float m_soft_linStiff; /* linear stiffness 0..1 */ float m_soft_angStiff; /* angular stiffness 0..1 */ diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index eec579158cc..1b7267b54a6 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -3162,6 +3162,7 @@ void CcdPhysicsEnvironment::ConvertObject(KX_GameObject *gameobj, RAS_MeshObject ci.m_stepHeight = isbulletchar ? shapeprops->m_step_height : 0.f; ci.m_jumpSpeed = isbulletchar ? shapeprops->m_jump_speed : 0.f; ci.m_fallSpeed = isbulletchar ? shapeprops->m_fall_speed : 0.f; + ci.m_maxJumps = isbulletchar ? shapeprops->m_max_jumps : 0; //mmm, for now, take this for the size of the dynamicobject // Blender uses inertia for radius of dynamic object diff --git a/source/gameengine/Physics/common/PHY_Pro.h b/source/gameengine/Physics/common/PHY_Pro.h index c9b91b06a3c..bfe574e73cb 100644 --- a/source/gameengine/Physics/common/PHY_Pro.h +++ b/source/gameengine/Physics/common/PHY_Pro.h @@ -51,6 +51,7 @@ struct PHY_ShapeProps { MT_Scalar m_step_height; // Max height of climbable steps (Character) MT_Scalar m_jump_speed; // Velocity of jumps (Character) MT_Scalar m_fall_speed; // Max velocity of falling (Character) + unsigned char m_max_jumps; // Max ammount of jumps (Character) }; |