Table of Contents

CameraComponentExtensions.cs

Done

These extensions provide powerful and convenient ways to interact with the camera, transforming coordinates between different spaces, performing raycasting, and handling user inputs for dynamic camera control. Whether you are implementing complex camera behaviors or simply looking to streamline common camera operations, these extensions are designed to make your development process more efficient and intuitive.

Below is a list of available extension methods:

  • GetPickRay() - Calculates a ray from the camera through a point on the screen in world space
  • LogicDirectionToWorldDirection() - Converts a 2D logical direction into a 3D world direction relative to the camera's orientation
  • LogicDirectionToWorldDirection() - Converts a 2D logical direction into a 3D world direction relative to the camera's orientation, using a specified up vector
  • Raycast() - Performs a raycasting operation from the specified CameraComponent's position through the specified screen position in world coordinates, and returns information about the hit result
  • RaycastMouse() - Performs a raycasting operation from the specified CameraComponent's position through the mouse cursor position in screen coordinates, and returns information about the hit result
  • ScreenPointToRay() - Calculates the near and far vectors for a ray that starts at the camera and passes through a given screen point
  • ScreenToWorldPoint() - Converts the screen position to a point in world coordinates
  • ScreenToWorldRaySegment() - Converts the screen position to a RaySegment in world coordinates
  • ScreenToWorldRaySegment() - Converts the screen position to a RaySegment in world coordinates
  • WorldToClip() - Converts the world position to clip space coordinates relative to camera
  • WorldToScreenPoint() - Converts the world position to screen space coordinates relative to camera

Each of these methods is designed to offer streamlined, high-level operations that simplify camera manipulation tasks, allowing you to focus on creating immersive and dynamic 3D environments.