The Gravity Simulation project is a Go-based application designed to simulate gravitational interactions between celestial bodies. It provides tools for modeling, detecting collisions, and simulating the behavior of planets, dust, and other objects in a 3D space.
- Collision Detection: Detect collisions between celestial bodies.
- Planet Factory: Generate planets with customizable properties.
- Vector Operations: Perform 3D vector calculations.
- Octree Implementation: Efficient spatial partitioning for large-scale simulations.
.
├── go.mod # Go module definition
├── go.sum # Dependency checksums
├── main.go # Entry point of the application
├── collision/ # Collision detection logic
├── commands/ # Command-line utilities for simulation
├── models/ # Core data models (e.g., Body, Octree)
├── planets/ # Planet generation logic
├── test/ # Experimental and test scripts
└── utils/ # Utility functions (e.g., vector operations)
- Go 1.20 or later
- Clone the repository:
git clone https://github.com/fernandomedin/gravity-simulation.git cd gravity-simulation - Install dependencies:
go mod tidy
To start the simulation, run:
go run main.go