C# Class Nez.Camera

Inheritance: Component
Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

Свойство Type Description
farClipPlane3D float
nearClipPlane3D float
positionZ3D float

Méthodes publiques

Méthode Description
Camera ( ) : System
forceMatrixUpdate ( ) : void

this forces the matrix and bounds dirty

onEntityTransformChanged ( Transform comp ) : void
screenToWorldPoint ( Point screenPosition ) : Vector2

converts a point from screen coordinates to world

screenToWorldPoint ( Vector2 screenPosition ) : Vector2

converts a point from screen coordinates to world

setMaximumZoom ( float maxZoom ) : Camera

maximum non-scaled value (0 - float.Max) that the camera zoom can be. Defaults to 3

setMinimumZoom ( float minZoom ) : Camera

minimum non-scaled value (0 - float.Max) that the camera zoom can be. Defaults to 0.3

setPosition ( Vector2 position ) : Camera

shortcut to entity.transform.setPosition

setRotation ( float radians ) : Camera

shortcut to entity.transform.setRotation

setRotationDegrees ( float degrees ) : Camera

shortcut to entity.transform.setRotationDegrees

setZoom ( float zoom ) : Camera

sets the the zoom value which should be between -1 and 1. This value is then translated to be from minimumZoom to maximumZoom. This lets you set appropriate minimum/maximum values then use a more intuitive -1 to 1 mapping to change the zoom.

worldToScreenPoint ( Vector2 worldPosition ) : Vector2

converts a point from world coordinates to screen

zoomIn ( float deltaZoom ) : void
zoomOut ( float deltaZoom ) : void

Méthodes protégées

Méthode Description
updateMatrixes ( ) : void

Private Methods

Méthode Description
onSceneRenderTargetSizeChanged ( int newWidth, int newHeight ) : void

when the scene render target size changes we update the cameras origin and adjust the position to keep it where it was

Method Details

Camera() public méthode

public Camera ( ) : System
Résultat System

forceMatrixUpdate() public méthode

this forces the matrix and bounds dirty
public forceMatrixUpdate ( ) : void
Résultat void

onEntityTransformChanged() public méthode

public onEntityTransformChanged ( Transform comp ) : void
comp Transform
Résultat void

screenToWorldPoint() public méthode

converts a point from screen coordinates to world
public screenToWorldPoint ( Point screenPosition ) : Vector2
screenPosition Point Screen position.
Résultat Vector2

screenToWorldPoint() public méthode

converts a point from screen coordinates to world
public screenToWorldPoint ( Vector2 screenPosition ) : Vector2
screenPosition Vector2 Screen position.
Résultat Vector2

setMaximumZoom() public méthode

maximum non-scaled value (0 - float.Max) that the camera zoom can be. Defaults to 3
public setMaximumZoom ( float maxZoom ) : Camera
maxZoom float Max zoom.
Résultat Camera

setMinimumZoom() public méthode

minimum non-scaled value (0 - float.Max) that the camera zoom can be. Defaults to 0.3
public setMinimumZoom ( float minZoom ) : Camera
minZoom float
Résultat Camera

setPosition() public méthode

shortcut to entity.transform.setPosition
public setPosition ( Vector2 position ) : Camera
position Vector2
Résultat Camera

setRotation() public méthode

shortcut to entity.transform.setRotation
public setRotation ( float radians ) : Camera
radians float Radians.
Résultat Camera

setRotationDegrees() public méthode

shortcut to entity.transform.setRotationDegrees
public setRotationDegrees ( float degrees ) : Camera
degrees float Degrees.
Résultat Camera

setZoom() public méthode

sets the the zoom value which should be between -1 and 1. This value is then translated to be from minimumZoom to maximumZoom. This lets you set appropriate minimum/maximum values then use a more intuitive -1 to 1 mapping to change the zoom.
public setZoom ( float zoom ) : Camera
zoom float Zoom.
Résultat Camera

updateMatrixes() protected méthode

protected updateMatrixes ( ) : void
Résultat void

worldToScreenPoint() public méthode

converts a point from world coordinates to screen
public worldToScreenPoint ( Vector2 worldPosition ) : Vector2
worldPosition Vector2 World position.
Résultat Vector2

zoomIn() public méthode

public zoomIn ( float deltaZoom ) : void
deltaZoom float
Résultat void

zoomOut() public méthode

public zoomOut ( float deltaZoom ) : void
deltaZoom float
Résultat void

Property Details

farClipPlane3D public_oe property

far clip plane of the 3D camera projection
public float farClipPlane3D
Résultat float

nearClipPlane3D public_oe property

near clip plane of the 3D camera projection
public float nearClipPlane3D
Résultat float

positionZ3D public_oe property

z-position of the 3D camera projections. Affects the fov greatly. Lower values make the objects appear very long in the z-direction.
public float positionZ3D
Résultat float