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:
Seth Alves 2015-05-07 10:11:36 -07:00
parent ddec6d5207
commit 867fe18472
2 changed files with 7 additions and 30 deletions

View file

@ -79,22 +79,9 @@ void RenderableDebugableEntityItem::render(EntityItem* entity, RenderArgs* args)
glm::vec4 yellowColor(1.0f, 1.0f, 0.2f, 1.0f); glm::vec4 yellowColor(1.0f, 1.0f, 0.2f, 1.0f);
renderBoundingBox(entity, args, 0.3f, yellowColor); 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];
// }
// }
} }

View file

@ -48,7 +48,6 @@ EntityMotionState::~EntityMotionState() {
} }
void EntityMotionState::updateServerPhysicsVariables(uint32_t flags) { void EntityMotionState::updateServerPhysicsVariables(uint32_t flags) {
/*
if (flags & EntityItem::DIRTY_POSITION) { if (flags & EntityItem::DIRTY_POSITION) {
_sentPosition = _entity->getPosition(); _sentPosition = _entity->getPosition();
} }
@ -61,7 +60,6 @@ void EntityMotionState::updateServerPhysicsVariables(uint32_t flags) {
if (flags & EntityItem::DIRTY_ANGULAR_VELOCITY) { if (flags & EntityItem::DIRTY_ANGULAR_VELOCITY) {
_sentAngularVelocity = _entity->getAngularVelocity(); _sentAngularVelocity = _entity->getAngularVelocity();
} }
*/
} }
// virtual // virtual
@ -96,17 +94,9 @@ bool EntityMotionState::isMoving() const {
} }
bool EntityMotionState::isMovingVsServer() const { bool EntityMotionState::isMovingVsServer() const {
// auto alignmentDot = glm::abs(glm::dot(_sentRotation, _entity->getRotation())); auto alignmentDot = glm::abs(glm::dot(_sentRotation, _entity->getRotation()));
// if (glm::distance(_sentPosition, _entity->getPosition()) > IGNORE_POSITION_DELTA || if (glm::distance(_sentPosition, _entity->getPosition()) > IGNORE_POSITION_DELTA ||
// alignmentDot < IGNORE_ALIGNMENT_DOT) { 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) {
return true; return true;
} }
return false; return false;