class

ParticleCollisionField

One frame's view of the scene as something particles can hit.

Module
Particles
Header
#include "Particles/ParticleCollision.h"
Namespace
Mowo

Both representations live above this module — the distance field belongs to the renderer's clipmap and the depth pyramid to its occlusion path — so the simulation only ever sees this sampling contract. A null field means no collision is available and collision modules pass their particles through untouched.

Constructors

SignatureNameDescription
virtual ~ParticleCollisionField() = default~ParticleCollisionField

Public functions

ReturnsNameDescription
boolHasSdf
boolHasDepth
boolSampleSdfSigned distance from worldPos to the nearest surface and the surface's outward normal (the normalized field gradient).
boolSampleDepthDepth tier: how far worldPos sits behind the rasterized surface covering its pixel, plus that surface's normal reconstructed from neighbouring depth texels.

Function details

~ParticleCollisionField

C++
virtual ~ParticleCollisionField() = default

HasSdf

C++
virtual bool HasSdf() const = 0

HasDepth

C++
virtual bool HasDepth() const = 0

SampleSdf

C++
virtual bool SampleSdf(const Vec3& worldPos, float& outDistance, Vec3& outNormal) const = 0

Signed distance from worldPos to the nearest surface and the surface's outward normal (the normalized field gradient). Negative distance means the point is inside geometry. Returns false outside the field's window.

SampleDepth

C++
virtual bool SampleDepth(const Vec3& worldPos, float& outPenetration, Vec3& outNormal) const = 0

Depth tier: how far worldPos sits behind the rasterized surface covering its pixel, plus that surface's normal reconstructed from neighbouring depth texels. outPenetration is positive when the point is behind the surface. Returns false when the point is off-screen or behind the camera.

Generated from Particles/ParticleCollision.h via particles.json · Oct 31, 2026Version 1.0.0