Skip to content

Commit

Permalink
Fix code style.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndob committed Jan 13, 2016
1 parent f5476ec commit b837347
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/unity/UnityNativePlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ void addPose(json11::Json::array& toJson, const yarrar::Pose& pose)

cv::Mat rotationMtx;
cv::Rodrigues(pose.rotation, rotationMtx);
for (int i = 0; i < 3; ++i)
for(int i = 0; i < 3; ++i)
{
for (int j = 0; j < 3; ++j)
for(int j = 0; j < 3; ++j)
{
rotationMatrix.push_back(rotationMtx.at<double>(i, j));
}
}
for (int i = 0; i < 3; ++i)

for(int i = 0; i < 3; ++i)
{
translationMatrix.push_back(pose.translation.at<double>(i));
}

for (int i = 0; i < 3; ++i)
for(int i = 0; i < 3; ++i)
{
for (int j = 0; j < 3; ++j)
for(int j = 0; j < 3; ++j)
{
cameraMatrix.push_back(pose.camera.at<float>(i, j));
}
}

json11::Json poseJson = json11::Json::object{
{ "rotation", rotationMatrix },
{ "translation", translationMatrix },
Expand All @@ -66,7 +66,7 @@ void storePosesToReturnBuffer(const std::vector<yarrar::Pose>& poses)
{
// Add all poses to a JSON-array.
json11::Json::array poseArray;
for (const auto& pose : poses)
for(const auto& pose : poses)
{
addPose(poseArray, pose);
}
Expand Down Expand Up @@ -110,9 +110,9 @@ const EXPORT_API char* getPose(void* pixelBuffer, int width, int height)

std::vector<yarrar::Pose> poses;
s_tracker->getPoses(datapoint, poses);

s_returnStringBuffer.clear();
if (poses.size() > 0)
if(poses.size() > 0)
{
storePosesToReturnBuffer(poses);
}
Expand Down

0 comments on commit b837347

Please sign in to comment.