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
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. |
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. |
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. |
Based on the active RayType this structure allow you to access the base parameters that will be used during the raycast operation.
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. |
Available configuration variables when the Ray type
is set to kSceneRay
.
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. |
Available configuration variables when the Ray type
is set to kWorldRay
.
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. |
Available configuration variables when the Ray type
is set to kMapRay
.
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. |
Based on the RayType of the active Ray access the result of the raycast operation.
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. |
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.
|