Interface IParticleCollision ​
Namespace: ValveResourceFormat.Particles
Assembly: ValveResourceFormat.dll
The world geometry a particle system can trace against, for collision and ground placement. Traces run between any two points: along a particle's movement, or out from a control point to find the surfaces a collision plane set is built from.
public interface IParticleCollisionProperties ​
HasGeometry ​
Whether there is any geometry at all, so a function that needs it can skip its traces.
bool HasGeometry { get; }Property Value ​
bool
None ​
Collision for systems with no world around them: every trace misses.
public static IParticleCollision None { get; }Property Value ​
Methods ​
FindRayTraceEnvironment(string) ​
Finds a ray trace environment by name. These are sets of map volumes traced apart from the world, such as PRECIPITATION and PRECIPITATIONBLOCKER. A host without them keeps this default, and the functions that trace them leave particles alone.
int FindRayTraceEnvironment(string name)Parameters ​
name string
The environment name.
Returns ​
int
The environment's index, or -1 when there is no such environment.
TraceEnvironment(int, Vector3, Vector3, float, out float, out Vector3) ​
Traces a ray against a ray trace environment found by IParticleCollision.FindRayTraceEnvironment(string).
bool TraceEnvironment(int environment, Vector3 rayStart, Vector3 direction, float maxDistance, out float distance, out Vector3 normal)Parameters ​
environment int
The environment index.
rayStart Vector3
Start of the ray.
direction Vector3
Unit direction of the ray.
maxDistance float
How far along the ray to look.
distance float
How far along the ray the nearest hit is, or maxDistance on a miss.
normal Vector3
The surface normal at the nearest hit, as the volume defines it, or zero on a miss.
Returns ​
bool
Whether the ray hit anything within maxDistance.
TraceRay(Vector3, Vector3, out Vector3, out Vector3, out float) ​
Traces a ray from rayStart to rayEnd against the world.
bool TraceRay(Vector3 rayStart, Vector3 rayEnd, out Vector3 position, out Vector3 normal, out float fraction)Parameters ​
rayStart Vector3
Start of the ray.
rayEnd Vector3
End of the ray.
position Vector3
The nearest hit point, or rayEnd on a miss.
normal Vector3
The surface normal at the hit point, facing the ray, or zero on a miss.
fraction float
How far along the ray the hit is, from 0 at the start to 1 at the end. It is 1 on a miss.
Returns ​
bool
Whether the ray hit anything.

