public Vector3 AddGaze(float x, float y, float z) { gaze3D.x = xavg.AddSample(x); gaze3D.y = yavg.AddSample(y); gaze3D.z = zavg.AddSample(z); return(gaze3D); }
public Vector2 AddGaze(float x, float y, int eyeID) { // print ("adding gaze : " + x + " , " + y + "for the eye : " + eyeID); gaze2D.x = xavg.AddSample(x); gaze2D.y = yavg.AddSample(y); return(gaze2D); }
protected override void OnUpdate(float timeStep) { if (this.menuRoot == null) { return; } var headPosition = this.cameraNode.WorldPosition; var rotation = this.cameraNode.Rotation; // Scale / reposition if something is in front of camera. var distance = 1.0f; var ray = this.camera.GetScreenRay(0.5f, 0.5f); var result = this.octree.RaycastSingle(ray, RayQueryLevel.Triangle, 1.0f, DrawableFlags.Geometry, 0x70000000); if (result.HasValue && result.Value.Distance < distance) { distance = result.Value.Distance; } this.menuRoot.SetScale(distance); // Set Position/Rotation averageLocation.AddSample(headPosition + (rotation * new Vector3(0, 0, distance))); this.menuRoot.SetWorldPosition(averageLocation.Average); this.menuRoot.SetWorldRotation(rotation); }
public Vector3 AddCursorPos(Vector3 newPos) { filteredCursorPos.x = cursorAvgX.AddSample(newPos.x); filteredCursorPos.y = cursorAvgY.AddSample(newPos.y); filteredCursorPos.z = cursorAvgZ.AddSample(newPos.z); return(filteredCursorPos); }
public Vector3 AddGaze(float x, float y, float ts) { gaze.x = xavg.AddSample(x); gaze.y = yavg.AddSample(y); gaze.z = ts; lastTimeStamp = ts; return(new Vector3(gaze.x, gaze.y, lastTimeStamp)); //use z-component of Vector to transfer timestamp }
public void AddGaze(Vector3 position, bool sample) { if (sample) { average.AddSample(position); } else { raw = position; } }
protected override void OnUpdate(float timeStep) { base.OnUpdate(timeStep); var rotation = this.cameraNode.Rotation; var headPosition = this.cameraNode.WorldPosition; averageLocation.AddSample(headPosition + (rotation * new Vector3(0, 0, 1.5f))); this.Node.SetWorldPosition(averageLocation.Average); this.Node.SetWorldRotation(rotation); }
protected override void OnUpdate(float timeStep) { base.OnUpdate(timeStep); if (this.tempPlanetNode == null) { return; } this.distance = Math.Min(Math.Max(Constants.PlanetPlaceMinDistance, this.distance - this.joystickInfo.Y1 * 0.01f), Constants.PlanetPlaceMaxDistance); var rotation = this.cameraNode.Rotation; var headPosition = this.cameraNode.WorldPosition; averageLocation.AddSample(headPosition + (rotation * new Vector3(0, 0, this.distance))); this.tempPlanetNode.SetWorldPosition(averageLocation.Average); this.tempPlanetNode.SetWorldRotation(rotation); }
public Vector2 AddGaze(float x, float y) { gaze.x = xavg.AddSample(x); gaze.y = yavg.AddSample(y); return(gaze); }