-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathTrackerInfo.java
More file actions
169 lines (161 loc) · 9.67 KB
/
TrackerInfo.java
File metadata and controls
169 lines (161 loc) · 9.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// automatically generated by the FlatBuffers compiler, do not modify
package solarxr_protocol.data_feed.tracker;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
/**
* Static description of a tracker
*/
@SuppressWarnings("unused")
public final class TrackerInfo extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); }
public static TrackerInfo getRootAsTrackerInfo(ByteBuffer _bb) { return getRootAsTrackerInfo(_bb, new TrackerInfo()); }
public static TrackerInfo getRootAsTrackerInfo(ByteBuffer _bb, TrackerInfo obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public TrackerInfo __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int imuType() { int o = __offset(4); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
/**
* The user-assigned role of the tracker.
*/
public int bodyPart() { int o = __offset(6); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; }
/**
* average samples per second
*/
public solarxr_protocol.datatypes.HzF32 pollRate() { return pollRate(new solarxr_protocol.datatypes.HzF32()); }
public solarxr_protocol.datatypes.HzF32 pollRate(solarxr_protocol.datatypes.HzF32 obj) { int o = __offset(8); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
/**
* The orientation of the tracker when mounted on the body
*/
public solarxr_protocol.datatypes.math.Quat mountingOrientation() { return mountingOrientation(new solarxr_protocol.datatypes.math.Quat()); }
public solarxr_protocol.datatypes.math.Quat mountingOrientation(solarxr_protocol.datatypes.math.Quat obj) { int o = __offset(10); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
/**
* Should the tracker's settings be editable by the user
*/
public boolean editable() { int o = __offset(12); return o != 0 ? 0!=bb.get(o + bb_pos) : false; }
/**
* Indicates if the tracker is computed (solved position and rotation)
*/
public boolean isComputed() { int o = __offset(14); return o != 0 ? 0!=bb.get(o + bb_pos) : false; }
/**
* Indicates if the tracker is using an IMU for its tracking data
*/
public boolean isImu() { int o = __offset(16); return o != 0 ? 0!=bb.get(o + bb_pos) : false; }
/**
* A human-friendly name to display as the name of the tracker.
*/
public String displayName() { int o = __offset(18); return o != 0 ? __string(o + bb_pos) : null; }
public ByteBuffer displayNameAsByteBuffer() { return __vector_as_bytebuffer(18, 1); }
public ByteBuffer displayNameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 18, 1); }
/**
* name to display as the name of the tracker set by the user
*/
public String customName() { int o = __offset(20); return o != 0 ? __string(o + bb_pos) : null; }
public ByteBuffer customNameAsByteBuffer() { return __vector_as_bytebuffer(20, 1); }
public ByteBuffer customNameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 20, 1); }
/**
* Whether to allow yaw drift compensation for this tracker or not.
*/
public boolean allowDriftCompensation() { int o = __offset(22); return o != 0 ? 0!=bb.get(o + bb_pos) : false; }
/**
* Mounting Reset orientation overrides the current `mounting_orientation` of
* the tracker, this orientation is not saved and needs to be calculated
* each time the server is ran
*/
public solarxr_protocol.datatypes.math.Quat mountingResetOrientation() { return mountingResetOrientation(new solarxr_protocol.datatypes.math.Quat()); }
public solarxr_protocol.datatypes.math.Quat mountingResetOrientation(solarxr_protocol.datatypes.math.Quat obj) { int o = __offset(24); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
/**
* Indicates if the tracker is actually an HMD
*/
public boolean isHmd() { int o = __offset(26); return o != 0 ? 0!=bb.get(o + bb_pos) : false; }
public int magnetometer() { int o = __offset(28); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; }
/**
* Indicates what type of data the tracker sends (note: it always ends up being rotation in the end)
*/
public int dataSupport() { int o = __offset(30); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; }
public int restCalibrationStatus() { int o = __offset(32); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; }
public static void startTrackerInfo(FlatBufferBuilder builder) { builder.startTable(15); }
public static void addImuType(FlatBufferBuilder builder, int imuType) { builder.addShort(0, (short) imuType, (short) 0); }
public static void addBodyPart(FlatBufferBuilder builder, int bodyPart) { builder.addByte(1, (byte) bodyPart, (byte) 0); }
public static void addPollRate(FlatBufferBuilder builder, int pollRateOffset) { builder.addStruct(2, pollRateOffset, 0); }
public static void addMountingOrientation(FlatBufferBuilder builder, int mountingOrientationOffset) { builder.addStruct(3, mountingOrientationOffset, 0); }
public static void addEditable(FlatBufferBuilder builder, boolean editable) { builder.addBoolean(4, editable, false); }
public static void addIsComputed(FlatBufferBuilder builder, boolean isComputed) { builder.addBoolean(5, isComputed, false); }
public static void addIsImu(FlatBufferBuilder builder, boolean isImu) { builder.addBoolean(6, isImu, false); }
public static void addDisplayName(FlatBufferBuilder builder, int displayNameOffset) { builder.addOffset(7, displayNameOffset, 0); }
public static void addCustomName(FlatBufferBuilder builder, int customNameOffset) { builder.addOffset(8, customNameOffset, 0); }
public static void addAllowDriftCompensation(FlatBufferBuilder builder, boolean allowDriftCompensation) { builder.addBoolean(9, allowDriftCompensation, false); }
public static void addMountingResetOrientation(FlatBufferBuilder builder, int mountingResetOrientationOffset) { builder.addStruct(10, mountingResetOrientationOffset, 0); }
public static void addIsHmd(FlatBufferBuilder builder, boolean isHmd) { builder.addBoolean(11, isHmd, false); }
public static void addMagnetometer(FlatBufferBuilder builder, int magnetometer) { builder.addByte(12, (byte) magnetometer, (byte) 0); }
public static void addDataSupport(FlatBufferBuilder builder, int dataSupport) { builder.addByte(13, (byte) dataSupport, (byte) 0); }
public static void addRestCalibrationStatus(FlatBufferBuilder builder, int restCalibrationStatus) { builder.addByte(14, (byte) restCalibrationStatus, (byte) 0); }
public static int endTrackerInfo(FlatBufferBuilder builder) {
int o = builder.endTable();
return o;
}
public static final class Vector extends BaseVector {
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
public TrackerInfo get(int j) { return get(new TrackerInfo(), j); }
public TrackerInfo get(TrackerInfo obj, int j) { return obj.__assign(__indirect(__element(j), bb), bb); }
}
public TrackerInfoT unpack() {
TrackerInfoT _o = new TrackerInfoT();
unpackTo(_o);
return _o;
}
public void unpackTo(TrackerInfoT _o) {
int _oImuType = imuType();
_o.setImuType(_oImuType);
int _oBodyPart = bodyPart();
_o.setBodyPart(_oBodyPart);
if (pollRate() != null) pollRate().unpackTo(_o.getPollRate());
else _o.setPollRate(null);
if (mountingOrientation() != null) mountingOrientation().unpackTo(_o.getMountingOrientation());
else _o.setMountingOrientation(null);
boolean _oEditable = editable();
_o.setEditable(_oEditable);
boolean _oIsComputed = isComputed();
_o.setIsComputed(_oIsComputed);
boolean _oIsImu = isImu();
_o.setIsImu(_oIsImu);
String _oDisplayName = displayName();
_o.setDisplayName(_oDisplayName);
String _oCustomName = customName();
_o.setCustomName(_oCustomName);
boolean _oAllowDriftCompensation = allowDriftCompensation();
_o.setAllowDriftCompensation(_oAllowDriftCompensation);
if (mountingResetOrientation() != null) mountingResetOrientation().unpackTo(_o.getMountingResetOrientation());
else _o.setMountingResetOrientation(null);
boolean _oIsHmd = isHmd();
_o.setIsHmd(_oIsHmd);
int _oMagnetometer = magnetometer();
_o.setMagnetometer(_oMagnetometer);
int _oDataSupport = dataSupport();
_o.setDataSupport(_oDataSupport);
int _oRestCalibrationStatus = restCalibrationStatus();
_o.setRestCalibrationStatus(_oRestCalibrationStatus);
}
public static int pack(FlatBufferBuilder builder, TrackerInfoT _o) {
if (_o == null) return 0;
int _displayName = _o.getDisplayName() == null ? 0 : builder.createString(_o.getDisplayName());
int _customName = _o.getCustomName() == null ? 0 : builder.createString(_o.getCustomName());
startTrackerInfo(builder);
addImuType(builder, _o.getImuType());
addBodyPart(builder, _o.getBodyPart());
addPollRate(builder, solarxr_protocol.datatypes.HzF32.pack(builder, _o.getPollRate()));
addMountingOrientation(builder, solarxr_protocol.datatypes.math.Quat.pack(builder, _o.getMountingOrientation()));
addEditable(builder, _o.getEditable());
addIsComputed(builder, _o.getIsComputed());
addIsImu(builder, _o.getIsImu());
addDisplayName(builder, _displayName);
addCustomName(builder, _customName);
addAllowDriftCompensation(builder, _o.getAllowDriftCompensation());
addMountingResetOrientation(builder, solarxr_protocol.datatypes.math.Quat.pack(builder, _o.getMountingResetOrientation()));
addIsHmd(builder, _o.getIsHmd());
addMagnetometer(builder, _o.getMagnetometer());
addDataSupport(builder, _o.getDataSupport());
addRestCalibrationStatus(builder, _o.getRestCalibrationStatus());
return endTrackerInfo(builder);
}
}