mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
fix for missed START collision events
This commit is contained in:
parent
89cc6ac315
commit
54b4612ee3
2 changed files with 9 additions and 9 deletions
|
@ -13,15 +13,15 @@
|
|||
|
||||
void ContactInfo::update(uint32_t currentStep, const btManifoldPoint& p) {
|
||||
_lastStep = currentStep;
|
||||
++_numSteps;
|
||||
positionWorldOnB = p.m_positionWorldOnB;
|
||||
normalWorldOnB = p.m_normalWorldOnB;
|
||||
distance = p.m_distance1;
|
||||
}
|
||||
}
|
||||
|
||||
ContactEventType ContactInfo::computeType(uint32_t thisStep) {
|
||||
if (_lastStep != thisStep) {
|
||||
return CONTACT_EVENT_TYPE_END;
|
||||
++_numChecks;
|
||||
if (_numChecks == 1) {
|
||||
return CONTACT_EVENT_TYPE_START;
|
||||
}
|
||||
return (_numSteps == 1) ? CONTACT_EVENT_TYPE_START : CONTACT_EVENT_TYPE_CONTINUE;
|
||||
return (_lastStep == thisStep) ? CONTACT_EVENT_TYPE_CONTINUE : CONTACT_EVENT_TYPE_END;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
|
||||
class ContactInfo {
|
||||
public:
|
||||
public:
|
||||
void update(uint32_t currentStep, const btManifoldPoint& p);
|
||||
ContactEventType computeType(uint32_t thisStep);
|
||||
|
||||
|
@ -30,9 +30,9 @@ public:
|
|||
btVector3 normalWorldOnB;
|
||||
btScalar distance;
|
||||
private:
|
||||
uint32_t _lastStep = 0;
|
||||
uint32_t _numSteps = 0;
|
||||
};
|
||||
uint32_t _lastStep { 0 };
|
||||
uint32_t _numChecks { 0 };
|
||||
};
|
||||
|
||||
|
||||
#endif // hifi_ContactEvent_h
|
||||
|
|
Loading…
Reference in a new issue