Class SceneRayCaster
Implements the scene raycaster.
Inheritance
Implements
Inherited Members
Namespace: Fusee.Engine.Core
Assembly: Fusee.Engine.Core.dll
Syntax
public class SceneRayCaster : Viserator<RayCastResult, SceneRayCaster.RayCasterState, SceneNode, SceneComponent>, IEnumerator<RayCastResult>, IEnumerator, IDisposable
Constructors
SceneRayCaster(SceneContainer, Cull)
The constructor to initialize a new SceneRayCaster.
Declaration
public SceneRayCaster(SceneContainer scene, Cull cullMode = Cull.None)
Parameters
Type | Name | Description |
---|---|---|
SceneContainer | scene | The SceneContainer to use. |
Cull | cullMode | The Cull mode to use. |
Fields
_sc
The SceneContainer, containing the scene that gets rendered.
Declaration
protected SceneContainer _sc
Field Value
Type | Description |
---|---|
SceneContainer |
Properties
CullMode
The Cull mode to use by the SceneRayCaster
Declaration
public Cull CullMode { get; }
Property Value
Type | Description |
---|---|
Cull |
Ray
The RayF to check intersections with.
Declaration
public RayF Ray { get; }
Property Value
Type | Description |
---|---|
RayF |
Methods
HitMesh(Mesh)
Creates a raycast result from a given mesh if it is hit by the ray.
Declaration
public void HitMesh(Mesh mesh)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | The given mesh. |
InitState()
This method is called when traversal starts to initialize the traversal state.
Declaration
protected override void InitState()
Overrides
RayCast(RayF)
Returns a collection of objects that are hit by the ray and that can be iterated over.
Declaration
public IEnumerable<RayCastResult> RayCast(RayF ray)
Parameters
Type | Name | Description |
---|---|---|
RayF | ray | The ray to test. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<RayCastResult> | A collection of RayCastResult that can be iterated over. |
RayPick(RenderContext, float2)
Returns a collection of objects that are hit by the ray and that can be iterated over.
Declaration
public IEnumerable<RayCastResult> RayPick(RenderContext rc, float2 pickPos)
Parameters
Type | Name | Description |
---|---|---|
RenderContext | rc | |
float2 | pickPos |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<RayCastResult> |
RenderTransform(Transform)
If a TransformComponent is visited the model matrix of the RenderContext and SceneRayCaster.RayCasterState is updated.
Declaration
public void RenderTransform(Transform transform)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The TransformComponent. |