ShiftingOrigin#

Class in WaveHarmonic.Crest.ShiftingOrigin, WaveHarmonic.Crest.RelativeSpace

This script translates all objects in the world to keep the camera near the origin in order to prevent spatial jittering due to limited floating-point precision.

The script detects when the camera is further than ‘threshold’ units from the origin in one or more axes, at which point it moves everything so that the camera is back at the origin. There is also an option to disable physics beyond a certain point. This script should normally be attached to the viewpoint, typically the main camera.

Members#

Properties#

OverrideRigidBodyList

Optionally provide a list of rigidbodies to avoid doing a FindObjectsByType call.

OverrideTransformList

Optionally provide a list of transforms to avoid doing a FindObjectsByType call.

PhysicsSleepThreshold

The mass-normalized energy threshold, below which objects start going to sleep.

PhysicsThreshold

The threshold to apply the sleep threshold.

Threshold

Use a power of 2 to avoid pops in water surface geometry.

Static Properties#

ShiftThisFrame

The amount the origin shifted this frame.

Events#

OnShift

Invoked when the origin shifts.