Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/ISSUE_29' into v1.0…
Browse files Browse the repository at this point in the history
…Beta
  • Loading branch information
carmenfan committed Mar 22, 2016
2 parents 1390010 + 8b38218 commit 879a749
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions bouncer/src/repo/core/model/bson/repo_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ RepoNode RepoNode::cloneAndAddFields(
builder.append(REPO_NODE_LABEL_ID, getUniqueID());
}

builder.append(REPO_NODE_LABEL_SHARED_ID, getSharedID());

builder.appendElementsUnique(*changes);

builder.appendElementsUnique(*this);
Expand Down
16 changes: 8 additions & 8 deletions bouncer/src/repo/core/model/collection/repo_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,14 +1139,13 @@ void RepoScene::modifyNode(
RepoNode updatedNode;

//generate new UUID if it is not in list, otherwise use the current one.
bool isInList = gtype == GraphType::DEFAULT &&
bool isInList = gtype == GraphType::OPTIMIZED ||
( newAdded.find(sharedID) != newAdded.end() || newModified.find(sharedID) != newModified.end());

updatedNode = overwrite ? *newNode : RepoNode(nodeToChange->cloneAndAddFields(newNode, !isInList));

repoUUID newUniqueID = updatedNode.getUniqueID();

if (!isInList)
if (gtype == GraphType::DEFAULT && !isInList)
{
newModified.insert(sharedID);
newCurrent.erase(nodeToChange->getUniqueID());
Expand Down Expand Up @@ -1404,12 +1403,12 @@ void RepoScene::reorientateDirectXModel()
{
//Need to rotate the model by 270 degrees on the X axis
//This is essentially swapping the 2nd and 3rd column, negating the 2nd.

repoTrace << "Reorientating model...";
//Stash root and scene root should be identical!
if (graph.rootNode)
{
TransformationNode rootTrans = TransformationNode(*graph.rootNode);
std::vector<float> mat = rootTrans.getTransMatrix();
auto rootTrans = dynamic_cast<TransformationNode*>(graph.rootNode);
std::vector<float> mat = rootTrans->getTransMatrix();
if (mat.size() == 16)
{
std::vector<std::vector<float>> newMatrix;
Expand All @@ -1428,8 +1427,9 @@ void RepoScene::reorientateDirectXModel()



TransformationNode newRoot = RepoBSONFactory::makeTransformationNode(newMatrix, rootTrans.getName());
modifyNode(GraphType::DEFAULT, rootTrans.getSharedID(), &newRoot);
TransformationNode newRoot = RepoBSONFactory::makeTransformationNode(newMatrix, rootTrans->getName());
modifyNode(GraphType::DEFAULT, rootTrans->getSharedID(), &newRoot);

if (stashGraph.rootNode)
modifyNode(GraphType::OPTIMIZED, stashGraph.rootNode->getSharedID(), &newRoot);
}
Expand Down

0 comments on commit 879a749

Please sign in to comment.