Contents

setUniformTransform(_:)

Registers a closure that transforms a uniform value of type V on a per-entity basis.

Declaration

func setUniformTransform<V>(_ transform: @escaping (V, Entity) -> V) where V : BitwiseCopyable

Parameters

  • transform:

    A closure (V, Entity) -> V.

Discussion

The closure receives the current value and the entity being evaluated, and returns the transformed value. This lets you derive per-entity variants of a global uniform at simulation time, for example, converting a position from the scene’s coordinate system to the system’s coordinate system.