Registers a callback that is executed on every requestAnimationFrame update.
Callback executed once per frame with deltaTime.
Animates the camera on a curved path towards a target position while optionally updating the camera's look-at target.
Parameter object for the animation.
OptionalaimTarget?: string | Vector3 | Obj3DThe target the camera should face during or after the animation.
The target the camera should move toward.
Optionalduration?: numberThe animation duration in seconds. Default: 2
Optionalease?: stringThe easing function name for GSAP. Default: 'power1.inOut'
OptionalradiusOut?: numberThe outward curve radius used to shape the camera path. Default: 1
The method resolves camTarget and optionally aimTarget to world positions and animates the camera position along a curved trajectory instead of a straight line. If aimTarget is provided,
the camera target position is interpolated towards the resolved aim position while the camera moves along the curve.
Events
Animates the THREE.PerspectiveCamera towards a target object and frames it based on its own geometry. The camera keeps the resolved target object as the look-at target while its distance is calculated
from the object's bounding size and the camera's field of view.
Parameter object for the animation.
Optionaldist?: numberFraming factor applied to the calculated camera distance. Default: 1
Optionalduration?: numberThe animation duration in seconds. Default: 1
Optionalease?: stringThe easing function name for GSAP. Default: 'power2.inOut'
The target object or the name of the target object.
The method finds a Three.js mesh by name, validates that it has a material with color properties and animates them (e.g. color, emissive, ...).
Parameter object for the animation.
Optionalduration?: numberThe animation duration in seconds. Default: 0
Optionalease?: stringThe easing function name for GSAP. Default: 'power1.inOut'
The name of the mesh object whose material color should be animated.
The method finds a Three.js mesh by name, validates that it has a material with numeric properties (e.g. metalness, roughness, opacity, etc.) and animates them over time using GSAP.
Parameter object for the animation.
Optionalduration?: numberThe animation duration in seconds. Default: 0
Optionalease?: stringThe easing function name for GSAP. Default: 'power1.inOut'
Optionalinfinite?: booleanIf true, the animation loops infinitely. Default: false
The name of the mesh object whose material property will be animated.
OptionalstartValue?: number | nullThe starting value of the property. Default: Current material's value
Selects the active anti-aliasing mode. The modes 'fxaa', 'smaa' and 'traa' lazy-load their required modules.
The anti-aliasing mode to use.
Enables or disables screen-space ambient occlusion. Passing true lazy-loads the required module.
Whether SSAO should be enabled.
Enables or disables screen-space reflections. In WebGL mode, the SSR pass also synchronizes the ground reflector and the optional selective reflection objects. When SSR is disabled, the reflector is detached from the pass and hidden. Passing true lazy-loads the required module.
Whether SSR should be enabled.
Finds a Three.js animation clip by name and plays it through the THREE.AnimationMixer.
Parameters for controlling the animation playback.
OptionalblendMode?: BlendModeHow the action is blended with other active actions. Default: 'normal'
The name of the animation clip to play.
Optionalduration?: numberDuration in seconds for speed interpolation. Default: 0
Optionalease?: stringGSAP easing function name. Default: 'power1.inOut'
OptionalendSpeed?: numberTarget playback speed. Default: 1
OptionalfadeDuration?: numberDuration in seconds for fading affected previous actions out and the new action in. Default: 0
OptionalfadeDurationFinish?: numberDuration in seconds for finishMode: 'fadeOut'. Default: 0
OptionalfinishMode?: FinishModeWhether the final pose is held or faded out after the final loop. Default: 'hold'
The freely named layer used to group animation actions.
OptionalloopMode?: LoopModeNumber of plays or 'infinite' for endless looping. Default: 1
Optionalreset?: booleanIf true, resets the clip before a new playback. Default: false
Optionalreverse?: booleanIf true, plays the clip in reverse. Default: false
OptionalsingleAction?: booleanOptionalstartSpeed?: numberInitial playback speed for speed interpolation. Default: 0
OptionalstopMode?: StopModeWhich previous actions of the same layer are stopped before playback. Default: 'all'
Calling a running or fading-in action again is ignored. A finished or stopped action starts again, while an unfinished fading-out action continues at its current time and fades back in from its current weight.
finishMode and fadeDurationFinish have no effect when loopMode is 'infinite'.
Events
Finds a camera animation clip by name and plays it through the THREE.AnimationMixer.
Parameters for controlling the camera animation playback.
OptionalblendMode?: BlendModeHow the action is blended with other active actions. Default: 'normal'
The name of the camera animation clip to play.
Optionalduration?: numberDuration in seconds for speed interpolation. Default: 0
Optionalease?: stringGSAP easing function name. Default: 'power1.inOut'
OptionalendSpeed?: numberTarget playback speed. Default: 1
OptionalfadeDuration?: numberDuration in seconds for fading affected previous actions out and the new action in. Default: 0
The freely named layer used to group camera animation actions.
OptionalloopMode?: LoopModeNumber of plays or 'infinite' for endless looping. Default: 1
Optionalreset?: booleanIf true, resets the clip before a new playback. Default: false
Optionalreverse?: booleanIf true, plays the clip in reverse. Default: false
OptionalstartSpeed?: numberInitial playback speed for speed interpolation. Default: 0
OptionalstopMode?: StopModeWhich previous actions of the same layer are stopped before playback. Default: 'all'
The method removes the existing THREE.AmbientLight from the scene and releases its resources. If no ambient light exists, the method exits without performing any action.
The method removes the existing THREE.Fog from the scene. If no fog exists, the method exits without performing any action.
The method removes the existing THREE.HemisphereLight from the scene and releases its resources. If no hemisphere light exists, the method exits without performing any action.
Removes a previously registered frame update callback.
Callback to remove.
The method creates or updates a Three.js THREE.AmbientLight instance in the scene.
Parameter object for controlling the ambient light.
Optionalcolor?: ColorRepresentationThe ambient light color. If omitted and the light already exists, the current color remains unchanged.
Optionalintensity?: numberThe ambient light intensity. If omitted and the light already exists, the current intensity remains unchanged.
The method creates or updates a Three.js THREE.Fog instance in the scene.
Parameter object for controlling the fog.
Optionalcolor?: ColorRepresentationThe fog color. If omitted and the fog already exists, the current color remains unchanged.
Optionalfar?: numberThe far distance where fog ends. If omitted and the fog already exists, the current far value remains unchanged.
Optionalnear?: numberThe near distance where fog starts. If omitted and the fog already exists, the current near value remains unchanged.
The method creates or updates a Three.js THREE.HemisphereLight instance in the scene.
Parameter object for controlling the hemisphere light.
OptionalgroundColor?: ColorRepresentationThe ground light color. If omitted and the light already exists, the current ground color remains unchanged.
Optionalintensity?: numberThe hemisphere light intensity. If omitted and the light already exists, the current intensity remains unchanged.
OptionalskyColor?: ColorRepresentationThe sky light color. If omitted and the light already exists, the current sky color remains unchanged.
The method finds a Three.js mesh by name, validates that it has a material, and updates one or more of its material properties at runtime. It supports both numeric and color values as well as
texture paths (map, emissiveMap), which are automatically loaded via THREE.TextureLoader.
Parameter object for setting material properties.
The name of the mesh whose material properties should be modified.
Additional properties of params can define one or more material fields to update (e.g. color, roughness, metalness, map, emissiveMap, ...), each with its target value. Texture paths provided
as strings are loaded asynchronously and assigned to the corresponding material slots. Unsupported or mismatched property types are ignored with a warning in debug mode.
The method finds a Three.js animation clip by name, validates that it exists within the loaded GLTF, and stops its playback via the THREE.AnimationMixer. It supports smooth fade-out transitions using
GSAP before stopping the clip completely.
Parameter object for controlling the stop behavior.
The name of the animation clip to stop.
Optionalease?: stringThe easing function name for the fade-out transition. Default: 'power1.inOut'
OptionalfadeOut?: numberThe fade-out duration in seconds before stopping the clip. Default: 0
Toggles the browser fullscreen mode for the associated canvas element.
Updates the renderer, post-processing composer, and ground reflector to match the current canvas size. Ensures that the rendering resolution and reflection buffers remain consistent when the viewport changes.
Registers and executes a low-level extension function with access to the public Engine API.
Function that receives the current Engine instance and can use its public members and methods.
The
Engineclass serves as the core runtime of the illutions Engine. It initializes and manages the Three.js scene, renderer, camera, lighting, post-processing, and loaded models. The class orchestrates rendering, animation playback, and material updates, while integrating system events, raycasting, and performance monitoring. It provides the foundation for real-time interaction and visual consistency across all scene components.