Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pebble is a minimal physics wrapper built on Chipmunk2D, designed to make basic physics setups dead simple — no overengineering, no headaches.

License

mastercuber55/Pebble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🪨 Pebble — A Tiny Physics Engine

Pebble is a minimal physics wrapper built on Chipmunk2D, designed to make basic physics setups dead simple — no overengineering, no headaches.

💡 Why Pebble Exists

So, while working on my game Dangan Starfall, I realized something:

  • Physac works out of the box but runs into memory issues way too easily.
  • Chipmunk2D is great but feels overly complex for small projects.

So I made Pebble — a tiny, focused wrapper that keeps only the essentials. It’s not meant to do everything, just the simple stuff that most small 2D games need.

🧩 Current API

Here’s what Pebble currently provides under the hood:

namespace Pebble {
struct Obj {
  cpBody *Body;
  cpShape *Shape;
  cpSpace *Space;

  const cpVect Size;
  const cpFloat Radius;

  bool Collision;

  Obj(cpSpace *space, cpVect pos, cpVect size, cpFloat mass);
  Obj(cpSpace *space, cpVect pos, cpFloat radius, cpFloat mass);
  ~Obj();

  // Don't mind this ig, its just to avoid memory leaks.
  Obj(const Obj &) = delete;
  Obj &operator=(const Obj &) = delete;

  operator cpBody *() const;
  operator cpShape *() const;

  // Following are some inline methods.
  void setAngle(cpFloat);
  cpFloat getAngle();

  void setVelocity(cpVect);
  cpVect getVelocity();

  cpVect getPosition();
  cpFloat getMass();

  void setAngularVelocity(cpFloat);
  void applyForce(cpVect);
  void applyImpulse(cpVect);
  void setCollisionType(cpCollisionType);
};
}

🧠 Notes

Pebble is still in its early stages — expect the API and usage examples to evolve soon with more real-world demos and Frax integration examples.

- This is just an initial README with basic usage info. 
- It’ll be updated soon with better examples, diagrams, and more.

🖥️ Community & Support

Join the Discord server to chat about Pebble, ask questions, or follow development updates: 👉 https://discord.gg/7zvpWnE7QV

About

Pebble is a minimal physics wrapper built on Chipmunk2D, designed to make basic physics setups dead simple — no overengineering, no headaches.

Resources

License

Stars

Watchers

Forks

Languages