Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • q - quit
  • play_intro - Play intro sequence
  • vhmsg ... - Send vhmsg out to system. 'vhmsg sbm ...' for sending a smartbody command
  • set_resolution x y - Set_resolution to 'x' x 'y'. Example 'set_resolution 1024 768'
  • toggle_fullscreen - toggle windowed / fullscreen
  • set_loco_char_name - ...

How do Unity and SmartBody interact?

We have a c++ dll, called the vhWrapper, that wraps API calls into SmartBody. This dll is loaded into Unity and its functions are exposed in the SmartbodyExternals.cs file in Unity.  These function are then called from the SmartbodyManager.cs class (also inside of unity).  This dll is used for 2-way interaction between Unity and SmartBody.  For example, you can send python commands from Unity to Smartbody using the function SmartbodyManager.PythonCommand(..) or play an animation using SmartbodyManager.SBPlayAnim(..);

Each frame, unity passes it’s time step to SmartBody and SmartBody returns to Unity all the positions/rotations of the joints of each character.  You can see the structures that are marshaled between the c# and c++ worlds in SmartbodyCharacterWrapper and UnityCharacterData structs.  These structs contain all the data that is passed from Unity to Smartbody and back each frame. 

Look at SmartbodyManager.LateUpdate and GetUnityCharacterData and UnitySmartbodyCharacter.OnBoneTransformations() functions to see how the data is used

Ogre

To what extent Is Ogre supported?

...