SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
user.h
Go to the documentation of this file.
1/*****************************************************************************************
2 * SGCT *
3 * Simple Graphics Cluster Toolkit *
4 * *
5 * Copyright (c) 2012-2026 *
6 * For conditions of distribution and use, see copyright notice in LICENSE.md *
7 ****************************************************************************************/
8
9#ifndef __SGCT__USER__H__
10#define __SGCT__USER__H__
11
12#include <sgct/sgctexports.h>
13
14#include <sgct/math.h>
15#include <string>
16
17namespace sgct {
18
19namespace config { struct User; }
20
24class SGCT_EXPORT User {
25public:
29 User(const config::User& user);
30
34 void setPos(vec3 pos);
35
43 void setHeadTracker(std::string trackerName, std::string deviceName);
44
50 void setTransform(mat4 transform);
51
60 void setOrientation(float xRot, float yRot, float zRot);
61
66
71
75 const std::string& name() const;
76
77 const vec3& posMono() const;
78 const vec3& posLeftEye() const;
79 const vec3& posRightEye() const;
80
81 float eyeSeparation() const;
82 const std::string& headTrackerName() const;
83 const std::string& headTrackerDeviceName() const;
84
88 bool isTracked() const;
89
90private:
95 void updateEyeSeparation();
96
101 void updateEyeTransform();
102
103 const std::string _name;
104 float _eyeSeparation;
105
106 vec3 _posMono = vec3{ 0.f, 0.f, 0.f };
107 vec3 _posLeftEye = vec3{ 0.f, 0.f, 0.f };
108 vec3 _posRightEye = vec3{ 0.f, 0.f, 0.f };
109
110 mat4 _transform = mat4(1.0);
111
112 std::string _headTrackerDeviceName;
113 std::string _headTrackerName;
114};
115
116} // namespace sgct
117
118#endif // __SGCT__USER__H__
void setOrientation(float xRot, float yRot, float zRot)
Set the user's head orientation using euler angles.
const vec3 & posRightEye() const
void setEyeSeparation(float eyeSeparation)
Changes the interocular distance and recalculates the user's eye positions.
void setOrientation(quat q)
Set the user's head orientation using a quaternion.
const std::string & headTrackerName() const
void setHeadTracker(std::string trackerName, std::string deviceName)
Set if the user's head position & orientation should be managed by a VRPN tracking device.
User(const config::User &user)
Default contructor.
const vec3 & posLeftEye() const
const vec3 & posMono() const
void setTransform(mat4 transform)
Set the user's head transform matrix.
void setPos(vec3 pos)
Sets user's head position.
const std::string & name() const
Get the users name.
float eyeSeparation() const
bool isTracked() const
const std::string & headTrackerDeviceName() const
Definition clustermanager.h:22
Definition actions.h:16
Definition config.h:25
Definition math.h:89
Definition math.h:77
Definition math.h:56