//################################################################################################################### /// <summary> /// The start method of an UrhoSharp StereoApplication class. Configure the sockets an launch the connections. /// This must not be overrided, use <see cref="Init"/> instead. /// </summary> protected override async void Start() { base.Start(); // call the inherited method Init(); // display initialisation // create and start the camera socket _fRCamera = new UdpFRCamera(); await _fRCamera.Start(); // create the ray collision socket and bind callback methods for ray hit test _rcSocket = new RayCollisionUdpSocket(); _rcSocket.DepthTestFunction += this.DepthTestFunction; // the socket will call this.DepthTestFunction for a request of ray hit test this.RayHitPositionReceived += _rcSocket.RayHitPositionReceived; // the app will call Socket.RayHitPositionReceived for submit 3D coordinate found // create the display socket and bind the method _socket = new DisplayUdpSocket(); _socket.OnReceivedDisplayCommand += this.OnReceivedDisplayCommand; // the socket will call this.OnReceivedDisplayCommand when it receive a command // connection for all the sockets await _fRCamera.Connect(_ip, _cameraSocketPort); await _rcSocket.Connect(_ip, _rayCollisionSocketPort); await _socket.Connect(_ip, _displaySocketPort); }
static void Main(string[] args) { // Initialize StereoKit StereoKitApp.settings.assetsFolder = "Assets"; if (!StereoKitApp.Initialize("ContextualAssistanceV2", Runtime.MixedReality)) { Environment.Exit(1); } camera = new UdpFRCamera(); _ = camera.Start(); socket = new DisplayUdpSocket(); socket.OnReceivedDisplayCommand += Program.OnReceivedDisplayCommand; _ = camera.Connect("172.22.192.1", "9999"); _ = socket.Connect("172.22.192.1", "9998"); // Core application loop while (StereoKitApp.Step(() => { })) { ; } StereoKitApp.Shutdown(); }
//######################################################################################################## protected override async void Start() { base.Start(); Text3DList = new Text3DAnnotationList(this); socket = new DisplayUdpSocket(); // the socket will call this.OnReceivedDisplayCommand for update the display socket.OnReceivedDisplayCommand += this.OnReceivedDisplayCommand; await TextToSpeech("Connection"); await socket.Connect("192.168.137.1", "9999"); await TextToSpeech("Connected"); }
//######################################################################################################## protected override async void Start() { base.Start(); Text3DList = new Text3DAnnotationList(this); camera = new UdpFRCamera(); await camera.Start(); socket = new DisplayUdpSocket(); socket.OnReceivedDisplayCommand += this.OnReceivedDisplayCommand; await TextToSpeech("Connection"); await camera.Connect("192.168.1.21", "9999"); await socket.Connect("192.168.1.21", "9998"); await TextToSpeech("Connected"); }