Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Thowaah committed Oct 13, 2023
2 parents 09ad152 + 8264e02 commit 49edc49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Assets/Scripts/AugmentaSimulation/PointManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ private OSCMessage CreateAugmentaMessageObjectTUIO(string address, GameObject ob
//float boundingRotation = behaviour.boundingRotation - orientationParam->floatValue();
float a = (behaviour.orientation / 180) * Mathf.PI; //
float bba = (rotation / 180) * Mathf.PI; // bb orientation in rad
float z = behaviour.transform.position.y / TUIOManager.activeManager.sceneDepth; // Normalized
float z = behaviour.transform.position.y / TUIOManager.activeManager.sceneDepth; // centroid / sceneDepth -> centroid == behaviour.size.z/2 here

switch (TUIOManager.activeManager.TUIODescriptor)
{
Expand All @@ -1122,7 +1122,7 @@ private OSCMessage CreateAugmentaMessageObjectTUIO(string address, GameObject ob
msg.Append(behaviour.slotid); // i (class id)
msg.Append(pointX); // x
msg.Append(pointY); // y
msg.Append(z / 2); // z
msg.Append(z); // z
msg.Append(a); // a
msg.Append(-behaviour.normalizedVelocity.x); // X
msg.Append(-behaviour.normalizedVelocity.z); // Y
Expand All @@ -1136,7 +1136,7 @@ private OSCMessage CreateAugmentaMessageObjectTUIO(string address, GameObject ob
msg.Append(behaviour.slotid); // i (class id)
msg.Append(pointX); // x
msg.Append(pointY); // y
msg.Append(z / 2); // z
msg.Append(z); // z
msg.Append(a); // a
msg.Append(0.0f); // b
msg.Append(0.0f); // c
Expand Down Expand Up @@ -1168,7 +1168,7 @@ private OSCMessage CreateAugmentaMessageObjectTUIO(string address, GameObject ob
msg.Append(behaviour.id); // s
msg.Append(pointX); // x
msg.Append(pointY); // y
msg.Append(z / 2); // z
msg.Append(z); // z
msg.Append(-behaviour.normalizedVelocity.x); // X
msg.Append(-behaviour.normalizedVelocity.z); // Y
msg.Append(0.0f); // Z
Expand All @@ -1178,7 +1178,7 @@ private OSCMessage CreateAugmentaMessageObjectTUIO(string address, GameObject ob
msg.Append(behaviour.id); // s
msg.Append(pointX); // x
msg.Append(pointY); // y
msg.Append(z / 2); // z
msg.Append(z); // z
msg.Append(-behaviour.normalizedVelocity.x); // X
msg.Append(-behaviour.normalizedVelocity.z); // Y
msg.Append(0.0f); // Z
Expand Down Expand Up @@ -1209,7 +1209,7 @@ private OSCMessage CreateAugmentaMessageObjectTUIO(string address, GameObject ob
msg.Append(behaviour.id); // s
msg.Append(pointX); // x
msg.Append(pointY); // y
msg.Append(z / 2); // z
msg.Append(z); // z
msg.Append(bba); // a
msg.Append(behaviour.size.x / width); // w (bounding box dimension)
msg.Append(behaviour.size.y / height); // h
Expand All @@ -1225,7 +1225,7 @@ private OSCMessage CreateAugmentaMessageObjectTUIO(string address, GameObject ob
msg.Append(behaviour.id); // s
msg.Append(pointX); // x
msg.Append(pointY); // y
msg.Append(z/2); // z
msg.Append(z); // z
msg.Append(bba); // a
msg.Append(0.0f); // b
msg.Append(0.0f); // c
Expand Down Expand Up @@ -1258,7 +1258,8 @@ private OSCMessage CreateAugmentaMessageTUIOScene()
msg.Append(Time.frameCount); // Frame number
msg.Append(_pointsCount); // Objects count
msg.Append(width); // Scene width
msg.Append(height); //Scene height
msg.Append(height); // Scene height
msg.Append(TUIOManager.activeManager.sceneDepth); // For TUIO output we add the sceneDepth parameter to the scene message (because we use it to normalize the height to follow the TUIO standard)

return msg;
}
Expand Down
1 change: 1 addition & 0 deletions docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Here are the differences that you can expect between the simulator and real-worl

- The data of people moving around will not be as linear as the objects moving with the default settings of the simulator. There are a few filters to generate variations in speed, orientation etc to get closer to real-world data that you can use to better test your content.
- In the simulated data provided by this tool, the `centroid` data will always be at the exact same place than the `bounding box center` of each object. This will not be the case in real-world data, as the centroid is the *center of mass* of each tracked object and the *boudning box center* is used to place the bounding box at the right position in space. For example, if you are standing up and extending an arm to your side, the *bounding box center* will be close to your extended arm's shoulder (halfway between the tip of your hand and your opposite shoulder). But the *centroid* will be closer to your chest, because when the detection and tracking is done, the camera will see more points belonging to your chest/head/center of your body than points belonging to your arms.
- There is no support for OSC bundles in the TUIO output of the Augmenta Simulator. If you encounter performance issues on the creative software side with a lot of points in TUIO, it might come from too much messages coming in. There is an option to bundle the updates together in Augmenta Fusion that can fix such issues.

## Controls

Expand Down

0 comments on commit 49edc49

Please sign in to comment.