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
| Signature | Name | Description |
|---|---|---|
virtual ~ParticleCollisionField() = default | ~ParticleCollisionField |
Public functions
| Returns | Name | Description |
|---|---|---|
bool | HasSdf | |
bool | HasDepth | |
bool | SampleSdf | Signed distance from worldPos to the nearest surface and the surface's outward normal (the normalized field gradient). |
bool | SampleDepth | Depth 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
virtual ~ParticleCollisionField() = defaultHasSdf
virtual bool HasSdf() const = 0HasDepth
virtual bool HasDepth() const = 0SampleSdf
virtual bool SampleSdf(const Vec3& worldPos, float& outDistance, Vec3& outNormal) const = 0Signed 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
virtual bool SampleDepth(const Vec3& worldPos, float& outPenetration, Vec3& outNormal) const = 0Depth 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.