History

try another way of fixing held object snagging at slow velocity

Seth Alves committed 11 years ago

Commit fbe3cb91 parent 742e48b1 file · +4 −0Browse files

Showing the changes to libraries/physics/src/EntityMotionState.cpp (1 of 1 file). Show all

Unified · Split

libraries/physics/src/EntityMotionState.cpp+4−0
@@ -256,6 +256,10 @@ bool EntityMotionState::remoteSimulationOutOfSync(uint32_t simulationStep) { · 255 unmodified lines
256256 _serverPosition = bulletToGLM(xform.getOrigin());
257257 _serverRotation = bulletToGLM(xform.getRotation());
258258 _serverVelocity = getBodyLinearVelocity();
259+ if (glm::length2(_serverVelocity) < MIN_LINEAR_SPEED_SQUARED) {
260+ _serverVelocity *= 0.0f;
261+ }
262+
259263 _serverAngularVelocity = bulletToGLM(_body->getAngularVelocity());
260264 _lastStep = simulationStep;
261265 _serverActionData = _entity->getActionData();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t