one more warning

This commit is contained in:
HifiExperiments 2024-06-07 14:22:02 -07:00
parent 5933627aa7
commit 93276a901d

View file

@ -5768,8 +5768,7 @@ void MyAvatar::FollowHelper::deactivate() {
} }
void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) { void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) {
int int_type = static_cast<int>(type); assert((int)type >= 0 && (int)type < static_cast<int>(CharacterController::FollowType::Count));
assert(int_type >= 0 && int_type < static_cast<int>(CharacterController::FollowType::Count));
_timeRemaining[(int)type] = 0.0f; _timeRemaining[(int)type] = 0.0f;
} }
@ -5777,16 +5776,14 @@ void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) {
// eg. activate(FollowType::Rotation, true) snaps the FollowHelper's rotation immediately // eg. activate(FollowType::Rotation, true) snaps the FollowHelper's rotation immediately
// to the rotation of its _followDesiredBodyTransform. // to the rotation of its _followDesiredBodyTransform.
void MyAvatar::FollowHelper::activate(CharacterController::FollowType type, const bool snapFollow) { void MyAvatar::FollowHelper::activate(CharacterController::FollowType type, const bool snapFollow) {
int int_type = static_cast<int>(type); assert((int)type >= 0 && (int)type < static_cast<int>(CharacterController::FollowType::Count));
assert(int_type >= 0 && int_type < static_cast<int>(CharacterController::FollowType::Count));
// TODO: Perhaps, the follow time should be proportional to the displacement. // TODO: Perhaps, the follow time should be proportional to the displacement.
_timeRemaining[(int)type] = snapFollow ? CharacterController::FOLLOW_TIME_IMMEDIATE_SNAP : FOLLOW_TIME; _timeRemaining[(int)type] = snapFollow ? CharacterController::FOLLOW_TIME_IMMEDIATE_SNAP : FOLLOW_TIME;
} }
bool MyAvatar::FollowHelper::isActive(CharacterController::FollowType type) const { bool MyAvatar::FollowHelper::isActive(CharacterController::FollowType type) const {
int int_type = static_cast<int>(type); assert((int)type >= 0 && (int)type < static_cast<int>(CharacterController::FollowType::Count));
assert(int_type >= 0 && int_type < static_cast<int>(CharacterController::FollowType::Count));
return _timeRemaining[(int)type] > 0.0f; return _timeRemaining[(int)type] > 0.0f;
} }