Quick Start Guide
Eidolon.Newton2D
is a convenient utility provided by Eidolon, designed to simplify and enhance the usage of Unity Physics 2D. This static class offers a set of methods to streamline common operations on 2D rigidbodies, providing a more straightforward and expressive API for game developers.
1. Applying Force
Newton 2D’s ApplyForce
method simplifies the process of applying a force to a 2D rigidbody. Specify the direction and magnitude, and let Newton 2D handle the rest, making your code clean and efficient.
2. Setting Velocity
With SetVelocity
, controlling the velocity of a 2D rigidbody becomes a breeze. Provide the new velocity, and Newton 2D takes care of the assignment, enhancing the readability of your code.
3. Simulating a Jump
Simulating a jump is straightforward using Newton 2D’s Jump
method. Specify the rigidbody and the jump force, and watch your character soar. No need for complex calculations – just a simple, intuitive function.
4. Setting Constraints
The SetConstraints
method in Newton 2D offers a human-friendly approach to managing constraints on a 2D rigidbody. Easily freeze or unfreeze the X-axis, Y-axis, and rotation with clear and concise parameters.
5. Applying Torque
Applying torque to a 2D rigidbody is made simple with the ApplyTorque
method. Provide the rigidbody and torque value, and Newton 2D handles the rest, making your code expressive and easy to understand.
6. Applying Linear Damping
Newton 2D’s ApplyLinearDamping
method allows you to apply linear damping to a 2D rigidbody effortlessly. Manage damping factors with clarity, enhancing the control and readability of your code.
7. Applying Angular Damping
The ApplyAngularDamping
method in Newton 2D streamlines the application of angular damping to a 2D rigidbody. Set the damping factor easily, making your code clean and comprehensible.
8. Applying Force at Position
Newton 2D’s ApplyForceAtPosition
method lets you apply force to a 2D rigidbody at a specific position with ease. Enhance the precision of your game physics without compromising on clarity.
9. Applying Torque at Position
ApplyTorqueAtPosition
in Newton 2D enables precise torque application around a specific point on a 2D rigidbody. Fine-tune your game’s rotational dynamics without sacrificing readability.
10. Simulating Linear and Angular Drag
Newton 2D provides ApplyLinearDrag
and ApplyAngularDrag
methods, allowing you to simulate linear and angular drag effortlessly. Fine-tune your game’s drag effects with clear and concise functions.
Conclusion
Newton 2D acts as your go-to companion for Unity Physics 2D, offering a more human-readable and convenient interface for handling common rigidbody operations. Whether you’re a seasoned developer or just starting, Newton 2D makes your code cleaner and your game physics interactions smoother. Happy coding! 🚀