View Source Exray.Core.Screenspace (Exray v0.6.0)
Transform 3D positions in the world to screenspace and vice versa
Summary
Functions
Get camera transform matrix (view matrix)
Get camera 2d transform matrix
Get a ray trace from mouse position
Get the world space position for a 2d camera screen space position
Get the screen space position for a 3d world space position
Get the screen space position for a 2d camera world space position
Get size position for a 3d world space position
Functions
@spec get_camera_matrix(camera :: Exray.Structs.Camera3D.t()) :: camera_matrix :: Exray.Structs.Matrix.t()
Get camera transform matrix (view matrix)
@spec get_camera_matrix_2d(camera :: Exray.Structs.Camera2D.t()) :: camera_matrix :: Exray.Structs.Matrix.t()
Get camera 2d transform matrix
@spec get_mouse_ray( mouse_position :: Exray.Structs.Vector2.t(), camera :: Exray.Structs.Camera3D.t() ) :: mouse_ray :: Exray.Structs.Ray.t()
Get a ray trace from mouse position
@spec get_screen_to_world_2d( position :: Exray.Structs.Vector2.t(), camera :: Exray.Structs.Camera2D.t() ) :: screen_to_world :: Exray.Structs.Vector2.t()
Get the world space position for a 2d camera screen space position
@spec get_world_to_screen( position :: Exray.Structs.Vector3.t(), camera :: Exray.Structs.Camera3D.t() ) :: world_to_screen :: Exray.Structs.Vector2.t()
Get the screen space position for a 3d world space position
@spec get_world_to_screen_2d( position :: Exray.Structs.Vector2.t(), camera :: Exray.Structs.Camera2D.t() ) :: world_to_screen_2d :: Exray.Structs.Vector2.t()
Get the screen space position for a 2d camera world space position
@spec get_world_to_screen_ex( position :: Exray.Structs.Vector3.t(), camera :: Exray.Structs.Camera3D.t(), width :: integer(), height :: integer() ) :: world_to_screen_ex :: Exray.Structs.Vector2.t()
Get size position for a 3d world space position