h3d.scene.Scene is the root class for a 3D scene. All root objects are added to it before being drawn on screen.
Constructor
new(createRenderer:Bool = true, createLightSystem:Bool = true)
Create a new scene. A default 3D scene is already available in hxd.App.s3d
Variables
Methods
addEventListener(f:Event ‑> Void):Void
Add an event listener that will capture all events not caught by an h2d.Interactive
computeStatic():Void
Perform a rendering with RendererContext.computingStatic=true
, allowing the computation of static shadow maps, etc.
hardwarePick(pixelX:Float, pixelY:Float):Object
Use GPU rendering to pick a model at the given pixel position. hardwarePick() will check all scene visible meshes bounds against a ray cast with current camera, then draw them into a 1x1 pixel texture with a specific shader. The texture will then be read and the color will identify the object that was rendered at this pixel. This is a very precise way of doing scene picking since it performs exactly the same transformations (skinning, custom shaders, etc.) but might be more costly than using CPU colliders. Please note that when done during/after rendering, this might clear the screen on some platforms so it should always be done before rendering.
removeEventListener(f:Event ‑> Void):Bool
Remove a previously added event listener, return false it was not part of our event listeners.
setElapsedTime(elapsedTime:Float):Void
Before render() or sync() are called, allow to set how much time has elapsed (in seconds) since the last frame in order to update scene animations. This is managed automatically by hxd.App