Using the Kinect Plug-in
For using the Kinect plug-in, you must install the Kinect for Windows SDK v1.8 or Kinect for Windows Runtime v1.8 . You can download the Kinect for Windows SDK from http://www.microsoft.com/en-us/kinectforwindowsdev/Downloads.aspx. The Kinect for Windows Runtime is available in the MotionBuilder installation package inside the 3rdParty\x86\KinectRuntime folder. Alternatively, you can download the runtime from http://www.microsoft.com/en-us/download/details.aspx?id=40277.
FBMocapJointsState
The FBMocapJointsState
class is used for storing a frame of skeleton tracking data from the motion capture device. It contains the tracking state and position of the whole skeleton, number of joints set by the motion capture device, arrays for positions, tracking state of each joint, and global orientation of each bone. The arrays are dynamically allocated according to the number of joints in the motion capture device specification. The tracking state indicates whether a joint is tracked or not, and whether the position of the joint is inferred by the motion capture device SDK. The tracking ID of the skeleton is not contained because the plug-in can manage multiple user tracking.
int mSkeletonJointsCount; //!< Number of joints set by the motion capture device.
double mFloorClipPlaneW; //!< Floor Clip Plane W value for camera reposition.
FBSkeletonTrackingState mSkeletonTrackingState; //!< State of the skeleton tracking.
FBTVector mSkeletonPosition; //!< Position of the skeleton.
FBTVector* mSkeletonJointsPositions; //!< Position of each joint.
FBMatrix* mSkeletonJointsGlobalOrientations; //!< Global orientation of each bone.
FBSkeletonJointTrackingState* mSkeletonJointTrackingState; //!< State of the skeleton joint tracking.
FBCharacter::PassDeviceMocapData()
The FBCharacter::PassDeviceMocapData()
method is called by the motion capture device to pass the skeleton joints state data to an internal character skeleton.
FBCharacter::SetupDeviceMocap()
The FBCharacter::SetupDeviceMocap()
method initializes a character with the motion capture device as the animation source. Additionally, it sets the skeleton hierarchy used by the motion capture device.
This method defines the number and order of joints used by a motion capture device. The number of joints and their order defines a skeleton hierarchy corresponding to a specific device. For example, in Kinect, the number of joints are 20, and the first joint in the joint order is the hip, second is the spine, and so on. You can define any skeleton hierarchy corresponding to a motion capture device using this interface. For example, in PrimeSense, the number of joints are 24, and the first joint in the joint order is the head, second is the neck, and so on. Internally, a map is used for recording the joint order. Through this mapping, the index to get the position data from the position array is determined.
The interface and internal implementation is not bound to Kinect only. It can support different motion capture devices. You can optimize motion in any skeleton hierarchy for any motion capture device because the internal character has the motion capture device information. You can use the default general implementation to support a general skeleton hierarchy.
FBCharacter::SetMocapCalibrationState()
The FBCharacter::SetMocapCalibrationState()
method sets the mocap calibration state. It is called when doing calibration for T-Stance. State 0 means no calibration request, so setting to 0 resets the calibration state. State 1 means processing a calibration request and performing detection. State 2 means calibration detected successfully.
FBCharacter::GetMocapCalibrationState()
The FBCharacter::GetMocapCalibrationState()
gets the current calibration state. This method is called to see if the calibration detection is successful. If the calibration detection is successful, some calibration operations are performed by the plug-in.
FBCharacter::SetSensorFloorOffset()
The FBCharacter::SetSensorFloorOffset()
method is called after a successful T-Stance calibration to set the height of the sensor above the floor. This is used for moving the skeleton roughly to the ground.