You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-3Lines changed: 34 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,16 +22,47 @@ Open the Package Manager Window, click on the `+` dropdown, and [choose `Add pac
22
22
23
23
### Option 2 - Modify Project Package Manifest
24
24
25
+
This option is preferred if this package will be a dependency of another package.
26
+
25
27
Edit `<your project folder>/Packages/manifest.json` and [add the following to your dependencies section](https://docs.unity3d.com/2020.3/Documentation/Manual/upm-git.html):
The advantage of this approach is that it will allow you to specify this package as a dependency of another package.
30
-
31
31
### (Future) Option 3 - Using OpenUPM
32
32
33
33
TODO - https://openupm.com/docs/
34
34
35
35
## Using LSL4Unity
36
36
37
-
The easiest way is to use the Package Manager window, select the LSL4Unity package, and choose to install one or more Samples. Inspect the Samples to learn more.
37
+
The easiest way is to use the Package Manager window, select the LSL4Unity package, and choose to Import one or more of the Samples.
38
+
39
+
The samples appear in `Assets/labstreaminglayer for Unity/1.16.0/{sample name}`. Open the sample's scene.
40
+
41
+
### Simple Inlet Scale Object
42
+
43
+
This scene uses LSL.cs only, and not any of the Utilitis or helpers that come with LSL4Unity. Thus it demonstrates the minimum required steps to resolve, open, and pull data from an LSL Inlet in Unity.
44
+
45
+
You will need a separate process running an LSL outlet with at least 3 float channels. In an active Python environment with [`pylsl`](https://github.com/labstreaminglayer/liblsl-Python) installed, run `python -m pylsl.examples.SendDataAdvanced`.
46
+
47
+
The cylinder will update its scale according to the data coming in from the found stream.
48
+
49
+
### Simple Physics Event Outlet
50
+
51
+
This scene uses LSL.cs only, and shows the minimal amount of code to setup a Markers stream and send events.
52
+
53
+
A sphere oscillates back and forth. Whenever it enters or exits the collider of a nearby cube, an event is transmitted.
54
+
55
+
Note that this sample is designed to send out physics events (collisions) and thus the events are timestamped when the collision is detected in code.
56
+
57
+
If you wanted to instead timestamp stimulus events then it would be better to send out the Marker on `WaitForEndOfFrame`. There is an example of this in the Complex Sample scene.
58
+
59
+
### Complex Outlet Inlet Event
60
+
61
+
A capsule continuously streams its pose over an outlet. Occassionally (every 2 seconds by default), the position is reset and new velocities are applied to the capsule.
62
+
63
+
A cube has its pose set (+ a static offset) by the values coming in from an inlet, the very same stream that the capsule is sending out.
64
+
65
+
Thus the cube should move the same as the capsule, except delayed by the capsule outlet -> cube inlet LSL transmission.
66
+
67
+
A plane changes its colours occassionally (every ~3.4 seconds). The colour change events also stream out a marker string of the new colour.
68
+
The marker is sent out using WaitForEndOfFrame, so its timestamp should be as close as possible to the actual colour change on-screen.
0 commit comments