mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 10:58:22 +02:00
add isStuck logging, add assert because singleton
This commit is contained in:
parent
4f0c2c5ee6
commit
7084908df3
1 changed files with 8 additions and 0 deletions
|
@ -105,6 +105,8 @@ CharacterController::CharacterMotor::CharacterMotor(const glm::vec3& vel, const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint32_t _numCharacterControllers { 0 };
|
||||||
|
|
||||||
CharacterController::CharacterController() {
|
CharacterController::CharacterController() {
|
||||||
_floorDistance = _scaleFactor * DEFAULT_AVATAR_FALL_HEIGHT;
|
_floorDistance = _scaleFactor * DEFAULT_AVATAR_FALL_HEIGHT;
|
||||||
|
|
||||||
|
@ -123,6 +125,11 @@ CharacterController::CharacterController() {
|
||||||
_hasSupport = false;
|
_hasSupport = false;
|
||||||
|
|
||||||
_pendingFlags = PENDING_FLAG_UPDATE_SHAPE;
|
_pendingFlags = PENDING_FLAG_UPDATE_SHAPE;
|
||||||
|
|
||||||
|
// ATM CharacterController is a singleton. When we want more we'll have to
|
||||||
|
// overhaul the applyPairwiseFilter() logic to handle multiple instances.
|
||||||
|
++_numCharacterControllers;
|
||||||
|
assert(numCharacterControllers == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterController::~CharacterController() {
|
CharacterController::~CharacterController() {
|
||||||
|
@ -279,6 +286,7 @@ bool CharacterController::checkForSupport(btCollisionWorld* collisionWorld) {
|
||||||
if (_stuckTransitionCount > NUM_SUBSTEPS_FOR_STUCK_TRANSITION) {
|
if (_stuckTransitionCount > NUM_SUBSTEPS_FOR_STUCK_TRANSITION) {
|
||||||
// we've been in this "probablyStuck" state for several consecutive substeps
|
// we've been in this "probablyStuck" state for several consecutive substeps
|
||||||
// --> make it official by changing state
|
// --> make it official by changing state
|
||||||
|
qCDebug(physics) << "CharacterController::_isStuck :" << _isStuck << "-->" << probablyStuck;
|
||||||
_isStuck = probablyStuck;
|
_isStuck = probablyStuck;
|
||||||
// init _numStuckSubsteps at NUM_SUBSTEPS_FOR_SAFE_LANDING_RETRY so SafeLanding tries to help immediately
|
// init _numStuckSubsteps at NUM_SUBSTEPS_FOR_SAFE_LANDING_RETRY so SafeLanding tries to help immediately
|
||||||
_numStuckSubsteps = NUM_SUBSTEPS_FOR_SAFE_LANDING_RETRY;
|
_numStuckSubsteps = NUM_SUBSTEPS_FOR_SAFE_LANDING_RETRY;
|
||||||
|
|
Loading…
Reference in a new issue