Particle System Constraints

From Valve Developer Community
Jump to: navigation, search

Particle Constraints prevent particles from passing through certain areas, such as brushes. The can also be user-defined, such as a 2-Dimensional plane.

Collision via traces

Uses traces for checking collisions.

collision mode
0 to 3 range. Defines how exactly traces will be used for particle collision.
'0' (Default)
Does a trace per frame, for each particle. This is the most accurate, but also the expensive mode, and it gets worse the more particles there are.
Performs several traces when this particle system first starts, from the origin of Control Point #0. The information gained from this is then used to approximately test particle collision. This is one of the cheapest collision modes, but also very innacurate.
Similar in function to mode 1. However, it performs a single trace going in the -X direction in world-space. The plane derived from this trace is then used for particle collision, and only that plane. This doesn't seem to have any use at all.
Similar in function to mode 0. However, it performs traces far more sparingly, and the traces extend further ahead of the particles. This mode is the best compromise between accuracy, and performance. Particles using this collision mode may sometimes clip and go through objects.
collision group
Known arguments are:
Does not collide with anything.
Collides with nothing but world and static stuff.
Collides with everything except interactive debris or debris.
Generic NPC group.
Used so NPCs in scripts ignore the player.
Doors that the player shouldn't collide with.

Additional snip from the code:

amount of bounce
Amount of bounce force to apply when a collision occurs.
amount of slide
Amount of sliding force applied to particles currently on a surface.
kill particle on collision
Destroys the particle when it collides with an object
brush only
If 1, the particle will collide only with brushes
trace accuracy tolerance
Amount of tolerance to use when calculating collisions. Higher values mean more tolerance, but less realistic collisions. Lower values mean more accurate collisions, most likely at the cost of additional calculations.

Constrain distance to path between two control points

Keeps particles on a path between two control points. Internally determined control point only?

minimum distance
Minimum distance between the two control points. It's recommended to keep this at zero.
maximum distance
Maximum distance between the two control points. It needs to be equal or greater than the distance between the two control points, in order to work.
maximum distance middle
Maximum distance between start and the middle, Controlled via a circular radius.
maximum distance end
Maximum distance between middle and end point. Default value is -1 which means off.
travel time
Maximum time a particle can spend traveling between the two points.
random bulge
Random clumping of particles. Works much like emitting a group of particles.
start control point number
The starting control point number. 0 is recommended since it is the particle system's origin.
end control point number
The end control point number. Using the start control point number is NOT recommended, as the particles will just around. See this in order to make a control point.
bulge control 0=random 1=orientation of start pnt 2=orientation of end point
Pretty self explanatory, determines where to place the bulge
mid point position
Determines the middle of the path, in a decimal percentage. 0.5 is the middle, 1 is the end, 0 is the beginning?

Prevent passing through a plane

Blocks particles from passing through an imaginary two-dimensional plane. Default settings make it at the bottom of the particle's origin.

global origin
Use global origin instead of particle origin? (Not recommended)
plane point
The 2nd Point to use to define a more complex plane, based on its coordinates.
plane normal
3D vector that determines the angle of the plane (same concept as VPlane)

Prevent passing through static part of world

Prevents passing through any static part of the world. I.e. prop_statics, brushes, etc