Ray

Ray objects allow you to cast a collision ray through the scene; you can choose to cast a collision ray against the Scene geometries (and other objects bounds), against the physic World collision bounds or against the navigation Map.

Since rays are basically objects they can be manipulated and parented the same way as any other type of Object.

Using them you can get direct collision feedback allowing you to easily create logic based on a hit or a miss. Rays can be used to create (ie) a laser sight, triggers; attached to bones they can be used to control a locomotion system activating constraints and inverse kinematics and more...

See Also

Static Variables


Name Description
object Parent Object that maintain the active Ray reference.
config Reference to the RayConfig available for the active RayType used by the Ray.
result Reference to the RayResult result based on the RayType used by the active Ray.

Variables


Name Description
fps Update rate of the active Ray in Mhz.
length Maximum distance the Ray can hit.
enabled Control wheter or not the Ray should continuously launch raycast requests.
ray_type Current RayType used by the Ray Object.
sync_time Last time the Ray was re-evaluated.

Events


The event listed below is available to any Script connected to an Object of the type Ray.

Callbacks Description
OnHit Triggered when the ray intersect with something and a contact point is available.

RayConfig


Based on the active RayType this structure allow you to access the base parameters that will be used during the raycast operation.

Static Variables


Name Description
scene Access the settings of a kSceneRay RayType Ray.
world Access the settings of a kWorldRay RayType Ray.
map Access the settings of a kMapRay RayType Ray.

SceneRayConfig


Available configuration variables when the Ray type is set to kSceneRay.

Variables


Name Description
precision The Precision qualifier to use to execute the raycast operation.
cull_face Control wheter back faces should be culled or not.
inclusion_mask Bit mask of ObjectType which represent each class that should be included during the raycast operation.
filter An optional substring that needs to be present within the Object name in order for it to be part of the raycast operation.

WorldRayConfig


Available configuration variables when the Ray type is set to kWorldRay.

Variables


Name Description
cull_face Control wheter back faces should be culled or not.
single Determine if the raycast operation should stop at the first hit or continue (multi-hit).
collisionlayer_mask Bit mask of CollisionLayer cap that define the placement of the Ray.
collisionlayer_filter Bit mask of CollisionLayer cap that defines with which layer the Ray can collide.

MapRayConfig


Available configuration variables when the Ray type is set to kMapRay.

Variables


Name Description
cull_face Control wheter back faces should be culled or not.
navigation_map Unique id of an existing Navigation Map to effectuate the raycast.

RayResult


Based on the RayType of the active Ray access the result of the raycast operation.

Static Variables


Name Description
scene Reference to a SceneRay that contains the result of kSceneRay raycast operation.
world Reference to a WorldRay that contains the result of kWorldRay raycast operation.
map Reference to a MapRay that contains the result of kMapRay raycast operation.

RayType


Available types of raycast operations that can be used by a Ray Object.

  • kSceneRay: Raycast all Geometry in the Scene.
  • kWorldRay: Raycast the physic World.
  • kMapRay: Raycast an existing navigation Map.




NRG - API 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA