Summary
Converts the screen position to a point in world coordinates.
- Namespace
- StrideToolkit
.Engine - Containing Type
- CameraExtensions
Syntax
public static void ScreenToWorldPoint(this CameraComponent cameraComponent, ref Vector3 position, out Vector3 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 | Vector3 | The screen position in normalized X, Y coordinates. Top-left is (0,0), bottom-right is (1,1). Z is in world units from near camera plane. |
result | Vector3 | Position in world coordinates. |
Return Value
Type | Description |
---|---|
void |