You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
964 B

// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2017 Intel Corporation. All Rights Reserved.
namespace Intel.RealSense
{
using System;
using System.Runtime.InteropServices;
using Intel.RealSense;
public class MotionFrame : Frame
{
public MotionFrame(IntPtr ptr)
: base(ptr)
{
}
public Math.Vector MotionData
{
get
{
Math.Vector xyz;
CopyTo(out xyz);
return xyz;
}
}
public void CopyTo(float[] data)
{
Marshal.Copy(Data, data, 0, 3);
}
public void CopyTo<T>(out T xyz)
where T : struct
{
xyz = (T)Marshal.PtrToStructure(Data, typeof(T));
}
public void CopyTo<T>(T xyz)
where T : class
{
Marshal.PtrToStructure(Data, xyz);
}
}
}