mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 03:03:35 +02:00
make hasAncestorOfType understand AVATAR_SELF_ID
This commit is contained in:
parent
174c674fd3
commit
c7200d2d3a
2 changed files with 13 additions and 3 deletions
|
@ -199,12 +199,15 @@ void EntityMotionState::getWorldTransform(btTransform& worldTrans) const {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
assert(entityTreeIsLocked());
|
assert(entityTreeIsLocked());
|
||||||
if (_motionType == MOTION_TYPE_KINEMATIC && !_entity->hasAncestorOfType(NestableType::Avatar)) {
|
if (_motionType == MOTION_TYPE_KINEMATIC) {
|
||||||
BT_PROFILE("kinematicIntegration");
|
BT_PROFILE("kinematicIntegration");
|
||||||
// This is physical kinematic motion which steps strictly by the subframe count
|
// This is physical kinematic motion which steps strictly by the subframe count
|
||||||
// of the physics simulation and uses full gravity for acceleration.
|
// of the physics simulation and uses full gravity for acceleration.
|
||||||
_entity->setAcceleration(_entity->getGravity());
|
if (_entity->hasAncestorOfType(NestableType::Avatar)) {
|
||||||
|
_entity->setAcceleration(glm::vec3(0.0f));
|
||||||
|
} else {
|
||||||
|
_entity->setAcceleration(_entity->getGravity());
|
||||||
|
}
|
||||||
uint32_t thisStep = ObjectMotionState::getWorldSimulationStep();
|
uint32_t thisStep = ObjectMotionState::getWorldSimulationStep();
|
||||||
float dt = (thisStep - _lastKinematicStep) * PHYSICS_ENGINE_FIXED_SUBSTEP;
|
float dt = (thisStep - _lastKinematicStep) * PHYSICS_ENGINE_FIXED_SUBSTEP;
|
||||||
_entity->stepKinematicMotion(dt);
|
_entity->stepKinematicMotion(dt);
|
||||||
|
|
|
@ -1034,6 +1034,13 @@ AACube SpatiallyNestable::getQueryAACube() const {
|
||||||
|
|
||||||
bool SpatiallyNestable::hasAncestorOfType(NestableType nestableType) const {
|
bool SpatiallyNestable::hasAncestorOfType(NestableType nestableType) const {
|
||||||
bool success;
|
bool success;
|
||||||
|
if (nestableType == NestableType::Avatar) {
|
||||||
|
QUuid parentID = getParentID();
|
||||||
|
if (parentID == AVATAR_SELF_ID) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SpatiallyNestablePointer parent = getParentPointer(success);
|
SpatiallyNestablePointer parent = getParentPointer(success);
|
||||||
if (!success || !parent) {
|
if (!success || !parent) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue