Summary
Converts the screen position to a
RaySegment
in world coordinates.
- Namespace
- StrideToolkit
.Engine - Containing Type
- CameraExtensions
Syntax
public static void ScreenToWorldRaySegment(this CameraComponent cameraComponent, ref Vector2 position, out RaySegment result)
Remarks
This method does not update the
CameraComponent.ViewMatrix
or CameraComponent.ProjectionMatrix
before performing the transformation.
If the CameraComponent
or it's containing Entity
TransformComponent
has been modified since the last frame you may need to call the CameraComponent.Update()
method first.
Parameters
Name | Type | Description |
---|---|---|
cameraComponent | CameraComponent | |
position | Vector2 | |
result | RaySegment | RaySegment , starting at near plain and ending at the far plain. |
Return Value
Type | Description |
---|---|
void |