mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 04:07:11 +02:00
cleanups
This commit is contained in:
parent
10ddbecdb9
commit
552b69bb1c
4 changed files with 4 additions and 11 deletions
|
@ -1889,6 +1889,7 @@ void MyAvatar::updateOrientation(float deltaTime) {
|
||||||
// these angles will be in radians
|
// these angles will be in radians
|
||||||
// ... so they need to be converted to degrees before we do math...
|
// ... so they need to be converted to degrees before we do math...
|
||||||
glm::vec3 euler = glm::eulerAngles(localOrientation) * DEGREES_PER_RADIAN;
|
glm::vec3 euler = glm::eulerAngles(localOrientation) * DEGREES_PER_RADIAN;
|
||||||
|
|
||||||
Head* head = getHead();
|
Head* head = getHead();
|
||||||
head->setBaseYaw(YAW(euler));
|
head->setBaseYaw(YAW(euler));
|
||||||
head->setBasePitch(PITCH(euler));
|
head->setBasePitch(PITCH(euler));
|
||||||
|
|
|
@ -122,8 +122,7 @@ bool HMDScriptingInterface::getHUDLookAtPosition3D(glm::vec3& result) const {
|
||||||
|
|
||||||
glm::mat4 HMDScriptingInterface::getWorldHMDMatrix() const {
|
glm::mat4 HMDScriptingInterface::getWorldHMDMatrix() const {
|
||||||
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||||
// return myAvatar->getSensorToWorldMatrix() * myAvatar->getHMDSensorMatrix();
|
return myAvatar->getSensorToWorldMatrix() * myAvatar->getHMDSensorMatrix();
|
||||||
return myAvatar->getSensorToWorldMatrix() * myAvatar->getHeadControllerPoseInSensorFrame().getMatrix() * Matrices::Y_180;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 HMDScriptingInterface::getPosition() const {
|
glm::vec3 HMDScriptingInterface::getPosition() const {
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
bool beginFrameRender(uint32_t frameIndex) override;
|
bool beginFrameRender(uint32_t frameIndex) override;
|
||||||
float getTargetFrameRate() const override { return 90; }
|
float getTargetFrameRate() const override { return 90; }
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void updatePresentPose() override;
|
void updatePresentPose() override;
|
||||||
void hmdPresent() override {}
|
void hmdPresent() override {}
|
||||||
|
|
|
@ -286,15 +286,7 @@ bool KinectPlugin::isHandController() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KinectPlugin::isHeadController() const {
|
bool KinectPlugin::isHeadController() const {
|
||||||
bool sensorAvailable = false;
|
return isHandController();
|
||||||
#ifdef HAVE_KINECT
|
|
||||||
if (_kinectSensor) {
|
|
||||||
BOOLEAN sensorIsAvailable = FALSE;
|
|
||||||
HRESULT hr = _kinectSensor->get_IsAvailable(&sensorIsAvailable);
|
|
||||||
sensorAvailable = SUCCEEDED(hr) && (sensorIsAvailable == TRUE);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return _enabled && _initialized && sensorAvailable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue