rydit-physics
Physics module for RyDit - Projectile motion, Gravity, N-body simulation
Overview
rydit-physics provides physics simulations for the RyDit game engine, including projectile motion and gravitational N-body simulations.
Installation
[]
= "0.7.3"
Usage
use PhysicsModule;
use RyditModule;
use json;
let module = PhysicsModule;
// Projectile motion
let trajectory = module.execute;
// Returns: {x, y, height, distance, time}
// N-body gravity (2 bodies)
let gravity = module.execute;
// Returns: gravitational force between two bodies
Features
Projectile Motion
physics::projectile- Calculate projectile trajectory- Parameters:
x0, y0, velocity, angle_degrees - Returns: trajectory data with height, distance, flight time
- Parameters:
N-Body Gravity
physics::nbody_2- Two-body gravitational simulation- Parameters:
m1, m2, x1, y1, x2, y2, G - Returns: gravitational force and acceleration
- Parameters:
LAZOS Protocol
Use with RyDit's LAZOS protocol:
# Projectile
|
# Gravity simulation
|
Examples
Projectile Trajectory
// Launch from (0,0) at 50 m/s, 45 degrees
let result = module.execute;
Gravitational Force
// Earth (m=100) and Moon (m=10) at distance 50
let result = module.execute;
License
MIT License - See LICENSE for details.
Contributing
Contributions are welcome! Please open an issue or submit a PR at: https://github.com/lapumlbb18-blip/Rydit_Engine