메소드 | 설명 | |
---|---|---|
Camera ( float nearPlane, float farPlane, Vector3 pos, Vector3 lookAt, float ratio ) |
Constructs a new camera with common properties.
|
|
getEyeVector ( ) : Vector3 |
Returns the eye vector. That's a normalized vector pointing from the look-at point towards the camera's position.
|
|
getFov ( ) : float |
Returns the field of vision of this camera in radians.
|
|
getLookAt ( ) : Vector3 |
Returns the camera's look-at point.
|
|
getPosition ( ) : Vector3 |
Returns the camera's position.
|
|
getProjectionMatrix ( ) : Matrix |
Returns the projection matrix of this camera.
|
|
getViewMatrix ( ) : Matrix |
Returns the view matrix of this camera.
|
|
getViewProjectionMatrix ( ) : Matrix |
Retuns the view matrix multiplied by the projection matrix.
|
|
setFov ( float newFov ) : void |
Sets the field of vision of the camera in radians.
|
|
setLookAt ( Vector3 newLookAt ) : void |
Sets the point the camera looks-at.
|
|
setPosition ( Vector3 newPosition ) : void |
Sets the camera's position.
|
|
update ( GameTime time, int horRes, int vertRes ) : void |
Used to animate camera movement which is caused by user input. The user can steer the camera with the mouse: By clicking and holding the left mouse button and then dragging the mouse, the camera will rotate around its look-at point. The scroll wheel can be used to zoom in and out of the scene. Note: Scrolling doesn't change the camera's fov, but its distance from its look-at position.
|
메소드 | 설명 | |
---|---|---|
updateMatrices ( ) : void |
Caches the view, projection and viewProjection matrices after each change to data which they depend on (like position for example).
|
public Camera ( float nearPlane, float farPlane, Vector3 pos, Vector3 lookAt, float ratio ) | ||
nearPlane | float | Near clipping plane distance. |
farPlane | float | Far clipping plane distance. |
pos | Vector3 | Position of the camera. |
lookAt | Vector3 | Target the camera is pointing at. |
ratio | float | Aspect ratio of the projection (width/height) |
public setFov ( float newFov ) : void | ||
newFov | float | Field of vision in radians. |
리턴 | void |
public setLookAt ( Vector3 newLookAt ) : void | ||
newLookAt | Vector3 | The new look-at point. |
리턴 | void |
public setPosition ( Vector3 newPosition ) : void | ||
newPosition | Vector3 | The camera's new position. |
리턴 | void |
public update ( GameTime time, int horRes, int vertRes ) : void | ||
time | GameTime | Elapsed time since last frame. |
horRes | int | Horizontal resolution of the screen. |
vertRes | int | Vertical resolution of the screen. |
리턴 | void |