The MocapApi API is the next generation programming interface of the NeuronDataReader (hereafter referred to as NDR). From the get-go, the goal has been to have an API with cross-platform compatibility (Win/Mac/Android/Ios/Linux, etc.), cross-engine access (Unity/unreal), and user-free updates. Today, MocapAPI supports C, C++, and C#, Windows, u3d and Unreal Engine.
The MocapAPI API receives outgoing socket data from AxisStudio, Pnlab and other software.
MocapApi has two particularly important data types: the interface data type, generally referred to in the naming convention of IMCpxxx
and the handle data type, generally named as MCPXxxHandle_t
. Other data types follow the Hungarian nomenclature.
The MCPXxxHandle_t
handle type is the entity index of the object, responsible for organizing and managing data, but not granting data access. The IMCPXxx
interface type is responsible for accessing data according to the MCPXxxHandle_t
handle. Typically, the IMCPXxx
type and the MCPXxxHandle_t
type are used in conjunction.
IMCPXxx
named interfaces are in MocapApi.h, C++ will use this header file. The corresponding MCPXxx_ProcTable
structure is used by C, including the MocapCApi.h header file. The representation is a structure combining n function pointers. C# uses MocapApi.cs and directly uses IMCpxxx
.MCPXxxHandle_t
exists in C and C++, but not in C#. There is no current replacement for it in C#.From now on, the "Detailed Description of Types" section uses C++ as the main description language. Please refer to this section to convert structures to the corresponding language.
The following "class specification" uses C++ as the description language. Refer to this section to describe the conversion to the appropriate programming language.
The interface type in the form of IMCpxxx
cannot be created directly, but it can be obtained at any time as needed. The acquisition methods of C and C++ are similar, and the acquisition method of C# is acquired through static functions.
Since the interface type in the form of ICMPXxx
cannot be created directly, it must be accessed through MCPGetGenericInterface
. To achieve this, you must declare MCPGetGenericInterface
.
xxxxxxxxxx
MCP_INTERFACE EMCPError MCP_CALLTYPE MCPGetGenericInterface(const char * pchInterfaceVersion, void ** ppInterface);
pchInterfaceVersion
: is a null-terminated character string, using IMCpxxx
_Version in C++ is fine as well.ppInterface
: In C++, a pointer needs to be passed to the IMCpxxx
pointer.Correspondingly, use the MCPGetProcessTable
interface in C to obtain the corresponding type, and its implementation is as follows:
xxxxxxxxxx
static EMCPError MCPGetProcessTable(const char * pchInterfaceVersion, void ** ppInterface)
{
char table[128] = "PROC_TABLE:";
return MCPGetGenericInterface(strcat(table, pchInterfaceVersion), ppInterface);
}
pchInterfaceVersion
: similar to use as in C++.ppInterface
: different from C++. Here you need to pass a pointer to the MCPXXX_ProcTable
pointer.Implementation in C# is easier. Simply call IMCpxxx.Xxx()
directly.
MocapApi follows the principle of whomever allocates memory needs to release it, that is, once the user calls the function CreateXxxxIMCpxxx
, it needs to call the corresponding DestroyXxx
function at the right time. The memory allocated by IMCPXxx
and GetXxx
functions is released by MocapApi itself.
There are two kinds of errors in MocapApi. One is a function call error, such as an empty buffer or a parameter error. The other is an error during program execution, such as a communication error with AxisStudio or Pnlab. Each function in MocapApi will return a EMCPError
error code, users can judge according to their actual situation and error. Errors during program execution will be introduced in the Event mechanism.
An Application corresponds to a broadcast output port in Axis Studio / Axis Lab. The Application encapsulates a collection of functions used to process data from Axis Studio / Axis Lab by calling PollApplicationNextEvent
, polling the latest Axis Studio messages and the status information of the Application itself.
You may obtain it using the following IMCPApplication
pointer:
xxxxxxxxxx
MocapApi::IMCPApplication * mcpApplication = nullptr;
MocapApi::MCPGetGenericInterface(MocapApi::IMCPApplication_Version,
reinterpret_cast<void **>(&mcpApplication)
&You need to use CreateApplication
to create an Application entity
The reference code is as follows:
xxxxxxxxxx
MocapApi::MCPApplicationHandle_t mcpApplicationHandle = 0;
mcpApplication->CreateApplication(&mcpApplicationHandle);
The following code can be used when an Application is no longer needed:
xxxxxxxxxx
mcpApplication->DestroyApplication(mcpApplicationHandle);
xxxxxxxxxx
virtual EMCPError CreateApplication(MCPApplicationHandle_t * ulApplicationHandle) = 0;
Create an Application entity. When the entity is no longer needed, you need to manually call DestroyApplication
.
ulApplicationHandle
returns the handle of the Application entity.
xxxxxxxxxx
virtual EMCPError DestroyApplication(MCPApplicationHandle_t ulApplicationHandle) = 0;
After destroying an Application entity, the entity represented by ulApplicationHandle
can no longer be used.
xxxxxxxxxx
virtual EMCPError SetApplicationSettings(MCPSettingsHandle_t ulSettingsHandle, MCPApplicationHandle_t ulApplicationHandle) = 0;
xxxxxxxxxx
virtual EMCPError SetApplicationRenderSettings(MCPRenderSettingsHandle_t ulRenderSettings, MCPApplicationHandle_t ulApplicationHandle) = 0;
xxxxxxxxxx
virtual EMCPError OpenApplication(MCPApplicationHandle_t ulApplicationHandle) = 0;
xxxxxxxxxx
virtual EMCPError CloseApplication(MCPApplicationHandle_t ulApplicationHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetApplicationRigidBodies(
MCPRigidBodyHandle_t * pRigidBodyHandle, /*[in, out, optional] */
uint32_t * punRigidBodyHandleSize, /*[in, out]*/
MCPApplicationHandle_t ulApplicationHandle
) = 0;
xxxxxxxxxx
virtual EMCPError GetApplicationAvatars(
MCPAvatarHandle_t * pAvatarHandle, /*[in, out, optional] */
uint32_t * punAvatarHandle, /*[in, out]*/
MCPApplicationHandle_t ulApplicationHandle
) = 0;
The reference call code is as follows: (other similar function call mechanisms work in a similar fashion)
xxxxxxxxxx
numberOfAvatars = 0;
error = application->GetApplicationAvatars(nullptr, &numberOfAvatars, applicationHandle);
if(error == Error_None){
avatars = /*allocate memory*/
error = application->GetApplicationAvatars(avatars, &numberOfAvatars, applicationHandle);
}
xxxxxxxxxx
virtual EMCPError PollApplicationNextEvent(
MCPEvent_t * pEvent /* [in, out, optional]*/,
uint32_t * unEvent, /* [in, out] */
MCPApplicationHandle_t ulApplicationHandle
) = 0;
The size of each MCPEvent_t
in pEvent
needs to be assigned:
xxxxxxxxxx
MocapApi::MCPEvent_t pEvent[1];
pEvent[0].size = sizeof(MocapApi::MCPEvent_t);
If you do not use cache mode parameters, then call the code in the following way:
xxxxxxxxxx
do {
sizeEvent = 0;
error = application->PollApplicationNextEvent(nullptr, &sizeEvent, applicationHandle);
if(error != Error_None){
break; // handle error
}
events = /*allocate memory for sizeEvent*event */
error = application->PollApplicationNextEvent(events, &sizeEvent, applicationHandle);
} while(error != Error_InsufficientBuffer)
if(error != Error_None){
// handle error
}
xxxxxxxxxx
virtual EMCPError GetApplicationSensorModules(
MCPSensorModuleHandle_t * pSensorModuleHandle, /*[in, out, optional] */
uint32_t * punSensorModuleHandle, /*[in, out]*/
MCPApplicationHandle_t ulApplicationHandle
) = 0;
xxxxxxxxxx
virtual EMCPError GetApplicationTrackers(
MCPTrackerHandle_t* pTrackerHandle, /*[in, out, optional] */
uint32_t* punTrackerHandle, /*[in, out]*/
MCPApplicationHandle_t ulApplicationHandle
) = 0;
Send command to Server, it will not delete the command. If after calling this function, call DestroyCommand
to delete the cmdHandle
object, the Server will return the command execution result with no Event
xxxxxxxxxx
virtual EMCPError QueuedServerCommand(MCPCommandHandle_t cmdHandle, /*[in]*/
MCPApplicationHandle_t ulApplicationHandle) = 0;
The Avatar entity corresponds to the Avatar in AxisStudio, so it will only be available when connected to Axis Studio. The hierarchy of the Avatar can be obtained through GetAvatarRootJoint
and the related functions of the Joint
object.
You may use the following code to get the pointer of IMCPAvatar
:
xxxxxxxxxx
MocapApi::IMCPAvatar * mcpAvatar = nullptr;
MocapApi::MCPGetGenericInterface(MocapApi::IMCPAvatar_Version,
reinterpret_cast<void **>(&mcpAvatar)
xxxxxxxxxx
typedef uint64_t MCPAvatarHandle_t;
xxxxxxxxxx
virtual EMCPError GetAvatarIndex(uint32_t * index,
MCPAvatarHandle_t ulAvatarHandle) = 0;
Joint is the skeleton node of Avatar, only when receiving BVH data.
xxxxxxxxxx
virtual EMCPError GetAvatarRootJoint(MCPJointHandle_t * pJointHandle,
MCPAvatarHandle_t ulAvatarHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetAvatarJoints(MCPJointHandle_t * pJointHandle, uint32_t * punJointHandle,
MCPAvatarHandle_t ulAvatarHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetAvatarJointByName(const char * name, MCPJointHandle_t * pJointHandle,
MCPAvatarHandle_t ulAvatarHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetAvatarName(const char **,
MCPAvatarHandle_t ulAvatarHandle) = 0;
RigidBody is a rigid body bound to the Avatar. This data is only available when receiving BVH data and when there is light mixing.
xxxxxxxxxx
virtual EMCPError GetAvatarRigidBodies(MCPRigidBodyHandle_t * pRigidBodies, uint32_t * punRigidBodies,
MCPAvatarHandle_t ulAvatarHandle) = 0;
Use the following code to get the pointer of IMCPJoint
:
xxxxxxxxxx
MocapApi::IMCPJoint * mcpJoint = nullptr;
MocapApi::MCPGetGenericInterface(MocapApi::IMCPJoint_Version,
reinterpret_cast<void **>(&mcpJoint)
xxxxxxxxxx
typedef uint64_t MCPJointHandle_t;
xxxxxxxxxx
virtual EMCPError GetJointName(const char **,
MCPJointHandle_t ulJointHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetJointLocalRotaion(float * x, float * y, float * z, float * w,
MCPJointHandle_t ulJointHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetJointLocalRotaionByEuler(float * x, float * y, float * z,
MCPJointHandle_t ulJointHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetJointLocalTransformation(float * x, float * y, float * z,
MCPJointHandle_t ulJointHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetJointDefaultLocalTransformation(float * x, float * y, float * z,
MCPJointHandle_t ulJointHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetJointChild(MCPJointHandle_t * pJointHandle,
uint32_t * punJointHandle,
MCPJointHandle_t ulJointHandle) = 0;
JointBodyPart
is a description of the Calc data and is only available when the Calc data is received.
xxxxxxxxxx
virtual EMCPError GetJointBodyPart(MCPBodyPartHandle_t * pBodyPartHandle,
MCPJointHandle_t ulJointHandle) = 0;
SensorModule
is the description of the Calc data and is only available when the Calc data is received.
xxxxxxxxxx
virtual EMCPError GetJointSensorModule(MCPSensorModuleHandle_t* pSensorModuleHandle,
MCPJointHandle_t ulJointHandle) = 0;
A pointer to the IMCPRigidBody
can be obtained using the following reference code:
xxxxxxxxxx
MocapApi::IMCPRigidBody * mcpRigidBody = nullptr;
MocapApi::MCPGetGenericInterface(MocapApi::IMCPRigidBody_Version,
reinterpret_cast<void **>(&mcpRigidBody)
xxxxxxxxxx
typedef uint64_t MCPRigidBodyHandle_t;
xxxxxxxxxx
virtual EMCPError GetRigidBodyRotaion(float * x, float * y, float * z, float * w,
MCPRigidBodyHandle_t ulRigidBodyHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetRigidBodyTransformation(float * x, float * y, float * z,
MCPRigidBodyHandle_t ulRigidBodyHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetRigidBodieStatus(int * status,
MCPRigidBodyHandle_t ulRigidBodyHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetRigidBodyId(int * id,
MCPRigidBodyHandle_t ulRigidBodyHandle) = 0;
A pointer to the IMCPSensorModule
can be obtained using the following code:
xxxxxxxxxx
MocapApi::IMCPSensorModule * mcpSensorModule = nullptr;
MocapApi::MCPGetGenericInterface(MocapApi::IMCPSensorModule_Version,
reinterpret_cast<void **>(&mcpSensorModule)
xxxxxxxxxx
typedef uint64_t MCPSensorModuleHandle_t;
xxxxxxxxxx
virtual EMCPError GetSensorModulePosture(float * x, float * y, float * z, float * w,
MCPSensorModuleHandle_t sensorModuleHandle) = 0;
To get the Quaternion of Pose.
xxxxxxxxxx
virtual EMCPError GetSensorModuleAngularVelocity(float * x, float * y, float * z,
MCPSensorModuleHandle_t sensorModuleHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetSensorModuleAcceleratedVelocity(float * x, float * y, float * z,
MCPSensorModuleHandle_t sensorModuleHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetSensorModuleId(uint32_t * id,
MCPSensorModuleHandle_t sensorModuleHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetSensorModuleCompassValue(float * x, float * y, float * z,
MCPSensorModuleHandle_t sensorModuleHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetSensorModuleTemperature(float * temperature,
MCPSensorModuleHandle_t sensorModuleHandle) = 0;
A pointer to the IMCPBodyPart
can be obtained using the following code.
xxxxxxxxxx
MocapApi::IMCPBodyPart * mcpBodyPart = nullptr;
MocapApi::MCPGetGenericInterface(MocapApi::IMCPBodyPart_Version,
reinterpret_cast<void **>(&mcpBodyPart)
xxxxxxxxxx
typedef uint64_t MCPBodyPartHandle_t;
xxxxxxxxxx
virtual EMCPError GetJointPosition(float * x, float * y, float * z,
MCPBodyPartHandle_t bodyPartHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetJointDisplacementSpeed(float * x, float * y, float * z,
MCPBodyPartHandle_t bodyPartHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetBodyPartPosture(float * x, float * y, float * z, float * w,
MCPBodyPartHandle_t bodyPartHandle) = 0;
Tracker entity is corresponding to the Device in Alice/AHM, it is only available after connected to the Alice/AHM.
A pointer to IMCPTracker
can be obtained using the following code.
xxxxxxxxxx
MocapApi::IMCPTracker * mcpTracker = nullptr;
MocapApi::MCPGetGenericInterface(MocapApi::IMCPTracker_Version,
reinterpret_cast<void **>(&mcpTracker)
xxxxxxxxxx
typedef uint64_t MCPTrackerHandle_t;
xxxxxxxxxx
virtual EMCPError GetDeviceCount(int* devCount,
MCPTrackerHandle_t ulTrackerHandle) = 0;
On the basis of obtaining DeviceCount
, iterating from 0 to DeviceCount
as serialNum
to obtain DeviceName
, and obtaining subsequent related data using DeviceName
as key.
xxxxxxxxxx
virtual EMCPError GetDeviceName(int serialNum, const char** name,
MCPTrackerHandle_t ulTrackerHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetTrackerRotation(float* x, float* y, float* z, float* w, const char* deviceName,
MCPTrackerHandle_t ulTrackerHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetTrackerPosition(float* x, float* y, float* z, const char* deviceName,
MCPTrackerHandle_t ulTrackerHandle) = 0;
xxxxxxxxxx
virtual EMCPError GetTrackerEulerAng(float* x, float* y, float* z, const char* deviceName,
MCPTrackerHandle_t ulTrackerHandle) = 0;
A pointer to IMCPRenderSettings
can be obtained using the following code.
xxxxxxxxxx
MocapApi::IMCPRenderSettings * mcpRenderSettings = nullptr;
MocapApi::MCPGetGenericInterface(MocapApi::IMCPRenderSettings_Version,
reinterpret_cast<void **>(&mcpRenderSettings)
You need to create a RenderSettings
entity using CreateRenderSettings
, the reference code is as follows:
xxxxxxxxxx
MocapApi::MCPRenderSettingsHandle_t mcpRenderSettingsHandle = 0;
mcpRenderSettings->CreateRenderSettings(&mcpRenderSettingsHandle);
When a RenderSettings
is no longer needed the following code can be used:
xxxxxxxxxx
mcpRenderSettings->DestroyRenderSettings(mcpRenderSettingsHandle);
You can also use GetPreDefRenderSettings
to get some predefined RenderSettings entities, but not to destroy them using DestroyRenderSettings
.
xxxxxxxxxx
virtual EMCPError CreateRenderSettings(MCPRenderSettingsHandle_t * pRenderSettings) = 0;
Create a RenderSettings
entity and manually call DestroyRenderSettings
when the entity is no longer needed. pRenderSettings
returns a handle to the RenderSettings
entity.
xxxxxxxxxx
virtual EMCPError GetPreDefRenderSettings(EMCPPreDefinedRenderSettings preDefinedRenderSettings,
MCPRenderSettingsHandle_t * pRenderSettings) = 0;
xxxxxxxxxx
virtual EMCPError SetUpVector(EMCPUpVector upVector, int sign,
MCPRenderSettingsHandle_t renderSettings) = 0;
xxxxxxxxxx
virtual EMCPError GetUpVector(EMCPUpVector * pUpVector, int * sign,
MCPRenderSettingsHandle_t renderSettings) = 0;
xxxxxxxxxx
virtual EMCPError SetFrontVector(EMCPFrontVector frontVector, int sign,
MCPRenderSettingsHandle_t renderSettings) = 0;
xxxxxxxxxx
virtual EMCPError GetFrontVector(EMCPFrontVector * pFrontVector, int * sign,
MCPRenderSettingsHandle_t renderSettings) = 0;
xxxxxxxxxx
virtual EMCPError SetCoordSystem(EMCPCoordSystem coordSystem,
MCPRenderSettingsHandle_t renderSettings) = 0;
xxxxxxxxxx
virtual EMCPError GetCoordSystem(EMCPCoordSystem * pCoordSystem,
MCPRenderSettingsHandle_t renderSettings) = 0;
xxxxxxxxxx
virtual EMCPError SetRotatingDirection(EMCPRotatingDirection rotatingDirection,
MCPRenderSettingsHandle_t renderSettings) = 0;
xxxxxxxxxx
virtual EMCPError GetRotatingDirection(EMCPRotatingDirection * pRotatingDirection,
MCPRenderSettingsHandle_t renderSettings) = 0;
xxxxxxxxxx
virtual EMCPError SetUnit(EMCPUnit mcpUnit,
MCPRenderSettingsHandle_t renderSettings) = 0;
xxxxxxxxxx
virtual EMCPError GetUnit(EMCPUnit * mcpUnit,
MCPRenderSettingsHandle_t renderSettings) = 0;
xxxxxxxxxx
virtual EMCPError DestroyRenderSettings(MCPRenderSettingsHandle_t renderSettings) = 0;
After destroying a RenderSettings
entity, the entity represented by renderSettings is no longer available.
Use the following code to get a pointer to IMCPSettings
:
xxxxxxxxxx
MocapApi::IMCPSettings * mcpSettings = nullptr;
MocapApi::MCPGetGenericInterface(MocapApi::IMCPSettings_Version,
reinterpret_cast<void **>(&mcpSettings)
xxxxxxxxxx
typedef uint64_t MCPSettingsHandle_t;
A Settings entity needs to be created using CreateSettings
, with the following reference code:
xxxxxxxxxx
MocapApi::MCPSettingsHandle_t mcpSettingsHandle = 0;
mcpSettings->CreateSettings(&mcpSettingsHandle);
Once the Settings entity is no longer needed, you need to destroy it. You can use the following reference code:
xxxxxxxxxx
mcpSettings->DestroySettings(mcpSettingsHandle);
xxxxxxxxxx
virtual EMCPError CreateSettings(MCPSettingsHandle_t * pSettingsHandle) = 0;
Create a Settings entity and manually call DestroySettings
when the entity is no longer needed pSettingsHandle
returns a handle to the Settings entity.
xxxxxxxxxx
virtual EMCPError DestroySettings(MCPSettingsHandle_t ulSettingsHandle) = 0;
After destroying a Settings entity, the entity represented by ulSettingsSettings
is no longer available.
xxxxxxxxxx
virtual EMCPError SetSettingsUDP(uint16_t localPort,
MCPSettingsHandle_t ulSettingsHandle) = 0;
When connect with UDP protocol, set the IP and Port of Server:
xxxxxxxxxx
virtual EMCPError SetSettingsUDPServer(const char* serverIp, uint16_t serverPort,
MCPSettingsHandle_t ulSettingsHandle) = 0;
xxxxxxxxxx
virtual EMCPError SetSettingsTCP(const char * serverIp, uint16_t serverPort,
MCPSettingsHandle_t ulSettingsHandle) = 0;
xxxxxxxxxx
virtual EMCPError SetSettingsBvhRotation(EMCPBvhRotation bvhRotation,
MCPSettingsHandle_t ulSettingsHandle) = 0;
xxxxxxxxxx
virtual EMCPError SetSettingsBvhTransformation(EMCPBvhTransformation bvhTransformation,
MCPSettingsHandle_t ulSettingsHandle) = 0;
xxxxxxxxxx
virtual EMCPError SetSettingsBvhData(EMCPBvhData bvhData,
MCPSettingsHandle_t ulSettingsHandle) = 0;
xxxxxxxxxx
virtual EMCPError SetSettingsCalcData(MCPSettingsHandle_t ulSettingsHandle) = 0;
MocapApi Command interface, it will be used to send command to the Server and receive the command reply from the Server. The command handle is MCPCommandHandle_t
.
Create a command object based on the command flag.
xxxxxxxxxx
virtual EMCPError CreateCommand(uint32_t cmd, MCPCommandHandle_t* handle_) = 0;
Set additional command flags
xxxxxxxxxx
virtual EMCPError SetCommandExtraFlags(uint32_t extraFlags, MCPCommandHandle_t handle_) = 0;
For example: do StopCapture
:
xxxxxxxxxx
commandInterface->CreateCommand(CommandStopCapture, &command);
commandInterface->SetCommandExtraFlags(StopCatpureExtraFlag_SensorsModulesHibernate, command);
Set command parameters
xxxxxxxxxx
virtual EMCPError SetCommandExtraLong(uint32_t extraLongIndex, intptr_t extraLong,
MCPCommandHandle_t handle_) = 0;
For example: do StartCapture
:
xxxxxxxxxx
commandInterface->CreateCommand(CommandStartCapture, &command);
commandInterface->SetCommandExtraLong(CommandExtraLong_DeviceRadio, 2471, command);
Gets the error message returned by the Server
xxxxxxxxxx
virtual EMCPError GetCommandResultMessage(const char ** pMsg, MCPCommandHandle_t handle_) = 0;
Gets the error code returned by the Server
xxxxxxxxxx
virtual EMCPError GetCommandResultCode(uint32_t *pResCode, MCPCommandHandle_t handle_) = 0;
Get the command execution progress returned by the Server
xxxxxxxxxx
virtual EMCPError GetCommandProgress(uint32_t progress, intptr_t extra, MCPCommandHandle_t handle_) =0;
xxxxxxxxxx
virtual EMCPError DestroyCommand(MCPCommandHandle_t handle_) = 0;
The calibration progress interface, the corresponding Handle is MCPCalibrateMotionProgressHandle_t
. It can be obtained by IMCPCommand::GetCommandProgress(CommandProgress_CalibrateMotion, ...)
The number of calibration positions required for this calibration.
xxxxxxxxxx
virtual EMCPError GetCalibrateMotionProgressCountOfSupportPoses(uint32_t * pCount,
MCPCalibrateMotionProgressHandle_t handle_) = 0;
Gets the calibration pose name for this calibration.
xxxxxxxxxx
virtual EMCPError GetCalibrateMotionProgressNameOfSupportPose(char* name, uint32_t* pLenOfName, uint32_t index, MCPCalibrateMotionProgressHandle_t handle_) = 0;
Gets the calibration phase of the specified calibration position.
xxxxxxxxxx
virtual EMCPError GetCalibrateMotionProgressStepOfPose(uint32_t* pStep,
const char*name, MCPCalibrateMotionProgressHandle_t handle_) = 0;
Gets the countdown to the specified calibration position.
xxxxxxxxxx
virtual EMCPError GetCalibrateMotionProgressCountdownOfPose(uint32_t* pCountdown,
const char*name, MCPCalibrateMotionProgressHandle_t handle_) = 0;
Gets the calibration progress of the specified calibration position.
xxxxxxxxxx
virtual EMCPError GetCalibrateMotionProgressProgressOfPose(uint32_t* pProgress,
const char*name, MCPCalibrateMotionProgressHandle_t handle_) = 0;
Gets the current calibration position and calibration phase
xxxxxxxxxx
virtual EMCPError GetCalibrateMotionProgressStepOfCurrentPose(uint32_t * pStep,
char* name, uint32_t * pLenOfName, MCPCalibrateMotionProgressHandle_t handle_) = 0;
Gets the current calibration position and calibration countdown.
xxxxxxxxxx
virtual EMCPError GetCalibrateMotionProgressCountdownOfCurrentPose(uint32_t* pCountdown,
char* name, uint32_t* pLenOfName, MCPCalibrateMotionProgressHandle_t handle_) = 0;
Get the current calibration execution and calibration progress.
xxxxxxxxxx
virtual EMCPError GetCalibrateMotionProgressProgressOfCurrentPose(uint32_t* pProgress,
char* name, uint32_t* pLenOfName, MCPCalibrateMotionProgressHandle_t handle_) = 0;
xxxxxxxxxx
enum EMCPEventType
{
MCPEvent_None,
MCPEvent_AvatarUpdated,
MCPEvent_RigidBodyUpdated,
MCPEvent_Error,
MCPEvent_SensorModulesUpdated,
MCPEvent_TrackerUpdated,
MCPEvent_CommandReply,
};
xxxxxxxxxx
enum EMCPBvhRotation
{
BvhRotation_XYZ,
BvhRotation_XZY,
BvhRotation_YXZ,
BvhRotation_YZX,
BvhRotation_ZXY,
BvhRotation_ZYX,
};
xxxxxxxxxx
enum EMCPBvhData
{
BvhDataType_String,
BvhDataType_BinaryWithOldFrameHeader,
BvhDataType_Binary,
BvhDataType_Mask_LegacyHumanHierarchy,
};
xxxxxxxxxx
enum EMCPBvhTransformation
{
BvhTransformation_Disable,
BvhTransformation_Enable,
};
xxxxxxxxxx
enum EMCPUpVector
{
UpVector_XAxis = 1,
UpVector_YAxis = 2,
UpVector_ZAxis = 3
};
xxxxxxxxxx
enum EMCPFrontVector
{
FrontVector_ParityEven = 1,
FrontVector_ParityOdd = 2
};
xxxxxxxxxx
enum EMCPCoordSystem
{
CoordSystem_RightHanded,
CoordSystem_LeftHanded
};
xxxxxxxxxx
enum EMCPRotatingDirection
{
RotatingDirection_Clockwise,
RotatingDirection_CounterClockwise,
};
xxxxxxxxxx
enum EMCPPreDefinedRenderSettings
{
PreDefinedRenderSettings_Default,
PreDefinedRenderSettings_UnrealEngine,
PreDefinedRenderSettings_Unity3D,
PreDefinedRenderSettings_Count,
};
xxxxxxxxxx
enum EMCPUnit
{
Unit_Centimeter,
Uint_Meter,
};
xxxxxxxxxx
enum EMCPReplay
{
MCPReplay_Response,
MCPReplay_Running,
MCPReplay_Result,
};
xxxxxxxxxx
enum EMCPCommand
{
CommandStartCapture,
CommandStopCapture,
CommandZeroPosition,
CommandCalibrateMotion,
CommandStartRecored,
CommandStopRecored,
CommandResumeOriginalPosture,
};
xxxxxxxxxx
enum EMCPCommandStopCatpureExtraFlag
{
StopCatpureExtraFlag_SensorsModulesPowerOff,
StopCatpureExtraFlag_SensorsModulesHibernate,
};
xxxxxxxxxx
enum EMCPCommandExtraLong
{
CommandExtraLong_DeviceRadio,
CommandExtraLong_AvatarName,
};
xxxxxxxxxx
enum EMCPCommandProgress
{
CommandProgress_CalibrateMotion,
};
xxxxxxxxxx
enum EMCPCalibrateMotionProgressStep
{
CalibrateMotionProgressStep_Prepare,
CalibrateMotionProgressStep_Countdown,
CalibrateMotionProgressStep_Progress,
};
xxxxxxxxxx
struct MCPEvent_t
{
uint32_t size;
EMCPEventType eventType;
double fTimestamp;
MCPEventData_t eventData;
};
xxxxxxxxxx
union MCPEventData_t
{
MCPEvent_Reserved_t reserved;
MCPEvent_MotionData_t motionData;
MCPEvent_SystemError_t systemError;
MCPEvent_SensorModuleData_t sensorModuleData;
MCPEvent_TrackerData_t trackerData;
MCPEvent_CommandRespond_t commandRespond;
};
xxxxxxxxxx
struct MCPEvent_Reserved_t
{
uint64_t reserved0;
uint64_t reserved1;
uint64_t reserved2;
uint64_t reserved3;
uint64_t reserved4;
uint64_t reserved5;
};
xxxxxxxxxx
struct MCPEvent_MotionData_t
{
MCPAvatarHandle_t avatarHandle;
};
xxxxxxxxxx
struct MCPEvent_SystemError_t
{
EMCPError error;
};
xxxxxxxxxx
struct MCPEvent_SensorModuleData_t
{
MCPSensorModuleHandle_t _sensorModuleHandle;
};
xxxxxxxxxx
struct MCPEvent_TrackerData_t
{
MCPTrackerHandle_t _trackerHandle;
};
xxxxxxxxxx
struct MCPEvent_CommandRespond_t
{
MCPCommandHandle_t _commandHandle;
EMCPReplay _replay;
};