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