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:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-09-18 23:28:28 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-09-18 23:28:28 +0400
commit02a91ac784d2d4f612dcd3a7772d0f1b26b56166 (patch)
tree1e5e1b11bc780ebc685d9b9560a73486359946c5
parenta283e7e4af8b1016ac2162cdb0f7b2cc10f94376 (diff)
BGE patch: change constraint location actuator to work in local coordinates. It won't change anything for root objects but will be of some use for child objects.
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintActuator.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
index 4b57b0e8c54..e0c9af5ae60 100644
--- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
@@ -359,7 +359,7 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
case KX_ACT_CONSTRAINT_LOCX:
case KX_ACT_CONSTRAINT_LOCY:
case KX_ACT_CONSTRAINT_LOCZ:
- newposition = position;
+ newposition = position = obj->GetSGNode()->GetLocalPosition();
switch (m_locrot) {
case KX_ACT_CONSTRAINT_LOCX:
Clamp(newposition[0], m_minimumBound, m_maximumBound);
@@ -375,7 +375,8 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
if (m_posDampTime) {
newposition = filter*position + (1.0-filter)*newposition;
}
- break;
+ obj->NodeSetLocalPosition(newposition);
+ goto CHECK_TIME;
}
if (result) {
// set the new position but take into account parent if any