From 9f5399918176c73fc366c0982738128c71615a77 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 20 Jul 2008 21:09:56 +0000 Subject: BGE patch: constraint orientation actuator did not work when damping=0. --- source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/gameengine/Ketsji/KX_ConstraintActuator.cpp') diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 80288a72485..e0b2efb3a25 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -178,16 +178,18 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame) direction[2] = rotation[2][1]; axis = 1; break; - case KX_ACT_CONSTRAINT_ORIZ: + default: direction[0] = rotation[0][2]; direction[1] = rotation[1][2]; direction[2] = rotation[2][2]; axis = 2; break; } - // apply damping on the direction if (m_posDampTime) { + // apply damping on the direction direction = filter*direction + (1.0-filter)*m_refDirection; + } else { + direction = m_refDirection; } obj->AlignAxisToVect(direction, axis); result = true; -- cgit v1.2.3