Skip to content

An open-source header-only C++ 3D physics engine library. UNDER DEVELOPMENT

License

Notifications You must be signed in to change notification settings

FahdSeddik/FZX-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FZX-lib


FZX-lib

FZX-lib is a header-only, open source C++ physics engine library for 3D simulations and games.


Table of Contents


Features

  • Rigid body dynamics
  • Discrete collision detection (broadphase & narrowphase)
  • Collision shapes: Sphere, Box, Capsule, Convex Mesh, Concave Mesh, Height Field
  • Collision response & friction with Sequential Impulses solver
  • Joints: Ball-and-Socket, Hinge, Slider, Fixed
  • Ray casting & collision filtering
  • Automatic sleeping for inactive bodies
  • No external dependencies (header-only, no STL containers)
  • Cross-platform: Windows, Linux, macOS

Prerequisites

  • CMake ≥ 3.10
  • A C++17–compliant compiler

Installation

Using CMake FetchContent

Add the following to your top-level CMakeLists.txt:

include(FetchContent)

FetchContent_Declare(
  fzx
  GIT_REPOSITORY https://github.com/FahdSeddik/FZX-lib.git
  GIT_TAG        main
)

FetchContent_MakeAvailable(fzx)

Then link against the FZX::fzx target:

add_executable(MyApp src/main.cpp)

target_link_libraries(MyApp PRIVATE FZX::fzx)

Using find_package

If you’ve installed FZX-lib system-wide (e.g. via cmake --install), simply:

find_package(FZX REQUIRED)

add_executable(MyApp src/main.cpp)

target_link_libraries(MyApp PRIVATE FZX::fzx)

Usage

Include the main header in your code:

// src/main.cpp
#include <fzx/fzx.h>
#include <iostream>

int main() {
    // Create sim world with default configuration
    fzx::SimManager simManager;
    auto world = simManager.createSimWorld();

    // Create a dynamic sphere body
    fzx::Transform transform(fzx::Vec3(0, 10, 0), fzx::Quaternion::identity());
    auto body = world->createRigidBody(transform);
    
    // UNDER-CONSTRUCTION //
    //   IN DEVELOPMENT   //

    return 0;
}

License

This project is licensed under the zlib License.

Acknowledgement

This project is inspired by the great work of ReactPhysics3D. I'm creating this repo as part of learning.

About

An open-source header-only C++ 3D physics engine library. UNDER DEVELOPMENT

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages