mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-22 23:24:56 +02:00
move nextAttitude() from AvatarData to MyAvatar
This commit is contained in:
parent
f0871c6878
commit
29be9aee65
5 changed files with 19 additions and 21 deletions
|
@ -1642,6 +1642,23 @@ void MyAvatar::prepareForPhysicsSimulation() {
|
||||||
_prePhysicsRoomPose = AnimPose(_sensorToWorldMatrix);
|
_prePhysicsRoomPose = AnimPose(_sensorToWorldMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// There are a number of possible strategies for this set of tools through endRender, below.
|
||||||
|
void MyAvatar::nextAttitude(glm::vec3 position, glm::quat orientation) {
|
||||||
|
bool success;
|
||||||
|
Transform trans = getTransform(success);
|
||||||
|
if (!success) {
|
||||||
|
qCWarning(interfaceapp) << "Warning -- MyAvatar::nextAttitude failed";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
trans.setTranslation(position);
|
||||||
|
trans.setRotation(orientation);
|
||||||
|
SpatiallyNestable::setTransform(trans, success);
|
||||||
|
if (!success) {
|
||||||
|
qCWarning(interfaceapp) << "Warning -- MyAvatar::nextAttitude failed";
|
||||||
|
}
|
||||||
|
updateAttitude();
|
||||||
|
}
|
||||||
|
|
||||||
void MyAvatar::harvestResultsFromPhysicsSimulation(float deltaTime) {
|
void MyAvatar::harvestResultsFromPhysicsSimulation(float deltaTime) {
|
||||||
glm::vec3 position;
|
glm::vec3 position;
|
||||||
glm::quat orientation;
|
glm::quat orientation;
|
||||||
|
|
|
@ -432,6 +432,7 @@ public:
|
||||||
|
|
||||||
void updateMotors();
|
void updateMotors();
|
||||||
void prepareForPhysicsSimulation();
|
void prepareForPhysicsSimulation();
|
||||||
|
void nextAttitude(glm::vec3 position, glm::quat orientation); // Can be safely called at any time.
|
||||||
void harvestResultsFromPhysicsSimulation(float deltaTime);
|
void harvestResultsFromPhysicsSimulation(float deltaTime);
|
||||||
|
|
||||||
const QString& getCollisionSoundURL() { return _collisionSoundURL; }
|
const QString& getCollisionSoundURL() { return _collisionSoundURL; }
|
||||||
|
|
|
@ -184,7 +184,7 @@ public:
|
||||||
void scaleVectorRelativeToPosition(glm::vec3 &positionToScale) const;
|
void scaleVectorRelativeToPosition(glm::vec3 &positionToScale) const;
|
||||||
|
|
||||||
void slamPosition(const glm::vec3& position);
|
void slamPosition(const glm::vec3& position);
|
||||||
virtual void updateAttitude() override { _skeletonModel->updateAttitude(); }
|
virtual void updateAttitude() { _skeletonModel->updateAttitude(); }
|
||||||
|
|
||||||
// Call this when updating Avatar position with a delta. This will allow us to
|
// Call this when updating Avatar position with a delta. This will allow us to
|
||||||
// _accurately_ measure position changes and compute the resulting velocity
|
// _accurately_ measure position changes and compute the resulting velocity
|
||||||
|
|
|
@ -110,23 +110,6 @@ const QUrl& AvatarData::defaultFullAvatarModelUrl() {
|
||||||
return _defaultFullAvatarModelUrl;
|
return _defaultFullAvatarModelUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// There are a number of possible strategies for this set of tools through endRender, below.
|
|
||||||
void AvatarData::nextAttitude(glm::vec3 position, glm::quat orientation) {
|
|
||||||
bool success;
|
|
||||||
Transform trans = getTransform(success);
|
|
||||||
if (!success) {
|
|
||||||
qCWarning(avatars) << "Warning -- AvatarData::nextAttitude failed";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
trans.setTranslation(position);
|
|
||||||
trans.setRotation(orientation);
|
|
||||||
SpatiallyNestable::setTransform(trans, success);
|
|
||||||
if (!success) {
|
|
||||||
qCWarning(avatars) << "Warning -- AvatarData::nextAttitude failed";
|
|
||||||
}
|
|
||||||
updateAttitude();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AvatarData::setTargetScale(float targetScale) {
|
void AvatarData::setTargetScale(float targetScale) {
|
||||||
auto newValue = glm::clamp(targetScale, MIN_AVATAR_SCALE, MAX_AVATAR_SCALE);
|
auto newValue = glm::clamp(targetScale, MIN_AVATAR_SCALE, MAX_AVATAR_SCALE);
|
||||||
if (_targetScale != newValue) {
|
if (_targetScale != newValue) {
|
||||||
|
|
|
@ -445,9 +445,6 @@ public:
|
||||||
using SpatiallyNestable::setOrientation;
|
using SpatiallyNestable::setOrientation;
|
||||||
virtual void setOrientation(const glm::quat& orientation) override;
|
virtual void setOrientation(const glm::quat& orientation) override;
|
||||||
|
|
||||||
void nextAttitude(glm::vec3 position, glm::quat orientation); // Can be safely called at any time.
|
|
||||||
virtual void updateAttitude() {} // Tell skeleton mesh about changes
|
|
||||||
|
|
||||||
glm::quat getHeadOrientation() const {
|
glm::quat getHeadOrientation() const {
|
||||||
lazyInitHeadData();
|
lazyInitHeadData();
|
||||||
return _headData->getOrientation();
|
return _headData->getOrientation();
|
||||||
|
|
Loading…
Reference in a new issue