Gama C Library
Gama C API Documentation
system.h File Reference

Manages physics bodies, their interactions, and collision detection within a simulation. More...

#include "body.h"
#include "body_list.h"
#include "position.h"
#include "collision.h"

Go to the source code of this file.

Data Structures

struct  gm_system
 Structure representing a physics system containing bodies and collision information. More...

Typedefs

typedef struct gm_system gmSystem
 Structure representing a physics system containing bodies and collision information.

Functions

gmSystem gm_system_create ()
 Creates a new physics system with default values.
void gm_system_destroy (gmSystem *sys)
 Destroys the physics system and frees its internal memory.

Detailed Description

Manages physics bodies, their interactions, and collision detection within a simulation.

This file defines the gmSystem structure and functions for creating, populating, and destroying a physics simulation environment.

Typedef Documentation

◆ gmSystem

typedef struct gm_system gmSystem

Structure representing a physics system containing bodies and collision information.

Function Documentation

◆ gm_system_create()

gmSystem gm_system_create ( )

Creates a new physics system with default values.

Initializes a gmSystem with no bodies, zero global velocity/acceleration, and a damping factor of 0.

Returns
A new gmSystem instance.

◆ gm_system_destroy()

void gm_system_destroy ( gmSystem * sys)

Destroys the physics system and frees its internal memory.

This function frees the memory allocated for the system's internal collision list and the list of body pointers. It does NOT free the gmBody instances themselves, which must be managed by the caller.

Parameters
sysPointer to the system to destroy.