From bc45c17a1928c623743d11bb14340a62dad066e7 Mon Sep 17 00:00:00 2001 From: HifiExperiments Date: Sat, 8 Jun 2024 14:12:45 -0700 Subject: [PATCH] debug warning fix --- interface/src/avatar/MyAvatar.cpp | 6 +++--- libraries/physics/src/CharacterController.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 85972058da..2849ca15a0 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -5768,7 +5768,7 @@ void MyAvatar::FollowHelper::deactivate() { } void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) { - assert((int)type >= 0 && (int)type < static_cast(CharacterController::FollowType::Count)); + assert(type < CharacterController::FollowType::Count); _timeRemaining[(int)type] = 0.0f; } @@ -5776,14 +5776,14 @@ void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) { // eg. activate(FollowType::Rotation, true) snaps the FollowHelper's rotation immediately // to the rotation of its _followDesiredBodyTransform. void MyAvatar::FollowHelper::activate(CharacterController::FollowType type, const bool snapFollow) { - assert((int)type >= 0 && (int)type < static_cast(CharacterController::FollowType::Count)); + assert(type < CharacterController::FollowType::Count); // TODO: Perhaps, the follow time should be proportional to the displacement. _timeRemaining[(int)type] = snapFollow ? CharacterController::FOLLOW_TIME_IMMEDIATE_SNAP : FOLLOW_TIME; } bool MyAvatar::FollowHelper::isActive(CharacterController::FollowType type) const { - assert((int)type >= 0 && (int)type < static_cast(CharacterController::FollowType::Count)); + assert(type < CharacterController::FollowType::Count); return _timeRemaining[(int)type] > 0.0f; } diff --git a/libraries/physics/src/CharacterController.h b/libraries/physics/src/CharacterController.h index 8242ae4b97..90aa7ad74b 100644 --- a/libraries/physics/src/CharacterController.h +++ b/libraries/physics/src/CharacterController.h @@ -54,7 +54,7 @@ class CharacterController : public btCharacterControllerInterface { public: enum class FollowType : uint8_t { - Rotation, + Rotation = 0, Horizontal, Vertical, Count