mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 23:14:34 +02:00
Include the radius of the sphere at the avatar's feet.
This commit is contained in:
parent
ca526e0776
commit
3de243b093
1 changed files with 3 additions and 3 deletions
|
@ -294,7 +294,7 @@ void MyAvatar::simulateAttachments(float deltaTime) {
|
||||||
QByteArray MyAvatar::toByteArrayStateful(AvatarDataDetail dataDetail) {
|
QByteArray MyAvatar::toByteArrayStateful(AvatarDataDetail dataDetail) {
|
||||||
CameraMode mode = qApp->getCamera().getMode();
|
CameraMode mode = qApp->getCamera().getMode();
|
||||||
_globalPosition = getPosition();
|
_globalPosition = getPosition();
|
||||||
// This might not be right! Isn't the capsule local offset in avatar space? -HR 5/26/17
|
// This might not be right! Isn't the capsule local offset in avatar space, and don't we need to add the radius to the y as well? -HRS 5/26/17
|
||||||
_globalBoundingBoxDimensions.x = _characterController.getCapsuleRadius();
|
_globalBoundingBoxDimensions.x = _characterController.getCapsuleRadius();
|
||||||
_globalBoundingBoxDimensions.y = _characterController.getCapsuleHalfHeight();
|
_globalBoundingBoxDimensions.y = _characterController.getCapsuleHalfHeight();
|
||||||
_globalBoundingBoxDimensions.z = _characterController.getCapsuleRadius();
|
_globalBoundingBoxDimensions.z = _characterController.getCapsuleRadius();
|
||||||
|
@ -456,7 +456,7 @@ void MyAvatar::update(float deltaTime) {
|
||||||
setAudioAverageLoudness(audio->getAudioAverageInputLoudness());
|
setAudioAverageLoudness(audio->getAudioAverageInputLoudness());
|
||||||
|
|
||||||
glm::vec3 halfBoundingBoxDimensions(_characterController.getCapsuleRadius(), _characterController.getCapsuleHalfHeight(), _characterController.getCapsuleRadius());
|
glm::vec3 halfBoundingBoxDimensions(_characterController.getCapsuleRadius(), _characterController.getCapsuleHalfHeight(), _characterController.getCapsuleRadius());
|
||||||
// This might not be right! Isn't the capsule local offset in avatar space? -HR 5/26/17
|
// This might not be right! Isn't the capsule local offset in avatar space? -HRS 5/26/17
|
||||||
halfBoundingBoxDimensions += _characterController.getCapsuleLocalOffset();
|
halfBoundingBoxDimensions += _characterController.getCapsuleLocalOffset();
|
||||||
QMetaObject::invokeMethod(audio.data(), "setAvatarBoundingBoxParameters",
|
QMetaObject::invokeMethod(audio.data(), "setAvatarBoundingBoxParameters",
|
||||||
Q_ARG(glm::vec3, (getPosition() - halfBoundingBoxDimensions)),
|
Q_ARG(glm::vec3, (getPosition() - halfBoundingBoxDimensions)),
|
||||||
|
@ -2271,7 +2271,7 @@ bool MyAvatar::safeLanding(const glm::vec3& position) {
|
||||||
// If position is not reliably safe from being stuck by physics, answer true and place a candidate better position in betterPositionOut.
|
// If position is not reliably safe from being stuck by physics, answer true and place a candidate better position in betterPositionOut.
|
||||||
bool MyAvatar::requiresSafeLanding(const glm::vec3& positionIn, glm::vec3& betterPositionOut) {
|
bool MyAvatar::requiresSafeLanding(const glm::vec3& positionIn, glm::vec3& betterPositionOut) {
|
||||||
// We begin with utilities and tests. The Algorithm in four parts is below.
|
// We begin with utilities and tests. The Algorithm in four parts is below.
|
||||||
auto halfHeight = _characterController.getCapsuleHalfHeight();
|
auto halfHeight = _characterController.getCapsuleHalfHeight() + _characterController.getCapsuleRadius();
|
||||||
if (halfHeight == 0) {
|
if (halfHeight == 0) {
|
||||||
return false; // zero height avatar
|
return false; // zero height avatar
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue