Skip to content

LeaoMartelo2/raylib-3D-collision-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raylib 3D collision demo

This aims to be a example of how to implement the Separating axis theorem (SAT) collision detection algorithm in C++ using Raylib

This is a extracted and modified code from my other project, simplified to be a template / example of 3D collisions in raylib.

(heavily inspired by this)

This is in no way the best or most efficient, it's very bare bones and it's only here to serve as example to anyone wanting a template of 3D collisions to work in raylib.

It spawns 6 randomly sized and placed colliders (near the center of the field), for you to test the collisions; (there is no check if it makes the player stuck on start)

Objects that are currently colliding turn RED, the player turns GREEN when not colliding with anything.

Features

  • Collider class

Gives you a very simple collider class, with the bare minimum to make cuboid Oriented Bounding Boxes.

  • Player class

Gives you a very bare bones player class, that contains a collider, to move around with WASD and SPACE to play with the collisions.

  • Gravity

Very simple gravity system, used to allow for testing walking / jumping on top of colliders;

Building the project

As of now, the project only supports Linux x86_64, I might add support to more platforms in the future.

Building:

git clone https://github.com/LeaoMartelo2/raylib-3D-collision-demo

cd raylib-3D-collision-demo

make

About

Separating Axis Theorem (SAT) collision implemented with raylib template

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published