Interface IMyCamera
Describes camera (mods interface)
Namespace: VRage.ModAPI
Assembly: VRage.Game.dll
Syntax
public interface IMyCamera
Properties
FarPlaneDistance
Gets farplane is set by MyObjectBuilder_SessionSettings.ViewDistance
Declaration
float FarPlaneDistance { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
FieldOfViewAngle
Gets field of view angle in degrees
Declaration
float FieldOfViewAngle { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
FieldOfViewAngleForNearObjects
Declaration
float FieldOfViewAngleForNearObjects { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
FovWithZoom
Gets field of view with zoom
Declaration
float FovWithZoom { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
FovWithZoomForNearObjects
Declaration
float FovWithZoomForNearObjects { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
NearPlaneDistance
Gets near plane distance
Declaration
float NearPlaneDistance { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Position
Gets camera position
Declaration
Vector3D Position { get; }
Property Value
| Type | Description |
|---|---|
| Vector3D |
PreviousPosition
Gets camera previous position
Declaration
Vector3D PreviousPosition { get; }
Property Value
| Type | Description |
|---|---|
| Vector3D |
ProjectionMatrix
Gets projection matrix
Declaration
MatrixD ProjectionMatrix { get; }
Property Value
| Type | Description |
|---|---|
| MatrixD |
ProjectionMatrixForNearObjects
Declaration
MatrixD ProjectionMatrixForNearObjects { get; }
Property Value
| Type | Description |
|---|---|
| MatrixD |
ViewMatrix
Gets view matrix when camera in real position
Declaration
MatrixD ViewMatrix { get; }
Property Value
| Type | Description |
|---|---|
| MatrixD |
ViewportOffset
Gets camera viewport offset
Declaration
Vector2 ViewportOffset { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
ViewportSize
Gets camera viewport size
Declaration
Vector2 ViewportSize { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
WorldMatrix
Gets camera world matrix
Declaration
MatrixD WorldMatrix { get; }
Property Value
| Type | Description |
|---|---|
| MatrixD |
Methods
GetDistanceWithFOV(Vector3D)
Gets distance from point. Equals to Distance(Vector3D, Vector3D)
Declaration
double GetDistanceWithFOV(Vector3D position)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3D | position | Another point |
Returns
| Type | Description |
|---|---|
| System.Double | Distance in meters |
IsInFrustum(BoundingBoxD)
Checks if specified bounding box is in actual bounding frustum IMPORTANT: If you observe bad result of this test, check how you transform your bounding box. Don't use BoundingBox.Transform. Instead transform box manualy and then create new box.
Declaration
bool IsInFrustum(BoundingBoxD boundingBox)
Parameters
| Type | Name | Description |
|---|---|---|
| BoundingBoxD | boundingBox | Bounding box to check |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether specified bounding box is in actual bounding frustum |
IsInFrustum(ref BoundingBoxD)
Checks if specified bounding box is in actual bounding frustum IMPORTANT: If you observe bad result of this test, check how you transform your bounding box. Don't use BoundingBox.Transform. Instead transform box manualy and then create new box.
Declaration
bool IsInFrustum(ref BoundingBoxD boundingBox)
Parameters
| Type | Name | Description |
|---|---|---|
| BoundingBoxD | boundingBox | Bounding box to check |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether specified bounding box is in actual bounding frustum |
IsInFrustum(ref BoundingSphereD)
Checks if specified bounding sphere is in actual bounding frustum IMPORTANT: If you observe bad result of this test, check how you transform your bounding sphere. Don't use BoundingSphere.Transform. Instead transform sphere center manualy and then create new sphere.
Declaration
bool IsInFrustum(ref BoundingSphereD boundingSphere)
Parameters
| Type | Name | Description |
|---|---|---|
| BoundingSphereD | boundingSphere |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether specified bounding box is in actual bounding frustum |
WorldLineFromScreen(Vector2)
Gets normalized world space line from screen space coordinates.
Declaration
LineD WorldLineFromScreen(Vector2 screenCoords)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | screenCoords |
Returns
| Type | Description |
|---|---|
| LineD | Gets normalized world space line |
WorldToScreen(ref Vector3D)
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.
Declaration
Vector3D WorldToScreen(ref Vector3D worldPos)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3D | worldPos | World position. |
Returns
| Type | Description |
|---|---|
| Vector3D | Screen coordinate in 0-1 distance. |