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:
Diffstat (limited to 'source/gameengine/Ketsji/KX_IPO_SGController.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_IPO_SGController.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.cpp b/source/gameengine/Ketsji/KX_IPO_SGController.cpp
index 55a7e2ade60..bd7e09d1dda 100644
--- a/source/gameengine/Ketsji/KX_IPO_SGController.cpp
+++ b/source/gameengine/Ketsji/KX_IPO_SGController.cpp
@@ -194,7 +194,8 @@ bool KX_IpoSGController::Update(double currentTime)
else
newPosition = m_ipo_start_point + newPosition;
}
- ob->SetLocalPosition(newPosition);
+ if (m_game_object)
+ m_game_object->NodeSetLocalPosition(newPosition);
}
}
//modifies orientation?
@@ -233,7 +234,8 @@ bool KX_IpoSGController::Update(double currentTime)
rotation = m_ipo_start_orient * rotation;
else
rotation = rotation * m_ipo_start_orient;
- ob->SetLocalOrientation(rotation);
+ if (m_game_object)
+ m_game_object->NodeSetLocalOrientation(rotation);
}
} else if (m_ipo_channels_active[OB_ROT_X] || m_ipo_channels_active[OB_ROT_Y] || m_ipo_channels_active[OB_ROT_Z]) {
if (m_ipo_euler_initialized) {
@@ -265,7 +267,8 @@ bool KX_IpoSGController::Update(double currentTime)
else if (m_ipo_channels_active[OB_DROT_Z]) {
roll += m_ipo_xform.GetDeltaEulerAngles()[2];
}
- ob->SetLocalOrientation(MT_Vector3(yaw, pitch, roll));
+ if (m_game_object)
+ m_game_object->NodeSetLocalOrientation(MT_Vector3(yaw, pitch, roll));
}
} else if (m_ipo_start_initialized) {
// only DROT, treat as Add
@@ -286,7 +289,8 @@ bool KX_IpoSGController::Update(double currentTime)
// dRot are always local
MT_Matrix3x3 rotation(MT_Vector3(yaw, pitch, roll));
rotation = m_ipo_start_orient * rotation;
- ob->SetLocalOrientation(rotation);
+ if (m_game_object)
+ m_game_object->NodeSetLocalOrientation(rotation);
}
}
//modifies scale?
@@ -322,8 +326,8 @@ bool KX_IpoSGController::Update(double currentTime)
if (m_ipo_add) {
newScale = m_ipo_start_scale * newScale;
}
-
- ob->SetLocalScale(newScale);
+ if (m_game_object)
+ m_game_object->NodeSetLocalScale(newScale);
}
m_modified=false;
@@ -342,6 +346,7 @@ SG_Controller* KX_IpoSGController::GetReplica(class SG_Node* destnode)
KX_IpoSGController* iporeplica = new KX_IpoSGController(*this);
// clear object that ipo acts on in the replica.
iporeplica->ClearObject();
+ iporeplica->SetGameObject((KX_GameObject*)destnode->GetSGClientObject());
// dirty hack, ask Gino for a better solution in the ipo implementation
// hacken en zagen, in what we call datahiding, not written for replication :(