mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 04:03:59 +02:00
put some code back now that entity-server is doing simple simulation again. don't draw blue physics-enabled dot unless debug menu-item is checked
This commit is contained in:
parent
ddec6d5207
commit
867fe18472
2 changed files with 7 additions and 30 deletions
|
@ -79,22 +79,9 @@ void RenderableDebugableEntityItem::render(EntityItem* entity, RenderArgs* args)
|
|||
glm::vec4 yellowColor(1.0f, 1.0f, 0.2f, 1.0f);
|
||||
renderBoundingBox(entity, args, 0.3f, yellowColor);
|
||||
}
|
||||
|
||||
if (PhysicsEngine::physicsInfoIsActive(entity->getPhysicsInfo())) {
|
||||
renderHoverDot(entity, args);
|
||||
}
|
||||
}
|
||||
|
||||
if (PhysicsEngine::physicsInfoIsActive(entity->getPhysicsInfo())) {
|
||||
renderHoverDot(entity, args);
|
||||
}
|
||||
|
||||
glm::vec3 position;
|
||||
glm::quat rotation;
|
||||
|
||||
//
|
||||
// XXX for future debugging
|
||||
//
|
||||
// if (PhysicsEngine::getBodyLocation(entity->getPhysicsInfo(), position, rotation)) {
|
||||
// glm::vec3 positionOffset = glm::abs(position - entity->getPosition());
|
||||
// if (positionOffset[0] > 0.001 || positionOffset[1] > 0.001 || positionOffset[2] > 0.001) {
|
||||
// qDebug() << positionOffset[0] << positionOffset[1] << positionOffset[2];
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@ EntityMotionState::~EntityMotionState() {
|
|||
}
|
||||
|
||||
void EntityMotionState::updateServerPhysicsVariables(uint32_t flags) {
|
||||
/*
|
||||
if (flags & EntityItem::DIRTY_POSITION) {
|
||||
_sentPosition = _entity->getPosition();
|
||||
}
|
||||
|
@ -61,7 +60,6 @@ void EntityMotionState::updateServerPhysicsVariables(uint32_t flags) {
|
|||
if (flags & EntityItem::DIRTY_ANGULAR_VELOCITY) {
|
||||
_sentAngularVelocity = _entity->getAngularVelocity();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
@ -96,17 +94,9 @@ bool EntityMotionState::isMoving() const {
|
|||
}
|
||||
|
||||
bool EntityMotionState::isMovingVsServer() const {
|
||||
// auto alignmentDot = glm::abs(glm::dot(_sentRotation, _entity->getRotation()));
|
||||
// if (glm::distance(_sentPosition, _entity->getPosition()) > IGNORE_POSITION_DELTA ||
|
||||
// alignmentDot < IGNORE_ALIGNMENT_DOT) {
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
|
||||
if (glm::length(_entity->getVelocity()) > IGNORE_LINEAR_VELOCITY_DELTA) {
|
||||
return true;
|
||||
}
|
||||
if (glm::length(_entity->getAngularVelocity()) > IGNORE_ANGULAR_VELOCITY_DELTA) {
|
||||
auto alignmentDot = glm::abs(glm::dot(_sentRotation, _entity->getRotation()));
|
||||
if (glm::distance(_sentPosition, _entity->getPosition()) > IGNORE_POSITION_DELTA ||
|
||||
alignmentDot < IGNORE_ALIGNMENT_DOT) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue