simpler EntityItem::simulate() bypass for bullet

This commit is contained in:
Andrew Meadows 2014-12-18 13:56:18 -08:00
parent 85fd1fc14f
commit dab1f026d7

View file

@ -587,6 +587,11 @@ bool EntityItem::isRestingOnSurface() const {
}
void EntityItem::simulate(const quint64& now) {
if (_physicsInfo) {
// we rely on bullet for simulation, so bail
return;
}
bool wantDebug = false;
if (_lastSimulated == 0) {
@ -636,7 +641,6 @@ void EntityItem::simulate(const quint64& now) {
qDebug() << " ********** EntityItem::simulate() .... SETTING _lastSimulated=" << _lastSimulated;
}
if (!_physicsInfo) {
if (hasAngularVelocity()) {
glm::quat rotation = getRotation();
glm::vec3 angularVelocity = glm::radians(getAngularVelocity());
@ -724,7 +728,7 @@ void EntityItem::simulate(const quint64& now) {
qDebug() << " EPSILON_VELOCITY_LENGTH:" << EPSILON_VELOCITY_LENGTH;
}
// if we've slowed considerably, then just stop moving
// round velocity to zero if it's close enough...
if (glm::length(velocity) <= EPSILON_VELOCITY_LENGTH) {
velocity = NO_VELOCITY;
}
@ -740,7 +744,6 @@ void EntityItem::simulate(const quint64& now) {
qDebug() << " old getAABox:" << getAABox();
}
}
}
_lastSimulated = now;
}