Skip to content

VfxModularPhysicsComponent

15.21

Class Documentation

Edit documentation

The physics component of a component emitter. It keeps a position, a velocity, a rotation and a scale per particle, and builds the motion from the Modifiers list. VfxPhysicsModifierBase describes the modifiers and when they run.

Reference frame

Each particle moves inside a reference frame. The particle's own position is relative to the frame, and the frame places it in the world.

  • Translation. The frame starts at the emitter's position at the particle's birth. On each step it moves toward the emitter's current position by the weight in 0x1fd12444.
  • Rotation. With 0xf35c764c the frame keeps the emitter's rotation at the particle's birth. With 0x1064c2a8 it follows the emitter's current rotation by EmitterOrientationWeight. With neither flag the frame has no rotation and its axes are the world axes.
  • If the emitter has a parent transform, the frame is multiplied by it.

The frame decides what local and world mean in the modifiers. A local vector is in the frame's axes. A world vector keeps its world direction whatever the frame's rotation: the client turns it by the emitter's rotation at birth when 0xf35c764c is set, and by the emitter's current rotation when only 0x1064c2a8 is set.

Spawn

The particles of one spawn are spread along the emitter's path in that update: the birth position of each new particle is interpolated from the emitter's previous position to its current position. Each modifier then initialises the new particles, in list order.

Update models

0xb5d23158 selects how the particles are integrated.

Value Model Behaviour
0 Explicit Integrates velocity and position separately and keeps a world-space offset apart from the local position. Drag works per axis, as on a complex emitter: each axis slows toward zero and never reverses.
1 Position based The model that the rest of this page and the modifier pages describe.
other None The component creates no running part. The client crashes on the emitter's first spawn or update.

One step of the position-based model:

  1. The modifiers that act before the integration run, in list order. They add an acceleration a, a displacement d, a velocity change and a rotation.
  2. Each particle moves: p = p0 + v * dt * (1 - k) + a * dt^2 + d. p0 is the previous position, v the velocity, and k the drag of a VfxPhysicsDragModifier times dt, clamped to [0, 1].
  3. The velocity is recomputed from the move without d: v = (p - p0 - d) / dt. A displacement moves the particle but gives it no momentum.
  4. The reference frame is applied, then the direction orientation of IsDirectionVelocityOriented. The world velocity is the change of the world position divided by dt.
  5. The modifiers that act after the integration run: VfxPhysicsScaleModifier and VfxPhysicsFollowTerrainModifier.
  6. The acceleration and the displacement are reset. The particle scale is multiplied by the emitter instance's scale.

Positions are in world units, velocities in world units per second and dt in seconds.

Properties

0x1064c2a8

Flag = false
15.24
Edit documentation

Makes the reference frame's rotation follow the emitter's current rotation, weighted by EmitterOrientationWeight. The modifiers then turn their world vectors by the emitter's current rotation.

0x1fd12444

Embed<VfxFloatDynamicProperty> = { "Float": {} }
15.24
Edit documentation

How far the reference frame's translation follows the emitter, as a float driver value evaluated per particle on every step and clamped to [0, 1]. At 0 the particle stays where it was born and the emitter's later movement does not carry it. At 1 it moves with the emitter. Between the two, the frame moves that fraction of the remaining distance on each step.

0xb5d23158

U8 = 1
16.14
Edit documentation

The update model: 0 explicit, 1 position based. See the table in the class description.

0xf35c764c

Flag = true
15.24
Edit documentation

Gives the reference frame the emitter's rotation at the particle's birth. The particle's local motion follows the emitter's orientation at that moment, and later rotation of the emitter does not turn it.

EmitterOrientationWeight

Embed<VfxFloatDynamicProperty> = { "Float": {} }
16.17
Edit documentation

How far the reference frame's rotation follows the emitter's current rotation, as a float driver value. Read only when 0x1064c2a8 is set.

Value Frame rotation
1 or more Set to the emitter's current rotation on every step.
between 0 and 1 Turned toward the emitter's current rotation by this fraction on every step, so it follows with a lag.
0 or less Kept as it is.

IsDirectionVelocityOriented

Flag = false
16.1
Edit documentation

Orients each particle along its motion. On each step in which the particle moves inside its frame, the client stores the direction of that move and turns the particle's orientation to it. Before the first move the direction is the frame's +X axis.

IsDirectionVelocityOrientedOnSpawn

Flag = false
16.7
Edit documentation

Like IsDirectionVelocityOriented, but the direction is taken from the particle's first step only and kept for its whole life.

isDirectionOriented

Flag = false
Removed in 16.1 15.24
Add documentation

No documentation available yet. Click "Add documentation" to contribute!