Space Engineers
Public Member Functions | Public Attributes | Properties | List of all members
VRage.Game.Utils.MyCamera Class Reference
Inheritance diagram for VRage.Game.Utils.MyCamera:
VRage.ModAPI.IMyCamera

Public Member Functions

 MyCamera (float fieldOfView, MyViewport currentScreenViewport)
 
void Update (float updateStepTime)
 
void UpdateScreenSize (MyViewport currentScreenViewport)
 
void SetViewMatrix (MatrixD newViewMatrix)
 
void UploadViewMatrixToRender ()
 
bool IsInFrustum (ref BoundingBoxD boundingBox)
 
bool IsInFrustum (BoundingBoxD boundingBox)
 
bool IsInFrustum (ref BoundingSphereD boundingSphere)
 
double GetDistanceFromPoint (Vector3D position)
 
Vector3D WorldToScreen (ref Vector3D worldPos)
 Gets screen coordinates of 3d world pos in 0 - 1 distance where 1.0 is screen width(for X) or height(for Y). WARNING: Y is from bottom to top. More...
 
LineD WorldLineFromScreen (Vector2 screenCoords)
 Gets normalized world space line from screen space coordinates. More...
 
- Public Member Functions inherited from VRage.ModAPI.IMyCamera
double GetDistanceWithFOV (VRageMath.Vector3D position)
 
bool IsInFrustum (ref VRageMath.BoundingBoxD boundingBox)
 
bool IsInFrustum (ref VRageMath.BoundingSphereD boundingSphere)
 
bool IsInFrustum (VRageMath.BoundingBoxD boundingBox)
 

Public Attributes

const float DefaultFarPlaneDistance = 20000
 
float NearPlaneDistance = 0.05f
 
float FarPlaneDistance = DefaultFarPlaneDistance
 
float FieldOfView
 
Vector3D PreviousPosition
 
MyViewport Viewport
 
MatrixD WorldMatrix = MatrixD.Identity
 
MatrixD ViewMatrix = MatrixD.Identity
 
MatrixD ProjectionMatrix = MatrixD.Identity
 
MatrixD ProjectionMatrixFar = MatrixD.Identity
 
MatrixD ViewProjectionMatrix = MatrixD.Identity
 
MatrixD ViewProjectionMatrixFar = MatrixD.Identity
 
BoundingBoxD BoundingBox
 
BoundingSphereD BoundingSphere
 
MyCameraZoomProperties Zoom
 
BoundingFrustumD BoundingFrustum = new BoundingFrustumD(MatrixD.Identity)
 
BoundingFrustumD BoundingFrustumFar = new BoundingFrustumD(MatrixD.Identity)
 
readonly MyCameraShake CameraShake = new MyCameraShake()
 Member that shakes with the camera. Note: If we start to have more cameras in the scene, this should be changed to component, because not every camera needs it. But currently - we use just one camera, so it is a member. More...
 
readonly MyCameraSpring CameraSpring = new MyCameraSpring()
 Member that implements camera spring. Note: If we start to have more cameras in the scene, this should be changed to component, because not every camera needs it. But currently - we use just one camera, so it is a member. More...
 

Properties

float AspectRatio [get]
 
MatrixD ViewMatrixAtZero [get]
 Current view matrix without translation part. More...
 
Vector3 ForwardVector [get]
 Forward vector of camera world matrix ("ahead from camera") More...
 
Vector3 LeftVector [get]
 Left vector of camera world matrix ("to the left from camera") More...
 
Vector3 UpVector [get]
 Up vector of camera world matrix ("up from camera") More...
 
float FieldOfViewDegrees [get, set]
 Field of view in degrees. More...
 
float FovWithZoom [get]
 Gets current fov with considering if zoom is enabled More...
 
Vector3D Position [get]
 Get position of the camera. More...
 
- Properties inherited from VRage.ModAPI.IMyCamera
Vector3D Position [get]
 
Vector3D PreviousPosition [get]
 
Vector2 ViewportOffset [get]
 
Vector2 ViewportSize [get]
 
MatrixD ViewMatrix [get]
 
MatrixD WorldMatrix [get]
 
MatrixD ProjectionMatrix [get]
 
float NearPlaneDistance [get]
 
float FarPlaneDistance [get]
 
float NearForNearObjects [get]
 
float FarForNearObjects [get]
 
float FieldOfViewAngle [get]
 
float FovWithZoom [get]
 
MatrixD ProjectionMatrixForNearObjects [get]
 
float FieldOfViewAngleForNearObjects [get]
 
float FovWithZoomForNearObjects [get]
 

Detailed Description

Definition at line 16 of file MyCamera.cs.

Constructor & Destructor Documentation

VRage.Game.Utils.MyCamera.MyCamera ( float  fieldOfView,
MyViewport  currentScreenViewport 
)
inline

Definition at line 138 of file MyCamera.cs.

Member Function Documentation

double VRage.Game.Utils.MyCamera.GetDistanceFromPoint ( Vector3D  position)
inline

Definition at line 276 of file MyCamera.cs.

bool VRage.Game.Utils.MyCamera.IsInFrustum ( ref BoundingBoxD  boundingBox)
inline

Definition at line 254 of file MyCamera.cs.

bool VRage.Game.Utils.MyCamera.IsInFrustum ( BoundingBoxD  boundingBox)
inline

Definition at line 261 of file MyCamera.cs.

bool VRage.Game.Utils.MyCamera.IsInFrustum ( ref BoundingSphereD  boundingSphere)
inline

Definition at line 269 of file MyCamera.cs.

void VRage.Game.Utils.MyCamera.SetViewMatrix ( MatrixD  newViewMatrix)
inline

Definition at line 186 of file MyCamera.cs.

void VRage.Game.Utils.MyCamera.Update ( float  updateStepTime)
inline

Definition at line 145 of file MyCamera.cs.

void VRage.Game.Utils.MyCamera.UpdateScreenSize ( MyViewport  currentScreenViewport)
inline

Definition at line 176 of file MyCamera.cs.

void VRage.Game.Utils.MyCamera.UploadViewMatrixToRender ( )
inline

Definition at line 192 of file MyCamera.cs.

LineD VRage.Game.Utils.MyCamera.WorldLineFromScreen ( Vector2  screenCoords)
inline

Gets normalized world space line from screen space coordinates.

Parameters
screenCoords
Returns

Implements VRage.ModAPI.IMyCamera.

Definition at line 297 of file MyCamera.cs.

Vector3D VRage.Game.Utils.MyCamera.WorldToScreen ( ref Vector3D  worldPos)
inline

Gets screen coordinates of 3d world pos in 0 - 1 distance where 1.0 is screen width(for X) or height(for Y). WARNING: Y is from bottom to top.

Parameters
worldPosWorld position.
Returns
Screen coordinate in 0-1 distance.

Implements VRage.ModAPI.IMyCamera.

Definition at line 287 of file MyCamera.cs.

Member Data Documentation

BoundingBoxD VRage.Game.Utils.MyCamera.BoundingBox

Definition at line 47 of file MyCamera.cs.

BoundingFrustumD VRage.Game.Utils.MyCamera.BoundingFrustum = new BoundingFrustumD(MatrixD.Identity)

Definition at line 52 of file MyCamera.cs.

BoundingFrustumD VRage.Game.Utils.MyCamera.BoundingFrustumFar = new BoundingFrustumD(MatrixD.Identity)

Definition at line 53 of file MyCamera.cs.

BoundingSphereD VRage.Game.Utils.MyCamera.BoundingSphere

Definition at line 48 of file MyCamera.cs.

readonly MyCameraShake VRage.Game.Utils.MyCamera.CameraShake = new MyCameraShake()

Member that shakes with the camera. Note: If we start to have more cameras in the scene, this should be changed to component, because not every camera needs it. But currently - we use just one camera, so it is a member.

Definition at line 62 of file MyCamera.cs.

readonly MyCameraSpring VRage.Game.Utils.MyCamera.CameraSpring = new MyCameraSpring()

Member that implements camera spring. Note: If we start to have more cameras in the scene, this should be changed to component, because not every camera needs it. But currently - we use just one camera, so it is a member.

Definition at line 68 of file MyCamera.cs.

const float VRage.Game.Utils.MyCamera.DefaultFarPlaneDistance = 20000

Definition at line 19 of file MyCamera.cs.

float VRage.Game.Utils.MyCamera.FarPlaneDistance = DefaultFarPlaneDistance

Definition at line 32 of file MyCamera.cs.

float VRage.Game.Utils.MyCamera.FieldOfView

Definition at line 35 of file MyCamera.cs.

float VRage.Game.Utils.MyCamera.NearPlaneDistance = 0.05f

Definition at line 28 of file MyCamera.cs.

Vector3D VRage.Game.Utils.MyCamera.PreviousPosition

Definition at line 38 of file MyCamera.cs.

MatrixD VRage.Game.Utils.MyCamera.ProjectionMatrix = MatrixD.Identity

Definition at line 43 of file MyCamera.cs.

MatrixD VRage.Game.Utils.MyCamera.ProjectionMatrixFar = MatrixD.Identity

Definition at line 44 of file MyCamera.cs.

MatrixD VRage.Game.Utils.MyCamera.ViewMatrix = MatrixD.Identity

Definition at line 42 of file MyCamera.cs.

MyViewport VRage.Game.Utils.MyCamera.Viewport

Definition at line 40 of file MyCamera.cs.

MatrixD VRage.Game.Utils.MyCamera.ViewProjectionMatrix = MatrixD.Identity

Definition at line 45 of file MyCamera.cs.

MatrixD VRage.Game.Utils.MyCamera.ViewProjectionMatrixFar = MatrixD.Identity

Definition at line 46 of file MyCamera.cs.

MatrixD VRage.Game.Utils.MyCamera.WorldMatrix = MatrixD.Identity

Definition at line 41 of file MyCamera.cs.

MyCameraZoomProperties VRage.Game.Utils.MyCamera.Zoom

Definition at line 50 of file MyCamera.cs.

Property Documentation

float VRage.Game.Utils.MyCamera.AspectRatio
get

Definition at line 55 of file MyCamera.cs.

float VRage.Game.Utils.MyCamera.FieldOfViewDegrees
getset

Field of view in degrees.

Definition at line 115 of file MyCamera.cs.

Vector3 VRage.Game.Utils.MyCamera.ForwardVector
get

Forward vector of camera world matrix ("ahead from camera")

Definition at line 93 of file MyCamera.cs.

float VRage.Game.Utils.MyCamera.FovWithZoom
get

Gets current fov with considering if zoom is enabled

Definition at line 124 of file MyCamera.cs.

Vector3 VRage.Game.Utils.MyCamera.LeftVector
get

Left vector of camera world matrix ("to the left from camera")

Definition at line 100 of file MyCamera.cs.

Vector3D VRage.Game.Utils.MyCamera.Position
get

Get position of the camera.

Definition at line 132 of file MyCamera.cs.

Vector3 VRage.Game.Utils.MyCamera.UpVector
get

Up vector of camera world matrix ("up from camera")

Definition at line 107 of file MyCamera.cs.

MatrixD VRage.Game.Utils.MyCamera.ViewMatrixAtZero
get

Current view matrix without translation part.

Definition at line 74 of file MyCamera.cs.


The documentation for this class was generated from the following file: