Forum Discussion
ckoeber
12 years agoHonored Guest
Reading Sensor data with GLM and OpenGL ...
Hello, So I have my application ported to the rift using the SDK and I can read sensor data fine. It's calculating the sensor data and converting it over to GLM that is giving me problems. I...
jherico
12 years agoAdventurer
There is code in my library to convert the primary Oculus C API math types to their GLM equivalents:
Specifically:
Specifically:
static inline glm::mat4 fromOvr(const ovrMatrix4f & om) {
return glm::transpose(glm::make_mat4(&om.M[0][0]));
}
static inline glm::vec3 fromOvr(const ovrVector3f & ov) {
return glm::make_vec3(&ov.x);
}
static inline glm::uvec2 fromOvr(const ovrSizei & ov) {
return glm::uvec2(ov.h, ov.w);
}
static inline glm::quat fromOvr(const ovrQuatf & oq) {
return glm::make_quat(&oq.x);
}
static glm::mat4 Rift::fromOvr(const ovrPosef & op) {
return glm::mat4_cast(fromOvr(op.Orientation)) * glm::translate(glm::mat4(), Rift::fromOvr(op.Position));
}
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device