GCubeSDK
©2026 FenixFox®Studios

Particle

Represents a single physical particle in simulation. A Particle stores physical things like mass, position, forces etc. and can be used to simulate motion over time.

Methods

Particle(u32 capacity, u32 maxLevel)

Constructor to create new Particle

position Initial world-space position
mass Mass of the particle 0.1

Particle& applyForce(const Vector3& force)

Applies force to the current particle by adding it to the current forces

force force to add

Particle& applyFriction(const Vector3& friction)

Applies friction to the particle's velocity and accumulated forces

friction Friction coefficient to apply.

Vector3 acceleration(const Vector3& force, const float& mass)

Computes acceleration based on force and mass (F = m * a).

force Total force applied to the particle.
mass Particle mass used for acceleration calculation.

Particle& update(const float& dt)

Updates particle state using elapsed time.

dt Delta time step used for the simulation update 0.02

Properties

curState State Current state (position + velocity)
forces Vector3 Accumulated external forces applied this frame
friction float Friction coefficient applied during movement - default 0.9
gravity Vector3 Gravity acceleration - default Vector3(0,-0.98,0)
mass float Particle mass used for physics calculations - default 0.1
position Vector3
position Vector3 world-space position
prevState State Previous state (position + velocity)
velocity Vector3