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/SceneGraph/SG_Spatial.cpp')
-rw-r--r--source/gameengine/SceneGraph/SG_Spatial.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/source/gameengine/SceneGraph/SG_Spatial.cpp b/source/gameengine/SceneGraph/SG_Spatial.cpp
index 99aeb3e72ee..2f3176816c6 100644
--- a/source/gameengine/SceneGraph/SG_Spatial.cpp
+++ b/source/gameengine/SceneGraph/SG_Spatial.cpp
@@ -55,7 +55,8 @@ SG_Spatial(
m_parent_relation (NULL),
m_bbox(MT_Point3(-1.0, -1.0, -1.0), MT_Point3(1.0, 1.0, 1.0)),
- m_radius(1.0)
+ m_radius(1.0),
+ m_modified(true)
{
}
@@ -101,6 +102,7 @@ SetParentRelation(
){
delete (m_parent_relation);
m_parent_relation = relation;
+ m_modified = true;
}
@@ -114,7 +116,8 @@ SetParentRelation(
SG_Spatial::
UpdateSpatialData(
const SG_Spatial *parent,
- double time
+ double time,
+ bool& parentUpdated
){
bool bComputesWorldTransform = false;
@@ -135,14 +138,14 @@ UpdateSpatialData(
// our world coordinates.
if (!bComputesWorldTransform)
- bComputesWorldTransform = ComputeWorldTransforms(parent);
+ bComputesWorldTransform = ComputeWorldTransforms(parent, parentUpdated);
return bComputesWorldTransform;
}
-bool SG_Spatial::ComputeWorldTransforms(const SG_Spatial *parent)
+bool SG_Spatial::ComputeWorldTransforms(const SG_Spatial *parent, bool& parentUpdated)
{
- return m_parent_relation->UpdateChildCoordinates(this,parent);
+ return m_parent_relation->UpdateChildCoordinates(this,parent,parentUpdated);
}
/**
@@ -166,6 +169,7 @@ RelativeTranslate(
m_localPosition += trans;
}
}
+ m_modified = true;
}
void
@@ -174,6 +178,7 @@ SetLocalPosition(
const MT_Point3& trans
){
m_localPosition = trans;
+ m_modified = true;
}
void
@@ -194,6 +199,7 @@ RelativeScale(
const MT_Vector3& scale
){
m_localScaling = m_localScaling * scale;
+ m_modified = true;
}
void
@@ -202,6 +208,7 @@ SetLocalScale(
const MT_Vector3& scale
){
m_localScaling = scale;
+ m_modified = true;
}
@@ -229,6 +236,7 @@ RelativeRotate(
rot
:
(GetWorldOrientation().inverse() * rot * GetWorldOrientation()));
+ m_modified = true;
}
void
@@ -236,6 +244,7 @@ SG_Spatial::
SetLocalOrientation(const MT_Matrix3x3& rot)
{
m_localRotation = rot;
+ m_modified = true;
}