Plasma Engine  2.0
Loading...
Searching...
No Matches
Camera_inl.h
1#pragma once
2
4{
5 if (m_Mode == plCameraMode::Stereo)
6 return (GetPosition(plCameraEye::Left) + GetPosition(plCameraEye::Right)) * 0.5f;
7 else
8 return GetPosition();
9}
10
12{
13 if (m_Mode == plCameraMode::Stereo)
14 return (GetDirForwards(plCameraEye::Left) + GetDirForwards(plCameraEye::Right)).GetNormalized();
15 else
16 return GetDirForwards();
17}
18
20{
21 if (m_Mode == plCameraMode::Stereo)
22 return (GetDirUp(plCameraEye::Left) + GetDirUp(plCameraEye::Right)).GetNormalized();
23 else
24 return GetDirUp();
25}
26
28{
29 if (m_Mode == plCameraMode::Stereo)
30 return (GetDirRight(plCameraEye::Left) + GetDirRight(plCameraEye::Right)).GetNormalized();
31 else
32 return GetDirRight();
33}
34
35PL_ALWAYS_INLINE float plCamera::GetNearPlane() const
36{
37 return m_fNearPlane;
38}
39
40PL_ALWAYS_INLINE float plCamera::GetFarPlane() const
41{
42 return m_fFarPlane;
43}
44
45PL_ALWAYS_INLINE float plCamera::GetFovOrDim() const
46{
47 return m_fFovOrDim;
48}
49
51{
52 return m_Mode;
53}
54
55PL_ALWAYS_INLINE bool plCamera::IsPerspective() const
56{
58 m_Mode == plCameraMode::Stereo; // All HMD stereo cameras are perspective!
59}
60
61PL_ALWAYS_INLINE bool plCamera::IsOrthographic() const
62{
64}
65
66PL_ALWAYS_INLINE bool plCamera::IsStereoscopic() const
67{
68 return m_Mode == plCameraMode::Stereo;
69}
70
71PL_ALWAYS_INLINE float plCamera::GetShutterSpeed() const
72{
73 return m_fShutterSpeed;
74}
75
76PL_ALWAYS_INLINE void plCamera::SetShutterSpeed(float fShutterSpeed)
77{
78 m_fShutterSpeed = fShutterSpeed;
79}
80
81PL_ALWAYS_INLINE float plCamera::GetExposure() const
82{
83 return m_fExposure;
84}
85
86PL_ALWAYS_INLINE void plCamera::SetExposure(float fExposure)
87{
88 m_fExposure = fExposure;
89}
90
91PL_ALWAYS_INLINE float plCamera::GetAperture() const
92{
93 return m_fAperture;
94}
95
96PL_ALWAYS_INLINE void plCamera::SetAperture(float fAperture)
97{
98 m_fAperture = fAperture;
99}
100
101PL_ALWAYS_INLINE float plCamera::GetISO() const
102{
103 return m_fISO;
104}
105
106PL_ALWAYS_INLINE void plCamera::SetISO(float fISO)
107{
108 m_fISO = fISO;
109}
110
111
112PL_ALWAYS_INLINE float plCamera::GetFocusDistance() const
113{
114 return m_fFocusDistance;
115}
116
117PL_ALWAYS_INLINE void plCamera::SetFocusDistance(float fFocusDistance)
118{
119 m_fFocusDistance = fFocusDistance;
120}
121
122PL_ALWAYS_INLINE const plMat4& plCamera::GetViewMatrix(plCameraEye eye) const
123{
124 return m_mViewMatrix[static_cast<int>(eye)];
125}
plVec3 GetPosition(plCameraEye eye=plCameraEye::Left) const
Returns the position of the camera that should be used for rendering etc.
Definition Camera.cpp:63
plVec3 GetCenterDirForwards() const
Returns the average forwards vector.
Definition Camera_inl.h:11
plVec3 GetCenterDirRight() const
Returns the average right vector.
Definition Camera_inl.h:27
float GetFovOrDim() const
Returns the fFovOrDim parameter that was passed to SetCameraProjectionAndMode().
Definition Camera_inl.h:45
plVec3 GetCenterDirUp() const
Returns the average up vector.
Definition Camera_inl.h:19
const plMat4 & GetViewMatrix(plCameraEye eye=plCameraEye::Left) const
Returns the view matrix for the given eye.
Definition Camera_inl.h:122
plVec3 GetDirForwards(plCameraEye eye=plCameraEye::Left) const
Returns the forwards vector that should be used for rendering etc.
Definition Camera.cpp:68
plVec3 GetCenterPosition() const
Returns the average camera position.
Definition Camera_inl.h:3
bool IsStereoscopic() const
Whether this is a stereoscopic camera.
Definition Camera_inl.h:66
plVec3 GetDirRight(plCameraEye eye=plCameraEye::Left) const
Returns the right vector that should be used for rendering etc.
Definition Camera.cpp:84
float GetNearPlane() const
Returns the near plane distance that was passed to SetCameraProjectionAndMode().
Definition Camera_inl.h:35
float GetFarPlane() const
Returns the far plane distance that was passed to SetCameraProjectionAndMode().
Definition Camera_inl.h:40
plVec3 GetDirUp(plCameraEye eye=plCameraEye::Left) const
Returns the up vector that should be used for rendering etc.
Definition Camera.cpp:76
plCameraMode::Enum GetCameraMode() const
Returns the current camera mode.
Definition Camera_inl.h:50
PL_DECLARE_IF_FLOAT_TYPE const plVec3Template< Type > GetNormalized() const
Returns a normalized version of this vector, leaves the vector itself unchanged.
Definition Vec3_inl.h:86
Enum
Definition Camera.h:16
@ PerspectiveFixedFovY
Perspective camera, the fov for Y is fixed, X depends on the aspect ratio.
Definition Camera.h:19
@ PerspectiveFixedFovX
Perspective camera, the fov for X is fixed, Y depends on the aspect ratio.
Definition Camera.h:18
@ Stereo
A stereo camera with view/projection matrices provided by an HMD.
Definition Camera.h:22
@ OrthoFixedWidth
Orthographic camera, the width is fixed, the height depends on the aspect ratio.
Definition Camera.h:20
@ OrthoFixedHeight
Orthographic camera, the height is fixed, the width depends on the aspect ratio.
Definition Camera.h:21