Skip to content

Commit

Permalink
This is significantly smoother
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Jun 25, 2024
1 parent c9eadac commit bc25b78
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,19 @@ public void ExperiencePressureDifference(
moveForce *= HumanoidThrowMultiplier;
if (moveForce > physics.Mass)
{
var maxSafeForceForObject = SpaceWindMaxVelocity * physics.Mass;
moveForce = MathF.Min(moveForce, maxSafeForceForObject);
// Grid-rotation adjusted direction
var dirVec = (direction.ToAngle() + gridWorldRotation).ToWorldVec();
moveForce *= MathF.Max(physics.InvMass, SpaceWindMaximumCalculatedInverseMass);

//TODO Consider replacing throw target with proper trigonometry angles.
if (throwTarget != EntityCoordinates.Invalid)
{
var pos = throwTarget.ToMap(EntityManager, _transformSystem).Position - xform.WorldPosition + dirVec;
_throwing.TryThrow(uid, pos.Normalized() * moveForce, pressureDifference);
_throwing.TryThrow(uid, pos.Normalized() * moveForce, moveForce);
}
else
{
_throwing.TryThrow(uid, dirVec.Normalized() * moveForce, pressureDifference);
_throwing.TryThrow(uid, dirVec.Normalized() * moveForce, moveForce);
}

component.LastHighPressureMovementAirCycle = cycle;
Expand Down

0 comments on commit bc25b78

Please sign in to comment.