Distance an object can be from a ray to be considered hit, for picking functions where that is not specified explicitly. Default value is 4.0.
Picking flags to be applied for Scene picking functions not including pickingFlags as argument. Default: PickingFlags.PickSprites + PickingFlags.ReturnChildEntity + PickingFlags.RemoveDuplicates
Getter for default camera. Can be null if clearing scene without default and no camera defined.
Getter for directional light
Getter for fill light
Getter for head light
Setter for camera origin.
When working with large coordinate systems it is necessary to set origin close to the coordinates of the camera. Rendering and navigation will be inaccurate if distance between camera and origin gets too large. Ex: scene.origin = [60000000, 7000000, 0]
new scene and camera origin
Getter for class Runtime
Return bounding box for Entity in Engine Coordinates
Calculated Engine Coordinates bounding box - May be empty
Returns union of bounding box for array of Entities, e.g. Entity[] in Engine Coordinates
Array of entities.
Calculated Engine Coordinates bounding box - May be empty
Returns union of bounding box for array of Entities, e.g. Entity[] in World Coordinates
Array of entities.
Calculated World Coordinates bounding box - May be empty
Return bounding box for Entity in World Coordinates
Calculated World Coordinates bounding box - May be empty
Simple Entity lookup. Use getEntityFull for search control
Name to look for
Optional
exactName: booleanDefault=true. True for exact match, false for string.contains(name)
Looked up entity or null
Get Entity from it's entity ID. Returns existing entity if created by client. Builds from Cogs definition if created internally in Cogs.
ID of the entity
Cogs.js Entity if valid ID
Search for an Entity. If a root is provided will look only for that entity's hierarchy. Otherwise checks for all entities stored. All root entities searched first.
Name to look for
Optional root entity to limit search for only children.
Flags to filter the search, use values as described by - enum EntityFind.
The entity, if found else null.
Get the first Entity hit from the ray being shoot from a 3D world position in the direction of orientation. Uses Scene.pickingFlags
The 3D world space position where the ray is being generated.
A Quaternion with a world space rotation, pointing in the direction of the ray.
Maximum length at which the ray is capable of detecting hits.
A radius that defines where the projection space frustum planes are located when picking.
Engine Coordinate of picked entity if param not undefined.
First entity found or null if no hit
Get entity on given position on Window. Uses Scene.pickingFlags
First entity found or null if no hit
Get the picked information by performing a ray pick from the given window location into the scene.
Window X
Window Y
Flags for pick selection
Full picking information of first intersection. null if no picking found
Get all entities on given position on Window sorted by a distance from camera
Window X
Window Y
Flags for pick selection
Array of Full picking information.
Get all picked entities using defined ray starting from position. Sorted by a distance from scene camera. Uses Engine Coordinates.
The Engine Coordinates where the ray is being generated.
A Quaternion with a world space rotation, pointing in the direction of the ray.
Maximum length at which the ray is capable of detecting hits.
A radius that defines where the projection space frustum planes are located when picking.
Flags for pick selection
Array of Full picking information.
Get all picked entities using defined ray starting from position. Sorted by a distance from scene camera. Uses World Coordinates.
The World Coordinates where the ray is being generated.
A Quaternion with a world space rotation, pointing in the direction of the ray.
Maximum length at which the ray is capable of detecting hits.
A radius that defines where the projection space frustum planes are located when picking.
Flags for pick selection
Optional
layerMask: RenderLayersOptional mask of layers enabled for picking (default All).
Array of Full picking information.
Get all World pick infos on given position on Window sorted by a distance from camera
Window X
Window Y
Flags for pick selection
Optional
layerMask: RenderLayersOptional mask of layers enabled for picking (default All).
Array of World picking information.
Get the picked information by performing a ray pick from the given window location into the scene. Uses Engine Coordinates.
The Engine Coordinate where the ray is being generated.
A Quaternion with a world space rotation, pointing in the direction of the ray.
Maximum length at which the ray is capable of detecting hits.
A radius that defines where the projection space frustum planes are located when picking.
Flags for pick selection
Full picking information of first intersection. null if no picking found.
Get the picked information by performing a ray pick from the given window location into the scene. Uses World Coordinates.
The World Coordinate where the ray is being generated.
A Quaternion with a world space rotation, pointing in the direction of the ray.
Maximum length at which the ray is capable of detecting hits.
A radius that defines where the projection space frustum planes are located when picking.
Flags for pick selection
Optional
layerMask: RenderLayersOptional mask of layers enabled for picking (default All).
Full picking information of first intersection. null if no picking found.
Get the picked information by performing a ray pick from the given window location into the scene.
Window X
Window Y
Flags for pick selection
Optional
layerMask: RenderLayersOptional mask of layers enabled for picking (default All).
Full World picking information of first intersection. null if no picking found
Return bounding box for whole scene in World Coordinates
Optional
layerMask: RenderLayersIndicates the layers used to compute the boundingBox
Calculated World Coordinates bounding box - May be empty
Internal: initialization after create or scene reset
Get the picked information by performing a ray pick from the given window location into the scene.
Camera entity used for picking.
Pick position X on camera.
Pick position Y on camera.
Max length of ray.
Radius of ray.
Flags for pick selection.
Flag for specifying what picks to return: just the first hit, all hits in an unsorted order or all hits sorted from closest to furthest.
Used to further restrict the camera's layerMask when determining the entities that can be picked.
Optional name of entity type to pick for, can be null.
Array of Full picking information.
Get the picked information by performing a ray pick from the given window location into the scene.
Camera entity used for picking.
Normalized pick position X on camera, in [0,1].
Normalized pick position Y on camera, in [0,1].
Max length of ray.
Normalized radius of ray, relative to height, in [0,1].
Flags for pick selection.
Flag for specifying what picks to return: just the first hit, all hits in an unsorted order or all hits sorted from closest to furthest.
Used to further restrict the camera's layerMask when determining the entities that can be picked.
Optional name of entity type to pick for, can be null.
Array of Full picking information.
the picked information by performing a ray pick from the given world position and orientation into the scene.
Ray start position.
Ray direction.
Max length of ray.
Radius of ray.
Flags for pick selection.
Flag for specifying what picks to return: just the first hit, all hits in an unsorted order or all hits sorted from closest to furthest.
Used to further restrict the camera's layerMask when determining the entities that can be picked.
Optional name of entity type to pick for, can be null.
Array of Full picking information.
Internal: release resources on Cogs reset.
Adjust camera to view all entities in scene. Logs error if empty scene.
Optional
layerMask: RenderLayersA set of valid layers to construct the visible bounding Box, defaults to All Standard layers
Calculated World Coordinates bounding box
class Scene: Exposed as runtime.scene
Has functionality for