MAXScript Extensions > MAXScript Extensions for Particle Flow > Particle Flow Classes > Tests >

# Collision : Helper

    Collision - superclass: helper; super-superclass:node - 9:0 - classID: #(1962490883, 515064320)

Value > MAXWrapper > Node > Helper > Collision

| Particle Flow - Quick Navigation

Description:

Collision tests for particles that collide with one or more specified Deflector Space Warps. It can also test whether a particle has slowed down or sped up after one or more collisions, has collided more than once, and even whether it will collide with a deflector in a specified number of frames.

Constructor:

    Collision...

Properties:

    <Collision>.Collision_Nodes ArrayParameter default: #() -- node array; alias: collisionNodes

Get/Set the list of Deflectors used as Collision Nodes.

    <Collision>.test_Type Integer default: 0 -- integer; Collision_Test_Type

Controls the state of the Test True If Particle radiobuttons in the UI.

Possible values are:

0: Collides - Choose this option, and then set .Speed_Option according to how particle speed should be affected by the collision.

1: Is Slow After Collision(s) - The test succeeds if, after collision, particle speed is less than the Min_Speed value.

2: Is Fast After Collision(s) - The test succeeds if, after collision, particle speed is greater than the Max_Speed value.

3: Collided Multiple Times - The test becomes True after a particle collides a specific number of times. The particle is moved to the point of the last collision and then redirected to the next event.

4: Will Collide - The software extrapolates particle motion in a linear fashion, based on the current direction and speed, and the test becomes True if the results suggest that the particle will collide with the deflector during a specified time interval. The particle is redirected to the next event without updating its speed or position.

    <Collision>.Speed_Option Integer default: 0 -- integer; alias:speedOption

Controls the state of the Speed drop-down list. Determines the behavior of the particle after the collision when .testType is set to 0 : Collides. Possible values are:

0: Bounce - The speed and direction after collision is determined by the deflector properties.

1: Continue - Particle speed and direction are unaffected by the collision.

2: Stop - Particle speed is set to 0 after the collision.

3: Random - Particles bounce off the deflector in random directions.

    <Collision>.Min_Speed Float default: 1.0 -- world units; alias: minSpeed

Corresponds to the Speed Min value in the UI. Particles traveling at less than this speed, in system units per second, test True and become eligible for moving to the next event when .testType is set to 1 : Is Slow After Collision.

    <Collision>.Max_Speed Float default: 1000.0 -- world units; alias: maxSpeed

Corresponds to the Speed Max value in the UI. Particles traveling faster than this speed, in system units per second, test True and become eligible for moving to the next event when .testType is set to 2 : Is Fast After Collision.

    <Collision>.Collision_Count Integer default: 5 -- integer; alias: collisionCount

Get/Set the number of times a particle must collide in order to test True. Only used when .testType is set to 3 : Collided Multiple Times.

    <Collision>.collision_Count_OptionsInteger default: 0 -- integer; alias: collisionCountOptions

Controls the state of the Speed drop-down list under the Collided Multiple Times option. Determines the behavior of the particle after the collision.

0: Bounce - The speed and direction after collision is determined by the deflector properties.

1: Continue - Particle speed and direction are unaffected by the collision.

2: Stop - Particle speed is set to 0 after the collision.

3: Random - Particles bounce off the deflector in random directions.

    <Collision>.Will_Collide_Frame Integer default: 800 -- integer; alias: willCollideFrame

Get/Set the time ahead (in ticks) during which the software looks for an impending collision when .testType is set to 4 : Will Collide.

Note

The time value is shown as frames in the UI.

    <Collision>.Random_Seed Integer default: 12345 -- integer

Specifies the randomization value.

## Collision Interfaces:

The following Interfaces are exposed by the Collision Class:

Interface: action

Interface: test

#### See Also

- Particle Flow Classes