Inertia (#3709)
* Some stuff * Fix NaN angular velocity * Optimise a bit * Give throwing a bit of a spin * Reality can be whatever I want * Biffing it * Cleanup * Update submodule Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -12,6 +12,8 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
{
|
||||
internal static class ThrowHelper
|
||||
{
|
||||
private const float ThrowAngularImpulse = 3.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Tries to throw the entity if it has a physics component, otherwise does nothing.
|
||||
/// </summary>
|
||||
@@ -41,6 +43,8 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
if (entity.HasComponent<ItemComponent>())
|
||||
{
|
||||
entity.EnsureComponent<ThrownItemComponent>().Thrower = user;
|
||||
// Give it a l'il spin.
|
||||
physicsComponent.ApplyAngularImpulse(ThrowAngularImpulse);
|
||||
|
||||
if (user != null)
|
||||
EntitySystem.Get<InteractionSystem>().ThrownInteraction(user, entity);
|
||||
|
||||
Reference in New Issue
Block a user