private void Sample() { int offset = -1; if (rotationAsQuaternion) { var rotation = sampleSource.rotation; sample[++offset] = rotation.x; sample[++offset] = rotation.y; sample[++offset] = rotation.z; sample[++offset] = rotation.w; } if (rotationAsEuler) { var rotation = sampleSource.rotation.eulerAngles; sample[++offset] = rotation.x; sample[++offset] = rotation.y; sample[++offset] = rotation.z; } if (position) { var pos = sampleSource.position; sample[++offset] = pos.x; sample[++offset] = pos.y; sample[++offset] = pos.z; } outlet.PushSample(sample, liblsl.LocalClock()); }
public void FixedUpdate() { if (watch == null) { return; } watch.Stop(); sample[0] = watch.ElapsedMilliseconds; watch.Reset(); watch.Start(); outlet.PushSample(sample); }
public void Write(string marker, double timeStamp = 0) { sample[0] = marker; outlet.PushSample(sample, timeStamp); }