| 507 | } |
| 508 | |
| 509 | void Entity::ApplySpeed(Matrix4& result, float deltaT) |
| 510 | { |
| 511 | Vector3 position = Position(); |
| 512 | position += _speed * deltaT; |
| 513 | // rotate around the center of mass: translate COM to origin, rotate, translate back |
| 514 | Vector3Val com = GetCenterOfMass(); |
| 515 | Matrix3 orientation = Orientation(); |
| 516 | Vector3Val translateCOM = orientation * com; |
| 517 | orientation += _angVelocity.Tilda() * orientation * deltaT; |
| 518 | orientation.Orthogonalize(); |
| 519 | Vector3 backCOM = orientation * com; |
| 520 | position += translateCOM - backCOM; |
| 521 | |
| 522 | result.SetPosition(position); |
| 523 | result.SetOrientation(orientation); |
| 524 | } |
| 525 | |
| 526 | void Entity::OnAddImpulse(Vector3Par force, Vector3Par torque) {} |
| 527 |
nothing calls this directly
no test coverage detected