Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
b1167732
Verified
Commit
b1167732
authored
3 years ago
by
Josch Morgenstern
Browse files
Options
Downloads
Patches
Plain Diff
[
#42
] add documentation (unvollstaendig)
parent
e30d8c8a
No related branches found
No related tags found
1 merge request
!35
Resolve "Kamera - Trackballkamera"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/camera/include/vkcv/camera/Camera.hpp
+51
-4
51 additions, 4 deletions
modules/camera/include/vkcv/camera/Camera.hpp
with
51 additions
and
4 deletions
modules/camera/include/vkcv/camera/Camera.hpp
+
51
−
4
View file @
b1167732
...
@@ -6,11 +6,18 @@
...
@@ -6,11 +6,18 @@
namespace
vkcv
{
namespace
vkcv
{
/**
* @brief Used to create a camera whose position can be changed.
*
*/
class
Camera
{
class
Camera
{
protected:
protected:
glm
::
mat4
m_view
;
glm
::
mat4
m_view
;
glm
::
mat4
m_projection
;
glm
::
mat4
m_projection
;
int
m_width
;
int
m_height
;
float
m_near
;
float
m_near
;
float
m_far
;
float
m_far
;
float
m_fov
;
float
m_fov
;
...
@@ -35,11 +42,27 @@ namespace vkcv {
...
@@ -35,11 +42,27 @@ namespace vkcv {
Camera
();
Camera
();
virtual
~
Camera
();
virtual
~
Camera
();
/**
* @brief Set the Perspective object
*
* @param fov The desired field of view in radians
* @param ratio The aspect ratio
* @param near Distance to near clipping plane
* @param far Distance to far clipping plane
*/
void
setPerspective
(
float
fov
,
float
ratio
,
float
near
,
float
far
);
void
setPerspective
(
float
fov
,
float
ratio
,
float
near
,
float
far
);
const
glm
::
mat4
getView
()
const
;
const
glm
::
mat4
getView
()
const
;
/**
* @brief Get the View object
*
* @param x
* @param y
* @param z
* @param pos
*/
void
getView
(
glm
::
vec3
&
x
,
glm
::
vec3
&
y
,
glm
::
vec3
&
z
,
glm
::
vec3
&
pos
);
void
getView
(
glm
::
vec3
&
x
,
glm
::
vec3
&
y
,
glm
::
vec3
&
z
,
glm
::
vec3
&
pos
);
glm
::
mat4
updateView
(
double
deltatime
);
glm
::
mat4
updateView
(
double
deltatime
);
...
@@ -48,20 +71,45 @@ namespace vkcv {
...
@@ -48,20 +71,45 @@ namespace vkcv {
const
glm
::
mat4
&
getProjection
()
const
;
const
glm
::
mat4
&
getProjection
()
const
;
/**
* @brief Set the Projection matrix
*
* @param projection The projection matrix (4x4)
*/
void
setProjection
(
const
glm
::
mat4
projection
);
void
setProjection
(
const
glm
::
mat4
projection
);
void
getNearFar
(
float
&
near
,
float
&
far
)
const
;
void
getNearFar
(
float
&
near
,
float
&
far
)
const
;
void
setUp
(
const
glm
::
vec3
&
Up
);
void
setUp
(
const
glm
::
vec3
&
Up
);
/**
* @brief Get the Field of view in radians
*
* @return Field of view in radians
*/
float
getFov
()
const
;
float
getFov
()
const
;
/**
* @brief Set the Field of view in radians
*
* @param fov Field of view in radians
*/
void
setFov
(
float
fov
);
void
setFov
(
float
fov
);
/**
* @brief Changes the Field of view with offset in degrees
*
* @param offset in degrees
*/
void
changeFov
(
double
fov
);
void
changeFov
(
double
fov
);
void
updateRatio
(
float
ratio
);
void
updateRatio
(
float
ratio
);
/**
* @brief Get the Ratio
*
* @return float aspect ratio
*/
float
getRatio
()
const
;
float
getRatio
()
const
;
void
setNearFar
(
float
near
,
float
far
);
void
setNearFar
(
float
near
,
float
far
);
...
@@ -92,7 +140,6 @@ namespace vkcv {
...
@@ -92,7 +140,6 @@ namespace vkcv {
void
moveRight
(
int
action
);
void
moveRight
(
int
action
);
};
};
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment