Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Szepe <HG1_public@gmx.net>2015-10-11 16:41:40 +0300
committerThomas Szepe <HG1_public@gmx.net>2015-10-11 16:41:40 +0300
commit83721682bb12a5b3c277e832241e0752fdb2df2e (patch)
treed3c4b1d6dc4e9a22e98a68dfd2427acc6da41156 /source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
parent5295202c2ca3ae6a57a0af0ddbd637c220760826 (diff)
BGE: Change character jumping to char
* Change the character jumping variables and methods from int to char. * Limit the maxJumps integer value from 0 to 255. * Allow to set the minimum jump amount to 0. Reviewers: panzergame, lordloki, moguri Reviewed By: lordloki, moguri Subscribers: agoose77 Projects: #game_engine Differential Revision: https://developer.blender.org/D1305
Diffstat (limited to 'source/gameengine/Physics/Bullet/CcdPhysicsController.cpp')
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index ab7097b19ca..6a1e52c9263 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -81,24 +81,24 @@ void BlenderBulletCharacterController::updateAction(btCollisionWorld *collisionW
m_motionState->setWorldTransform(getGhostObject()->getWorldTransform());
}
-int BlenderBulletCharacterController::getMaxJumps() const
+unsigned char BlenderBulletCharacterController::getMaxJumps() const
{
return m_maxJumps;
}
-void BlenderBulletCharacterController::setMaxJumps(int maxJumps)
+void BlenderBulletCharacterController::setMaxJumps(unsigned char maxJumps)
{
m_maxJumps = maxJumps;
}
-int BlenderBulletCharacterController::getJumpCount() const
+unsigned char BlenderBulletCharacterController::getJumpCount() const
{
return m_jumps;
}
bool BlenderBulletCharacterController::canJump() const
{
- return onGround() || m_jumps < m_maxJumps;
+ return (onGround() && m_maxJumps > 0) || m_jumps < m_maxJumps;
}
void BlenderBulletCharacterController::jump()