C# 클래스 world3D.Camera

Represents a camera - an imaginary observer of a scene in 3D space. The camera uses perspective projection.
파일 보기 프로젝트 열기: denniskb/asvo_cuda

공개 메소드들

메소드 설명
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).

메소드 상세

Camera() 공개 메소드

Constructs a new camera with common properties.
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)

getEyeVector() 공개 메소드

Returns the eye vector. That's a normalized vector pointing from the look-at point towards the camera's position.
public getEyeVector ( ) : Vector3
리턴 Vector3

getFov() 공개 메소드

Returns the field of vision of this camera in radians.
public getFov ( ) : float
리턴 float

getLookAt() 공개 메소드

Returns the camera's look-at point.
public getLookAt ( ) : Vector3
리턴 Vector3

getPosition() 공개 메소드

Returns the camera's position.
public getPosition ( ) : Vector3
리턴 Vector3

getProjectionMatrix() 공개 메소드

Returns the projection matrix of this camera.
public getProjectionMatrix ( ) : Matrix
리턴 Matrix

getViewMatrix() 공개 메소드

Returns the view matrix of this camera.
public getViewMatrix ( ) : Matrix
리턴 Matrix

getViewProjectionMatrix() 공개 메소드

Retuns the view matrix multiplied by the projection matrix.
public getViewProjectionMatrix ( ) : Matrix
리턴 Matrix

setFov() 공개 메소드

Sets the field of vision of the camera in radians.
public setFov ( float newFov ) : void
newFov float Field of vision in radians.
리턴 void

setLookAt() 공개 메소드

Sets the point the camera looks-at.
public setLookAt ( Vector3 newLookAt ) : void
newLookAt Vector3 The new look-at point.
리턴 void

setPosition() 공개 메소드

Sets the camera's position.
public setPosition ( Vector3 newPosition ) : void
newPosition Vector3 The camera's new position.
리턴 void

update() 공개 메소드

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.
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