Esempio n. 1
0
    void Start()
    {
        //The render scale. Higher numbers = better quality, but trades performance
        m_RenderScale          = 1.5f;
        VRSettings.renderScale = m_RenderScale;
        // Debug.Log("WORKING");



        PNUtils.LoadSkeletonReference(bones, rootTrans, "Robot_", 0);



        _connection = NeuronDataReader.BRConnectTo(ServerIP, int.Parse(ServerPort));



        // Socket status handle
        _OnSocketStatusChanged = new SocketStatusChanged(OnSocketStatusChanged);
        NeuronDataReader.BRRegisterSocketStatusCallback(IntPtr.Zero, _OnSocketStatusChanged);
        // Data receive handle
        _OnFrameDataReceived = new FrameDataReceived(OnFrameDataReceived);
        NeuronDataReader.BRRegisterFrameDataCallback(IntPtr.Zero, _OnFrameDataReceived);
        // Data receive handle
        _OnMatchedRigidBodyDataReceived = new MatchedRigidBodyDataReceived(OnMatchedRigidBodyDataReceived);
        NeuronDataReader.BRRegisterMatchedDataCallback(IntPtr.Zero, _OnMatchedRigidBodyDataReceived);
    }
Esempio n. 2
0
        public MainWindow()
        {
            InitializeComponent();

            socketStatusChangeded = new SocketStatusChanged(onSocketStatusChangeded);
            PN_DataReader.BRRegisterConnectionStatusCallback(IntPtr.Zero, socketStatusChangeded);

            frameDataReceived = new FrameDataReceived(onFrameDataReceived);
            PN_DataReader.BRRegisterFrameDataCallback(IntPtr.Zero, frameDataReceived);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _DataReceived = new FrameDataReceived(bvhDataReceived);
            NeuronDataReader.BRRegisterFrameDataCallback(IntPtr.Zero, _DataReceived);

            _CmdDataReceived = new CommandDataReceived(cmdDataReceived);
            NeuronDataReader.BRRegisterCommandDataCallback(IntPtr.Zero, _CmdDataReceived);

            _SocketStatusChanged = new SocketStatusChanged(socketStatusChanged);
            NeuronDataReader.BRRegisterSocketStatusCallback(IntPtr.Zero, _SocketStatusChanged);
        }
Esempio n. 4
0
    void Start()
    {
        PNUtils.LoadSkeletonReference(bones, rootTrans, "Robot_", 0);


        // Socket status handle
        _OnSocketStatusChanged = new SocketStatusChanged(OnSocketStatusChanged);
        PN_DataReader.BRRegisterConnectionStatusCallback(IntPtr.Zero, _OnSocketStatusChanged);
        // Data receive handle
        _OnFrameDataReceived = new FrameDataReceived(OnFrameDataReceived);
        PN_DataReader.BRRegisterFrameDataCallback(IntPtr.Zero, _OnFrameDataReceived);
    }
        private void Window_Loaded(object sender, RoutedEventArgs e)    //在程序加载期间做一些初始化操作
        {
            _DataReceived = new FrameDataReceived(bvhDataReceived);
            NeuronDataReader.BRRegisterFrameDataCallback(IntPtr.Zero, _DataReceived);

            _CalcDataReceived = new FrameDataReceived(calcDataReceived);
            NeuronDataReader.BRRegisterCalculationDataCallback(IntPtr.Zero, _CalcDataReceived);

            _SocketStatusChanged = new SocketStatusChanged(socketStatusChanged);
            NeuronDataReader.BRRegisterSocketStatusCallback(IntPtr.Zero, _SocketStatusChanged);

            // 更新接收BVH数据时的BoneID界面UI
            {
                cbBoneID.Items.Clear();
                for (int i = 0; i < 59; i++)
                {
                    string Bone = "Bone";
                    Bone += i.ToString();
                    Bone += "\n";
                    cbBoneID.Items.Add(Bone);
                }
                cbBoneID.SelectedIndex = 0;
            }

            // 更新接收Calc数据时的BoneID界面UI
            {
                cbBoneID2.Items.Clear();
                for (int i = 0; i < 21; i++)
                {
                    string Bone = "Bone";
                    Bone += i.ToString();
                    Bone += "\n";
                    cbBoneID2.Items.Add(Bone);
                }
                cbBoneID2.SelectedIndex = 0;
            }
        }
Esempio n. 6
0
 public static void BRRegisterFrameDataCallback(IntPtr customedObj, FrameDataReceived handle)
 {
     frameDataReceivedCallback = handle;
 }
 public static extern void BRRegisterFrameDataCallback(IntPtr customedObj, FrameDataReceived handle);
 public static extern void BRRegisterCalculationDataCallback(IntPtr customedObj, FrameDataReceived handle);
        private void OnNewFrame(Object sender, NewFrameEventArgs eventArgs)
        {
            var frameDataEventArgs = new FrameDataEventArgs(FrameData.FromFrameBitmap(eventArgs.Frame));

            FrameDataReceived?.Invoke(this, frameDataEventArgs);
        }