mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-19 12:13:03 +02:00
Get state using CharacterController
This commit is contained in:
parent
93a1adc736
commit
02837be13f
2 changed files with 13 additions and 17 deletions
|
@ -6846,17 +6846,14 @@ glm::vec3 MyAvatar::getCameraEyesPosition(float deltaTime) {
|
|||
frontOffset = frontOffset < 0.0f ? 0.0f : mixAlpha * frontOffset;
|
||||
glm::vec3 cameraOffset = upOffset * Vectors::UP + frontOffset * Vectors::FRONT;
|
||||
const float TAU = 0.1f;
|
||||
_cameraEyesOffset = _cameraEyesOffset + (cameraOffset - _cameraEyesOffset) * TAU * timeScale;
|
||||
_cameraEyesOffset = _cameraEyesOffset + (cameraOffset - _cameraEyesOffset) * min(1.0f, TAU * timeScale);
|
||||
glm::vec3 estimatedCameraPosition = defaultEyesPosition + getWorldOrientation() * _cameraEyesOffset;
|
||||
return estimatedCameraPosition;
|
||||
}
|
||||
|
||||
bool MyAvatar::isJumping() {
|
||||
if (_skeletonModel->isLoaded()) {
|
||||
return (_skeletonModel->getRig().getState() == Rig::RigRole::InAir ||
|
||||
_skeletonModel->getRig().getState() == Rig::RigRole::Takeoff) && !isFlying();
|
||||
}
|
||||
return false;
|
||||
return (_characterController.getState() == CharacterController::State::InAir ||
|
||||
_characterController.getState() == CharacterController::State::Takeoff) && !isFlying();
|
||||
}
|
||||
|
||||
bool MyAvatar::setPointAt(const glm::vec3& pointAtTarget) {
|
||||
|
|
|
@ -115,16 +115,6 @@ public:
|
|||
Seated
|
||||
};
|
||||
|
||||
enum class RigRole {
|
||||
Idle = 0,
|
||||
Turn,
|
||||
Move,
|
||||
Hover,
|
||||
Takeoff,
|
||||
InAir,
|
||||
Seated
|
||||
};
|
||||
|
||||
Rig();
|
||||
virtual ~Rig();
|
||||
|
||||
|
@ -267,7 +257,6 @@ public:
|
|||
bool getFlowActive() const;
|
||||
bool getNetworkGraphActive() const;
|
||||
void setDirectionalBlending(const QString& targetName, const glm::vec3& blendingTarget, const QString& alphaName, float alpha);
|
||||
const RigRole getState() const { return _state; }
|
||||
|
||||
signals:
|
||||
void onLoadComplete();
|
||||
|
@ -350,6 +339,16 @@ protected:
|
|||
AnimVariantMap _animVars;
|
||||
AnimVariantMap _networkVars;
|
||||
|
||||
enum class RigRole {
|
||||
Idle = 0,
|
||||
Turn,
|
||||
Move,
|
||||
Hover,
|
||||
Takeoff,
|
||||
InAir,
|
||||
Seated
|
||||
};
|
||||
|
||||
RigRole _state { RigRole::Idle };
|
||||
RigRole _desiredState { RigRole::Idle };
|
||||
float _desiredStateAge { 0.0f };
|
||||
|
|
Loading…
Reference in a new issue