Skip to content

fevunge/physics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Banner

Version License Build Coverage PRs Welcome


Physics

A simple 2D engine for physics simulations, exploring concepts like gravity, collisions, and motion.


Table of Contents


Overview

physics is a lightweight 2D physics engine designed for educational purposes and simple simulations. It allows users to create and manipulate objects in a virtual environment, applying forces, detecting collisions, and simulating realistic motion. The engine is built with performance and ease of use in mind, making it ideal for students, hobbyists, and developers looking to explore the fundamentals of physics in a fun and interactive way.


Features

  • Rigid Body Dynamics: Simulate the motion of solid objects under the influence of forces and torques.
  • Collision Detection: Detect and respond to collisions between objects, including elastic and inelastic collisions.
  • Gravity Simulation: Apply gravitational forces to objects, allowing for realistic falling and projectile motion.
  • Customizable Properties: Define properties such as mass, friction, and restitution for each object.
  • 2D Vector Math: Built-in support for vector operations, making it easy to calculate forces, velocities, and positions.
  • Simple API: Intuitive API for creating and manipulating objects, applying forces, and running simulations.
  • Performance Optimizations: Efficient algorithms for collision detection and physics calculations to ensure smooth simulations even with multiple objects.

Tech Stack

Layer Technology
Graphics Love2D (vesion 11.5)
Backend Lua (version 5.4.8)

Getting Started

Prerequisites

love2d 11.5
lua 5.4.8

Installation

1. Clone the repository

git clone https://github.com/fevunge/physics.git
cd physics

2. Run the simulation

love .

Usage

... Soon ...


Project Structure

physics/
├── .gitignore
├── LICENSE
├── main.lua
├── paint.lua
└── README.md

API Reference

... Soon ...


Screenshots

A simple gravity simulation with one object falling under the influence of gravity.


Roadmap

... Soon ...


Contributing

Contributions are what make the open source community incredible.
Any contributions you make are greatly appreciated.

  1. Fork the repository
  2. Create your feature branch: git checkout -b feat/feature-or-bugfix
  3. Commit your changes: git commit -m 'feat: add some amazing feature or fix a bug'
  4. Push to the branch: git push origin feat/feature-or-bugfix
  5. Open a Pull Request

Please, follow Conventional Commits:

feat(scope):     New feature
fix(scope):      Bug fix
docs(scope):     Documentation update
style(scope):    Formatting (no logic change)
refactor(scope): Code refactoring
test(scope):     Adding tests
chore(scope):    Maintenance tasks

Authors

Fernando Vunge
GitHub LinkedIn Twitter

Made with 🧠 and 📚 by fevunge

Star this repo if you found it interesting!

About

Physics simulations inside a computer with Love in Lua

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages