Click or drag to resize
Ab4d.SharpEngine logo

CameraUtils Class

CameraUtils class contains some helper methods to work with cameras.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.UtilitiesCameraUtils

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 1.0.8740+deb2991acfe86a95cca780cd4f82bcae2805c1a5
Syntax
C#
public static class CameraUtils

The CameraUtils type exposes the following members.

Methods
 NameDescription
Public methodStatic memberCalculateCameraAngles(Vector3, CoordinateSystems, Single, Single) Calculates heading and attitude angles in degrees from lookDirection as Vector3.
Public methodStatic memberCalculateCameraAngles(Vector3, Vector3, CoordinateSystems, Single, Single, Single) Calculates heading, attitude and bank angles in degrees from lookDirection and upDirection as Vector3.
Public methodStatic memberCalculateCameraAnglesInRadians Calculates heading and attitude angles in radians from lookDirection as Vector3.
Public methodStatic memberCalculateCameraDirections Returns the lookDirection and upDirection from the specified heading, attitude and bank (angles in degrees).
Public methodStatic memberCalculateUpDirection Calculates the up direction vector from look direction vector.
Public methodStatic memberGetClosestPathStartAngle Returns an adjusted start angle so that the path to the end angle will be the shortest.
Public methodStatic memberGetCoordinateSystemInvertedTransformMatrix Gets the inverted view transformation matrix for the specified coordinate system type.
Public methodStatic memberGetCoordinateSystemTransformMatrix Gets the view transformation matrix for the specified coordinate system type.
Public methodStatic memberGetIntoTheScreenVector Gets the vector that points into the screen (forward) for the specified coordinate system type.
Public methodStatic memberGetOrthographicScreenSize GetOrthographicScreenSize calculates a size on screen (in same units as viewSize - without DPI scale) of a size in 3D space (worldSize) that is shown with orthographic camera with cameraWidth and in SceneView with viewSize.
Public methodStatic memberGetOrthographicWorldSize GetOrthographicWorldSize calculates a size in 3D world from a screen size (screenSize in screen coordinates) that is at distanceFromCamera and shown with orthographic camera with cameraWidth and in SceneView with viewSize.
Public methodStatic memberGetPerspectiveScreenSize GetPerspectiveScreenSize calculates a size on screen (in same units as viewSize - without DPI scale) of a size in 3D space (worldSize) that is at lookDirectionDistance and shown with perspective camera with fieldOfView and in SceneView with viewSize.
Public methodStatic memberGetPerspectiveWorldSize GetPerspectiveWorldSize calculates a size in 3D world from a screen size (screenSize in screen coordinates) that is at lookDirectionDistance and shown with perspective camera with fieldOfView and in SceneView with viewSize.
Public methodStatic memberGetRightDirectionVector Gets the right direction vector for the specified coordinate system type.
Public methodStatic memberGetUpVector Gets the up vector for the specified coordinate system type.
Public methodStatic memberIsClockwiseRotation Returns true if the shortest direction from startAngle to endAngle is in clockwise direction. The angles are specified in degrees.
Public methodStatic memberNormalizeAngleTo180 Returns an angle that is normalized so that it is always in range from -180 to 180 degrees. For example 270 is converted into -90; -200 is converted into 160. To get an angle in range from 0 to 360, use the NormalizeAngleTo360(Single) method.
Public methodStatic memberNormalizeAngleTo360 Returns an angle that is normalized so that it is always in range from 0 to 360 degrees. For example -90 is converted into 270; 400 is converted into 40. To get an angle in range from -180 to 180, use the NormalizeAngleTo180(Single) method.
Public methodStatic memberStrafeCamera Returns a move vector that would strafe the camera - moves it in the direction perpendicular to the camera's LookDirection and UpDirection.
Public methodStatic memberStrafeCameraOnHorizontalPlane Returns a move vector that would strafe the camera on the horizontal plane - moves it in the direction perpendicular to the camera's LookDirection and UpDirection.
Top
See Also