CameraComponentExtensions.cs
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.
Bepu Physics:
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 resultRaycastMouse()
- 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
Bullet Physics:
- Bullet Physics -
Raycast(ScriptComponent component, ..)
,Raycast(Simulation simulation, ..)
- 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 - Bullet Physics -
RaycastMouse(ScriptComponent component, ..)
,RaycastMouse(Simulation simulation, ..)
- 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
Physics independent extension methods:
GetPickRay()
- Calculates a ray from the camera through a point on the screen in world spaceLogicDirectionToWorldDirection()
- Converts a 2D logical direction into a 3D world direction relative to the camera's orientationLogicDirectionToWorldDirection()
- Converts a 2D logical direction into a 3D world direction relative to the camera's orientation, using a specified up vectorScreenPointToRay()
- Calculates the near and far vectors for a ray that starts at the camera and passes through a given screen pointScreenToWorldPoint()
- Converts the screen position to a point in world coordinatesScreenToWorldRaySegment()
- Converts the screen position to aRaySegment
in world coordinatesScreenToWorldRaySegment()
- Converts the screen position to aRaySegment
in world coordinatesWorldToClip()
- Converts the world position to clip space coordinates relative to cameraWorldToScreenPoint()
- 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.