CRM64Pro GDK v0.20.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches

Description

Physics module for 2D overlap tests, swept collisions, collision sets and kinematic helpers [v26.08.00].

Overview

Physics provides broad-phase AABB checks, shape-aware and pixel-aware object overlap tests, swept point collision and simple motion helpers. It is a geometry service: it does not own a simulation world or apply forces.

Collision sets

Collision sets hold persistent world-space rectangles, circles, ellipses, segments and polygons. They accelerate swept collision through a spatial grid and return the collision-set and collider IDs in PhysicsSweepHit. Scene object layers compile opted-in c64scn_blocks_particles objects into this shared geometry for particle effects.

Threading

Public configuration, mutation and lifetime calls are main-thread operations. Particle workers can query a frozen collision set only during a synchronous particle update; do not modify or close a set while that update is running. See Threading conventions.

Best practices

Use AABB mode for broad gameplay checks, shape or pixel mode only when precision is required, and collision sets for repeated particle/world sweeps. Use Main::getLogicDeltaTime() for motion helpers.

Classes

struct  CRM64Pro::PhysicsSweepHit
 Result from a swept Physics collision query. More...
class  CRM64Pro::Physics
 Physics module class. More...

Enumerations

enum  CRM64Pro::ePhysicsCollisionMode : Uint32 { CRM64Pro::PCM_AABB = 0 , CRM64Pro::PCM_SHAPE , CRM64Pro::PCM_PIXEL }
 Collision mode for Physics overlap checks. More...

Enumeration Type Documentation

◆ ePhysicsCollisionMode

Collision mode for Physics overlap checks.

Enumerator
PCM_AABB 

Broad phase only: AABB overlap.

PCM_SHAPE 

Broad + narrow: runs AABB precheck, then shape-aware overlap test.

PCM_PIXEL 

Broad + narrow: runs AABB precheck, then pixel/coverage overlap test (falls back to shape where pixel source is unavailable).