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 scene navigation map(s). Since rays are basically objects they can be manipulated and parented (included on bones) the same way as any other objects.

Using them you can get direct collision feedback allowing you to easily create logic based on their hit(s) or miss. Rays can be used to create (ie) a laser sight, create a different type of triggers; attached to bones they can be used to control a locomotion system activation constraints etc... and a lot more.

properties_object_ray.png
properties_object_ray_preview.png

Type: Select in which space the ray will be emitted; choose between Scene, World or Maps. To enable or disable the ray evaluation toggle on/off the icon.

Length: The distance of the ray in world units.

Update Rate: The update frequency in hertz representing the number of times per second a new ray should be emitted. A value of 0 represents that the ray should be updated every frame.

Events


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

Scene Config.


properties_object_ray_scene.png

Precision: Control the precision of the ray. Low will only check for intersection with the scene objects bounding sphere, Medium their axis aligned bounding box and High the object bounding box and if geometry data is available for the data type will check for triangle intersection.

Cull Face: Enable or disable backface culling.

The bottom section allows you to create your inclusion mask. As a result the ray will only check for collision for the object data type that has been selected. In addition, an optional substring can be set to the Name Filter allowing only the object that contains part of the string to collide with the ray (like in the screenshot above only the objects that contains the keyword Door or Elevator can be intersected). To invert the name filter press the icon; in the example above this will force all objects that does not contain the substrings enumerated in the name filter to be including for raycasting.

World Config.


properties_object_ray_world.png

Single: Toggle between a single ray (the closest hit) or multiple hits which will return all the hits between the start and end position of the ray. To learn how to create a physics object please refer to the Physics section of this manual.

Cull Face: Enable or disable backface culling.

The bottom section gives you the opportunity to create a collision mask by selecting the collision layer the ray should be located on and select which layer it is allowed to collide with (collision filters).

Map Config.


properties_object_ray_map.png

Cull Face: Enable or disable backface culling.

Navigation Map: Select which existing navigation map the raycast operation should execute on. To learn how to create navigation maps please refer to the Navigation help section.




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