public IntPtr RigidBodies; // Pointer to sRigidBodyData[RigidBodyCount] public sRigidBodyData[] MarshalRigidBodies() { sRigidBodyData[] returnArray = new sRigidBodyData[RigidBodyCount]; IntPtr buffer = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(sRigidBodyData)) * RigidBodyCount); for (int i = 0; i < RigidBodyCount; ++i) { returnArray[i] = (sRigidBodyData)Marshal.PtrToStructure(RigidBodies, typeof(sRigidBodyData)); RigidBodies = new IntPtr(RigidBodies.ToInt64() + Marshal.SizeOf(typeof(sRigidBodyData))); } Marshal.FreeCoTaskMem(buffer); return(returnArray); }
public static extern NatNetError NatNet_Frame_Skeleton_GetRigidBody(IntPtr pFrameOfMocapData, Int32 skeletonIndex, Int32 rigidBodyIndex, out sRigidBodyData rigidBodyData);
public static extern NatNetError NatNet_Client_GetPredictedRigidBodyPose(IntPtr client, Int32 rigidBodyIndex, out sRigidBodyData rigidBodyData, double dt);
public NatNetError GetPredictedRigidBodyPose(Int32 rbId, out sRigidBodyData rbData, double dt) { return(NatNetLib.NativeMethods.NatNet_Client_GetPredictedRigidBodyPose(m_clientHandle, rbId, out rbData, dt)); }