Skip to content

Commit

Permalink
UPBGE: Remove unused m_rootnode member in KX_Scene.
Browse files Browse the repository at this point in the history
This member was used only locally in a function, its visibility
is restricted then.
  • Loading branch information
panzergame committed Dec 10, 2017
1 parent 555e650 commit a82e220
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
13 changes: 6 additions & 7 deletions source/gameengine/Ketsji/KX_Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ KX_Scene::KX_Scene(SCA_IInputDevice *inputDevice,
m_mousemgr(nullptr),
m_physicsEnvironment(0),
m_sceneName(sceneName),
m_rootnode(nullptr),
m_activeCamera(nullptr),
m_overrideCullingCamera(nullptr),
m_ueberExecutionPriority(0),
Expand Down Expand Up @@ -481,19 +480,19 @@ KX_GameObject *KX_Scene::AddNodeReplicaObject(SG_Node *node, KX_GameObject *game
newobj->SetSGNode(node);
}
else {
m_rootnode = new SG_Node(newobj, this, KX_Scene::m_callbacks);
SG_Node *rootnode = new SG_Node(newobj, this, KX_Scene::m_callbacks);

// This fixes part of the scaling-added object bug.
SG_Node *orgnode = gameobj->GetSGNode();
m_rootnode->SetLocalScale(orgnode->GetLocalScale());
m_rootnode->SetLocalPosition(orgnode->GetLocalPosition());
m_rootnode->SetLocalOrientation(orgnode->GetLocalOrientation());
rootnode->SetLocalScale(orgnode->GetLocalScale());
rootnode->SetLocalPosition(orgnode->GetLocalPosition());
rootnode->SetLocalOrientation(orgnode->GetLocalOrientation());

// Define the relationship between this node and it's parent.
KX_NormalParentRelation *parent_relation = new KX_NormalParentRelation();
m_rootnode->SetParentRelation(parent_relation);
rootnode->SetParentRelation(parent_relation);

newobj->SetSGNode(m_rootnode);
newobj->SetSGNode(rootnode);
}

SG_Node *replicanode = newobj->GetSGNode();
Expand Down
7 changes: 0 additions & 7 deletions source/gameengine/Ketsji/KX_Scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,6 @@ class KX_Scene : public EXP_Value, public SCA_IScene
/// Network scene.
KX_NetworkMessageScene *m_networkScene;

/**
* A temporary variable used to parent objects together on
* replication. Don't get confused by the name it is not
* the scene's root node!
*/
SG_Node *m_rootnode;

/// The active camera for the scene.
KX_Camera *m_activeCamera;
/// The active camera for scene culling.
Expand Down

0 comments on commit a82e220

Please sign in to comment.