Kakoha
AboutProjects
CVContact
EN
FR
Kakoha
EN
FR

Dhiaeddine Mokaddem

Gameplay programmer focused on systems, AI, multiplayer, VR, tools, and optimization.

HomeProjectsCVContact
dhiaeddine.mokaddem@gmail.comLinkedInitch.ioGame Jolt
All projects
Technical ExplorationPhysics Simulation

Physics from First Principles

Implement motion, integration, collisions, constraints, and custom rendering from first principles, then extend the shared engine with a breakable chain simulation.

Repository

Role

Physics programmer and chain-simulation developer

Engine

Unity renderer with custom physics

Platform

Windows

Team

5-person team

Dates

24 Sep-13 Nov 2025

Outcome

Technical exploration

What I worked on

A custom physics engine built inside Unity while using Unity only as a rendering host: no Rigidbody, no Collider, and no simulated movement through Transform components.

  • As a five-person team, we built the shared rigid-body representation, Euler and Verlet integration, collision detection and response, and mathematical utilities.
  • Simulated objects keep Unity Transform at position 0,0,0, rotation 0,0,0, and scale 1,1,1; visual placement is derived from custom state and manual matrices.
  • I built the breakable-chain extension using spring-connected custom bodies, masses, distance constraints, spring forces, gravity, damping, Verlet integration, and maximum-extension breaking.
  • My demonstration compares four chains with alpha values 0, 0.75, 1.25, and 2, showing different release reactions after the user pulls each chain past its threshold.
  • The project contains other individual demonstrations by teammates, shown separately as evidence of the shared engine rather than as my personal work.

Technical details

Programming

C#

Supporting technology

Custom physics engine, Verlet integration, Position-based constraints

Development breakdown

Behind the systems

01

Shared engine foundations

We used Unity as a rendering host, but implemented the simulated motion, collision detection, collision response, constraints, integration, and mesh deformation ourselves. Shared work included manual matrices, quaternion and Euler conversions, rigid-body state, Euler and Verlet integrators, collision utilities, contact data, and reusable constants.

02

No Unity physics or Transform motion

The project uses no Unity Rigidbody or Collider components. Simulated objects keep their Transform values unchanged; custom positions and rotations are converted into matrices and rendered directly, separating mathematical state from Unity scene transforms.

03

My breakable-chain extension

I implemented spring-connected custom bodies with per-link mass, gravity, damping, Verlet integration, iterative distance constraints, and two anchors. Pulling the end past the maximum extension breaks the constraint. Four chains compare alpha values 0, 0.75, 1.25, and 2; higher values produce a stronger release reaction while alpha 0 moves comparatively little.

04

Additional demonstrations built by the team

Other team members used the shared engine foundation for plate fracture, high-speed wall demolition, soft-body gelatin, and thin-plate simulations. These demonstrations are included to show the breadth of the common architecture and are explicitly not presented as my individual implementations.

Problems and solutions

Rendering without Transform movement

Unity normally expects visible objects to be positioned through Transform components.

The simulation stores position and rotation independently, builds transformation matrices manually, and draws meshes from that state while the Unity Transform remains unchanged.

Stable breakable constraints

A chain needs to preserve link distances under gravity while still reacting clearly when stretched beyond its elastic limit.

I used Verlet integration, iterative distance corrections, damping, mass ratios, anchored endpoints, and a maximum-extension threshold that releases the end anchor and applies the stored reaction.

Reflection

Building physics from mathematical state made integration, constraints, collision response, and rendering responsibilities explicit. The chain extension showed how solver parameters can materially change the visible release of stored tension.