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:
authorSybren A. Stüvel <sybren@stuvel.eu>2016-01-25 15:43:28 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2016-01-25 15:50:52 +0300
commit83c9109926677b6b6a75ccb36ae0017733e8c8a2 (patch)
treea37ec2e095b89d05adec4717d7c19c46337d5935 /source/gameengine/Ketsji
parente8b5670da09e23d5b8b9c2790187d5be5aba922f (diff)
Fix T46902: Revert zeroing velocity in BGE logic brick
This reverts commit 3dbc123061aa063efd1fca358f5e295b0ce7b302, "BGE: allow setting velocity to zero in a motion actuator" as it caused more issues than it solved. Zeroing linear or angular velocity with logic bricks is discussed further in https://developer.blender.org/D1545
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r--source/gameengine/Ketsji/KX_ObjectActuator.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
index 87c2592ecfd..45436693281 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
@@ -276,16 +276,8 @@ bool KX_ObjectActuator::Update()
{
parent->ApplyRotation(m_drot,(m_bitLocalFlag.DRot) != 0);
}
-
- if (m_bitLocalFlag.ZeroLinearVelocity) {
- if (!m_bitLocalFlag.AddOrSetLinV) {
- /* No need to select local or world, as the velocity is zero anyway,
- * and setLinearVelocity() converts local to world first. We do need to
- * pass a true zero vector, as m_linear_velocity is only fuzzily zero. */
- parent->setLinearVelocity(MT_Vector3(0, 0, 0), false);
- }
- }
- else {
+ if (!m_bitLocalFlag.ZeroLinearVelocity)
+ {
if (m_bitLocalFlag.AddOrSetLinV) {
parent->addLinearVelocity(m_linear_velocity,(m_bitLocalFlag.LinearVelocity) != 0);
} else {
@@ -310,13 +302,8 @@ bool KX_ObjectActuator::Update()
}
}
}
- if (m_bitLocalFlag.ZeroAngularVelocity) {
- /* No need to select local or world, as the velocity is zero anyway,
- * and setAngularVelocity() converts local to world first. We do need to
- * pass a true zero vector, as m_angular_velocity is only fuzzily zero. */
- parent->setAngularVelocity(MT_Vector3(0, 0, 0), false);
- }
- else {
+ if (!m_bitLocalFlag.ZeroAngularVelocity)
+ {
m_active_combined_velocity = true;
if (m_damping > 0) {
MT_Vector3 angV;