forked from ScruffyFurn/SumoDX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCamera.h
52 lines (42 loc) · 1.58 KB
/
Camera.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//// PARTICULAR PURPOSE.
////
//// Copyright (c) Microsoft Corporation. All rights reserved
#pragma once
// Camera:
// This class defines the position, orientation and viewing frustum of a camera looking into
// a 3D world. It will generate both the View matrix and Projection matrix.
ref class Camera
{
internal:
Camera();
void SetViewParams(_In_ DirectX::XMFLOAT3 eye, _In_ DirectX::XMFLOAT3 lookAt, _In_ DirectX::XMFLOAT3 up);
void SetProjParams(_In_ float fieldOfView, _In_ float aspectRatio, _In_ float nearPlane, _In_ float farPlane);
void LookDirection (_In_ DirectX::XMFLOAT3 lookDirection);
void Eye (_In_ DirectX::XMFLOAT3 position);
DirectX::XMMATRIX View();
DirectX::XMMATRIX Projection();
DirectX::XMMATRIX World();
DirectX::XMFLOAT3 Eye();
DirectX::XMFLOAT3 LookAt();
DirectX::XMFLOAT3 Up();
float NearClipPlane();
float FarClipPlane();
float Pitch();
float Yaw();
protected private:
DirectX::XMFLOAT4X4 m_viewMatrix;
DirectX::XMFLOAT4X4 m_projectionMatrix;
DirectX::XMFLOAT4X4 m_inverseView;
DirectX::XMFLOAT3 m_eye;
DirectX::XMFLOAT3 m_lookAt;
DirectX::XMFLOAT3 m_up;
float m_cameraYawAngle;
float m_cameraPitchAngle;
float m_fieldOfView;
float m_aspectRatio;
float m_nearPlane;
float m_farPlane;
};