Skip to content

Commit

Permalink
UPBGE: Fix compilation error on MSVC 2013
Browse files Browse the repository at this point in the history
  • Loading branch information
youle31 committed Jun 14, 2017
1 parent 70052ca commit 59897a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,18 @@ void BlenderBulletCharacterController::SetJumpSpeed(float jumpSpeed)
setJumpSpeed(jumpSpeed);
}

void BlenderBulletCharacterController::SetVelocity(btVector3 vel, float time, bool local)
void BlenderBulletCharacterController::SetVelocity(const btVector3& vel, float time, bool local)
{
btVector3 v = vel;
if (local) {
const btTransform xform = getGhostObject()->getWorldTransform();
vel = xform.getBasis() * vel;
v = xform.getBasis() * v;
}

// Avoid changing velocity and keeping previous time interval.
m_velocityTimeInterval = 0.0f;

setVelocityForTimeInterval(vel, time);
setVelocityForTimeInterval(v, time);
}

void BlenderBulletCharacterController::SetVelocity(const MT_Vector3& vel, float time, bool local)
Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/Physics/Bullet/CcdPhysicsController.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class BlenderBulletCharacterController : public btKinematicCharacterController,

const btVector3& getWalkDirection();

void SetVelocity(btVector3 vel, float time, bool local);
void SetVelocity(const btVector3& vel, float time, bool local);

// PHY_ICharacter interface
virtual void Jump()
Expand Down

0 comments on commit 59897a0

Please sign in to comment.