mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:42:58 +02:00
latest squatty changes
This commit is contained in:
parent
42e248ef84
commit
ad6bbc7ff6
3 changed files with 24 additions and 8 deletions
|
@ -463,6 +463,7 @@ void MyAvatar::update(float deltaTime) {
|
||||||
if ((acosHead > 0.98f) && !getIsInSittingState() && (sensorHeadPoseDebug.getTranslation().y < -0.5f)) {
|
if ((acosHead > 0.98f) && !getIsInSittingState() && (sensorHeadPoseDebug.getTranslation().y < -0.5f)) {
|
||||||
qCDebug(interfaceapp) << "we are going to sitting state because it looks like we should" << sensorHeadPoseDebug.getTranslation().y;
|
qCDebug(interfaceapp) << "we are going to sitting state because it looks like we should" << sensorHeadPoseDebug.getTranslation().y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// put the average hand azimuth into sensor space.
|
// put the average hand azimuth into sensor space.
|
||||||
// then mix it with head facing direction to determine rotation recenter
|
// then mix it with head facing direction to determine rotation recenter
|
||||||
if (getControllerPoseInAvatarFrame(controller::Action::LEFT_HAND).isValid() && getControllerPoseInAvatarFrame(controller::Action::RIGHT_HAND).isValid()) {
|
if (getControllerPoseInAvatarFrame(controller::Action::LEFT_HAND).isValid() && getControllerPoseInAvatarFrame(controller::Action::RIGHT_HAND).isValid()) {
|
||||||
|
@ -3601,9 +3602,9 @@ glm::vec3 MyAvatar::computeCounterBalance() {
|
||||||
} else if (counterBalancedCg.y < sitSquatThreshold) {
|
} else if (counterBalancedCg.y < sitSquatThreshold) {
|
||||||
// do a height reset
|
// do a height reset
|
||||||
setResetMode(true);
|
setResetMode(true);
|
||||||
_follow.activate(FollowHelper::Vertical);
|
//_follow.activate(FollowHelper::Vertical);
|
||||||
// disable cg behaviour in this case.
|
// disable cg behaviour in this case.
|
||||||
setIsInSittingState(true);
|
//setIsInSittingState(true);
|
||||||
}
|
}
|
||||||
return counterBalancedCg;
|
return counterBalancedCg;
|
||||||
}
|
}
|
||||||
|
@ -4059,12 +4060,6 @@ bool MyAvatar::FollowHelper::shouldActivateHorizontalCG(MyAvatar& myAvatar) cons
|
||||||
bool stepDetected = false;
|
bool stepDetected = false;
|
||||||
float myScale = myAvatar.getAvatarScale();
|
float myScale = myAvatar.getAvatarScale();
|
||||||
|
|
||||||
|
|
||||||
// debug head hips angle
|
|
||||||
//glm::vec3 hipsPos = myAvatar.getAbsoluteDefaultJointTranslationInObjectFrame(myAvatar.getJointIndex("Hips"));
|
|
||||||
//glm::vec3 headHipsBody = currentHeadPose.getTranslation() - hipsPos;
|
|
||||||
//qCDebug(interfaceapp) << "head in sensor space " << withinBaseOfSupport(currentHeadPose);
|
|
||||||
|
|
||||||
if (myAvatar.getIsInWalkingState()) {
|
if (myAvatar.getIsInWalkingState()) {
|
||||||
stepDetected = true;
|
stepDetected = true;
|
||||||
} else if (myAvatar.getIsInSittingState()) {
|
} else if (myAvatar.getIsInSittingState()) {
|
||||||
|
@ -4137,6 +4132,20 @@ void MyAvatar::FollowHelper::prePhysicsUpdate(MyAvatar& myAvatar, const glm::mat
|
||||||
|
|
||||||
if (myAvatar.getHMDLeanRecenterEnabled() &&
|
if (myAvatar.getHMDLeanRecenterEnabled() &&
|
||||||
qApp->getCamera().getMode() != CAMERA_MODE_MIRROR) {
|
qApp->getCamera().getMode() != CAMERA_MODE_MIRROR) {
|
||||||
|
|
||||||
|
// debug head hips angle
|
||||||
|
glm::vec3 headDefaultPos = myAvatar.getAbsoluteDefaultJointTranslationInObjectFrame(myAvatar.getJointIndex("Head"));
|
||||||
|
if (myAvatar.getControllerPoseInAvatarFrame(controller::Action::HEAD).getTranslation().y < (headDefaultPos.y - 0.05f)) {
|
||||||
|
_squatCount++;
|
||||||
|
if ((_squatCount > 300) && !isActive(Vertical) && !isActive(Horizontal)) {
|
||||||
|
activate(Horizontal);
|
||||||
|
activate(Vertical);
|
||||||
|
_squatCount = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_squatCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isActive(Rotation) && (shouldActivateRotation(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) {
|
if (!isActive(Rotation) && (shouldActivateRotation(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) {
|
||||||
activate(Rotation);
|
activate(Rotation);
|
||||||
myAvatar.setHeadControllerFacingMovingAverage(myAvatar.getHeadControllerFacing());
|
myAvatar.setHeadControllerFacingMovingAverage(myAvatar.getHeadControllerFacing());
|
||||||
|
|
|
@ -1727,6 +1727,7 @@ private:
|
||||||
std::atomic<bool> _forceActivateVertical { false };
|
std::atomic<bool> _forceActivateVertical { false };
|
||||||
std::atomic<bool> _forceActivateHorizontal { false };
|
std::atomic<bool> _forceActivateHorizontal { false };
|
||||||
std::atomic<bool> _toggleHipsFollowing { true };
|
std::atomic<bool> _toggleHipsFollowing { true };
|
||||||
|
int _squatCount{ 0 };
|
||||||
};
|
};
|
||||||
FollowHelper _follow;
|
FollowHelper _follow;
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,12 @@ private:
|
||||||
if (!OVR_SUCCESS(ovr_Initialize(&initParams))) {
|
if (!OVR_SUCCESS(ovr_Initialize(&initParams))) {
|
||||||
qCWarning(oculusLog) << "Failed to initialze Oculus SDK" << ovr::getError();
|
qCWarning(oculusLog) << "Failed to initialze Oculus SDK" << ovr::getError();
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
qCWarning(oculusLog) << "successful init of oculus!!!!!!!!";
|
||||||
|
ovrTrackingOrigin fred;
|
||||||
|
fred = ovr_GetTrackingOriginType(session);
|
||||||
|
qCWarning(oculusLog) << (int)fred;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ovrGraphicsLuid luid;
|
ovrGraphicsLuid luid;
|
||||||
|
|
Loading…
Reference in a new issue