Skip to content

Commit

Permalink
UPBGE: Remove SG word in SG_Node function.
Browse files Browse the repository at this point in the history
It is not necessary to repeat that a function is from a scene graph
class when we call it from a scene graph class.
  • Loading branch information
panzergame committed May 26, 2018
1 parent 92cefc1 commit 06e8f2a
Show file tree
Hide file tree
Showing 21 changed files with 152 additions and 152 deletions.
18 changes: 9 additions & 9 deletions source/gameengine/Converter/BL_BlenderDataConversion.cpp
Expand Up @@ -620,7 +620,7 @@ static void BL_CreateGraphicObjectNew(KX_GameObject *gameobj, KX_Scene *kxscene,
{
CcdPhysicsEnvironment *env = (CcdPhysicsEnvironment *)kxscene->GetPhysicsEnvironment();
BLI_assert(env);
PHY_IMotionState *motionstate = new KX_MotionState(gameobj->GetSGNode());
PHY_IMotionState *motionstate = new KX_MotionState(gameobj->GetNode());
CcdGraphicController *ctrl = new CcdGraphicController(env, motionstate);
gameobj->SetGraphicController(ctrl);
ctrl->SetNewClientInfo(&gameobj->GetClientInfo());
Expand Down Expand Up @@ -676,7 +676,7 @@ static void BL_CreatePhysicsObjectNew(KX_GameObject *gameobj, Object *blenderobj
return;
}

PHY_IMotionState *motionstate = new KX_MotionState(gameobj->GetSGNode());
PHY_IMotionState *motionstate = new KX_MotionState(gameobj->GetNode());

PHY_IPhysicsEnvironment *phyenv = kxscene->GetPhysicsEnvironment();
phyenv->ConvertObject(converter, gameobj, meshobj, kxscene, motionstate, activeLayerBitInfo,
Expand Down Expand Up @@ -1117,7 +1117,7 @@ static void bl_ConvertBlenderObject_Single(BL_SceneConverter& converter,
gameobj->NodeSetLocalPosition(pos);
gameobj->NodeSetLocalOrientation(rotation);
gameobj->NodeSetLocalScale(scale);
gameobj->NodeUpdateGS();
gameobj->NodeUpdate();

sumolist->Add(CM_AddRef(gameobj));

Expand Down Expand Up @@ -1147,7 +1147,7 @@ static void bl_ConvertBlenderObject_Single(BL_SceneConverter& converter,
parentinversenode->SetLocalPosition(mt::vec3(invp_loc));
parentinversenode->SetLocalOrientation(mt::mat3(invp_rot));
parentinversenode->SetLocalScale(mt::vec3(invp_size));
parentinversenode->AddChild(gameobj->GetSGNode());
parentinversenode->AddChild(gameobj->GetNode());
}

// Needed for python scripting.
Expand All @@ -1167,7 +1167,7 @@ static void bl_ConvertBlenderObject_Single(BL_SceneConverter& converter,
if (isInActiveLayer) {
objectlist->Add(CM_AddRef(gameobj));

gameobj->NodeUpdateGS();
gameobj->NodeUpdate();
}
else {
// We must store this object otherwise it will be deleted at the end of this function if it is not a root object.
Expand Down Expand Up @@ -1409,7 +1409,7 @@ void BL_ConvertBlenderObjects(struct Main *maggie,
* This weird situation is used in Apricot for test purposes.
* Resolve it by not converting the child
*/
childobj->GetSGNode()->DisconnectFromParent();
childobj->GetNode()->DisconnectFromParent();
delete link.m_gamechildnode;
/* Now destroy the child object but also all its descendent that may already be linked
* Remove the child reference in the local list!
Expand Down Expand Up @@ -1472,15 +1472,15 @@ void BL_ConvertBlenderObjects(struct Main *maggie,
}
}

parentobj->GetSGNode()->AddChild(link.m_gamechildnode);
parentobj->GetNode()->AddChild(link.m_gamechildnode);
}
vec_parent_child.clear();

// Find 'root' parents (object that has not parents in SceneGraph).
for (KX_GameObject *gameobj : sumolist) {
if (!gameobj->GetSGNode()->GetSGParent()) {
if (!gameobj->GetNode()->GetParent()) {
parentlist->Add(CM_AddRef(gameobj));
gameobj->NodeUpdateGS();
gameobj->NodeUpdate();
}
}

Expand Down
26 changes: 13 additions & 13 deletions source/gameengine/Ketsji/BL_Action.cpp
Expand Up @@ -108,7 +108,7 @@ void BL_Action::ClearControllerList()
std::vector<SG_Controller *>::iterator it;
for (it = m_sg_contr_list.begin(); it != m_sg_contr_list.end(); it++)
{
m_obj->GetSGNode()->RemoveSGController((*it));
m_obj->GetNode()->RemoveController((*it));
delete *it;
}

Expand Down Expand Up @@ -169,23 +169,23 @@ bool BL_Action::Play(const std::string& name,
// Create an SG_Controller
SG_Controller *sg_contr = BL_CreateIPO(m_action, m_obj, kxscene);
m_sg_contr_list.push_back(sg_contr);
m_obj->GetSGNode()->AddSGController(sg_contr);
sg_contr->SetNode(m_obj->GetSGNode());
m_obj->GetNode()->AddController(sg_contr);
sg_contr->SetNode(m_obj->GetNode());

// World
sg_contr = BL_CreateWorldIPO(m_action, kxscene->GetBlenderScene()->world, kxscene);
if (sg_contr) {
m_sg_contr_list.push_back(sg_contr);
m_obj->GetSGNode()->AddSGController(sg_contr);
sg_contr->SetNode(m_obj->GetSGNode());
m_obj->GetNode()->AddController(sg_contr);
sg_contr->SetNode(m_obj->GetNode());
}

// Try obcolor
sg_contr = BL_CreateObColorIPO(m_action, m_obj, kxscene);
if (sg_contr) {
m_sg_contr_list.push_back(sg_contr);
m_obj->GetSGNode()->AddSGController(sg_contr);
sg_contr->SetNode(m_obj->GetSGNode());
m_obj->GetNode()->AddController(sg_contr);
sg_contr->SetNode(m_obj->GetNode());
}

// Now try materials
Expand All @@ -196,8 +196,8 @@ bool BL_Action::Play(const std::string& name,
sg_contr = BL_CreateMaterialIpo(m_action, polymat, m_obj, kxscene);
if (sg_contr) {
m_sg_contr_list.push_back(sg_contr);
m_obj->GetSGNode()->AddSGController(sg_contr);
sg_contr->SetNode(m_obj->GetSGNode());
m_obj->GetNode()->AddController(sg_contr);
sg_contr->SetNode(m_obj->GetNode());
}
}
}
Expand All @@ -206,14 +206,14 @@ bool BL_Action::Play(const std::string& name,
if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT) {
sg_contr = BL_CreateLampIPO(m_action, m_obj, kxscene);
m_sg_contr_list.push_back(sg_contr);
m_obj->GetSGNode()->AddSGController(sg_contr);
sg_contr->SetNode(m_obj->GetSGNode());
m_obj->GetNode()->AddController(sg_contr);
sg_contr->SetNode(m_obj->GetNode());
}
else if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_CAMERA) {
sg_contr = BL_CreateCameraIPO(m_action, m_obj, kxscene);
m_sg_contr_list.push_back(sg_contr);
m_obj->GetSGNode()->AddSGController(sg_contr);
sg_contr->SetNode(m_obj->GetSGNode());
m_obj->GetNode()->AddController(sg_contr);
sg_contr->SetNode(m_obj->GetNode());
}

m_ipo_flags = ipo_flags;
Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/Ketsji/KX_BoneParentNodeRelationship.cpp
Expand Up @@ -57,7 +57,7 @@ bool KX_BoneParentRelation::UpdateChildCoordinates(SG_Node *child, const SG_Node
bool valid_parent_transform = false;

if (parent) {
BL_ArmatureObject *armature = (BL_ArmatureObject *)(parent->GetSGClientObject());
BL_ArmatureObject *armature = (BL_ArmatureObject *)(parent->GetClientObject());
if (armature) {
mt::mat3x4 bonetrans;
if (armature->GetBoneTransform(m_bone, bonetrans)) {
Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/Ketsji/KX_CameraIpoSGController.cpp
Expand Up @@ -40,7 +40,7 @@ bool KX_CameraIpoSGController::Update()
return false;
}

KX_Camera *kxcamera = (KX_Camera *)m_node->GetSGClientObject();
KX_Camera *kxcamera = (KX_Camera *)m_node->GetClientObject();
RAS_CameraData *camdata = kxcamera->GetCameraData();

if (m_modify_lens) {
Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/Ketsji/KX_ConstraintActuator.cpp
Expand Up @@ -531,7 +531,7 @@ bool KX_ConstraintActuator::Update(double curtime)
case KX_ACT_CONSTRAINT_LOCX:
case KX_ACT_CONSTRAINT_LOCY:
case KX_ACT_CONSTRAINT_LOCZ:
newposition = position = obj->GetSGNode()->GetLocalPosition();
newposition = position = obj->GetNode()->GetLocalPosition();
switch (m_locrot) {
case KX_ACT_CONSTRAINT_LOCX:
{
Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/Ketsji/KX_CullingHandler.cpp
Expand Up @@ -11,7 +11,7 @@ KX_CullingHandler::KX_CullingHandler(std::vector<KX_GameObject *>& objects, cons

void KX_CullingHandler::Process(KX_GameObject *object)
{
SG_Node *sgnode = object->GetSGNode();
SG_Node *sgnode = object->GetNode();
SG_CullingNode *node = object->GetCullingNode();

const mt::mat3x4 trans = sgnode->GetWorldTransform();
Expand Down

0 comments on commit 06e8f2a

Please sign in to comment.