mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 23:55:12 +02:00
use degrees/sec for EntityItem angular velocity
This commit is contained in:
parent
af9bafae87
commit
d2bd95703a
1 changed files with 6 additions and 3 deletions
|
@ -71,7 +71,8 @@ void EntityMotionState::setWorldTransform(const btTransform& worldTrans) {
|
||||||
_entity->setVelocityInMeters(v);
|
_entity->setVelocityInMeters(v);
|
||||||
|
|
||||||
getAngularVelocity(v);
|
getAngularVelocity(v);
|
||||||
_entity->setAngularVelocity(v);
|
// DANGER! EntityItem stores angularVelocity in degrees/sec!!!
|
||||||
|
_entity->setAngularVelocity(glm::degrees(v));
|
||||||
|
|
||||||
_outgoingPacketFlags = DIRTY_PHYSICS_FLAGS;
|
_outgoingPacketFlags = DIRTY_PHYSICS_FLAGS;
|
||||||
EntityMotionState::enqueueOutgoingEntity(_entity);
|
EntityMotionState::enqueueOutgoingEntity(_entity);
|
||||||
|
@ -82,7 +83,8 @@ void EntityMotionState::applyVelocities() const {
|
||||||
#ifdef USE_BULLET_PHYSICS
|
#ifdef USE_BULLET_PHYSICS
|
||||||
if (_body) {
|
if (_body) {
|
||||||
setVelocity(_entity->getVelocityInMeters());
|
setVelocity(_entity->getVelocityInMeters());
|
||||||
setAngularVelocity(_entity->getAngularVelocity());
|
// DANGER! EntityItem stores angularVelocity in degrees/sec!!!
|
||||||
|
setAngularVelocity(glm::radians(_entity->getAngularVelocity()));
|
||||||
_body->setActivationState(ACTIVE_TAG);
|
_body->setActivationState(ACTIVE_TAG);
|
||||||
}
|
}
|
||||||
#endif // USE_BULLET_PHYSICS
|
#endif // USE_BULLET_PHYSICS
|
||||||
|
@ -140,7 +142,8 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, uint32_
|
||||||
properties.setVelocity(_sentVelocity);
|
properties.setVelocity(_sentVelocity);
|
||||||
_sentAcceleration = bulletToGLM(_body->getGravity());
|
_sentAcceleration = bulletToGLM(_body->getGravity());
|
||||||
properties.setGravity(_sentAcceleration);
|
properties.setGravity(_sentAcceleration);
|
||||||
properties.setAngularVelocity(_sentAngularVelocity);
|
// DANGER! EntityItem stores angularVelocity in degrees/sec!!!
|
||||||
|
properties.setAngularVelocity(glm::degrees(_sentAngularVelocity));
|
||||||
}
|
}
|
||||||
|
|
||||||
// RELIABLE_SEND_HACK: count number of updates for entities at rest so we can stop sending them after some limit.
|
// RELIABLE_SEND_HACK: count number of updates for entities at rest so we can stop sending them after some limit.
|
||||||
|
|
Loading…
Reference in a new issue