Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
acgl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
ACGL
acgl
Commits
ae2c3d70
Commit
ae2c3d70
authored
11 years ago
by
Philip Trettner
Browse files
Options
Downloads
Patches
Plain Diff
fixed camera classes
parent
6bd62675
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ACGL/Scene/CameraBase.hh
+19
-1
19 additions, 1 deletion
include/ACGL/Scene/CameraBase.hh
include/ACGL/Scene/FixedCamera.hh
+15
-5
15 additions, 5 deletions
include/ACGL/Scene/FixedCamera.hh
with
34 additions
and
6 deletions
include/ACGL/Scene/CameraBase.hh
+
19
−
1
View file @
ae2c3d70
...
...
@@ -7,6 +7,9 @@ namespace Scene{
/**
* @brief Common interface for cameras
*
* This interface only contains getter on purpose.
* All logic that wants to modify a camera should know the actual structure of the camera and therefore use the specific subclass.
*/
class
CameraBase
{
...
...
@@ -15,10 +18,25 @@ protected:
public:
virtual
~
CameraBase
();
// interface:
/**
* @brief gets the Position of the camera
* @return a 3-dimensional position in the global coordinate system
*/
virtual
glm
::
vec3
getPosition
()
const
=
0
;
/**
* @brief gets the ViewMatrix of the camera
* @return a 4x4 matrix containing projection independent camera transforms
*/
virtual
glm
::
mat4
getViewMatrix
()
const
=
0
;
/**
* @brief gets the ProjectionMatrix of the camera
* @return a 4x4 matrix containing the projection into normalized device coordinates
*/
virtual
glm
::
mat4
getProjectionMatrix
()
const
=
0
;
/**
* @brief gets the ViewportSize of the current viewport of this camera
* @return the 2-dimensional size of the viewport
*/
virtual
glm
::
uvec2
getViewportSize
()
const
=
0
;
};
...
...
This diff is collapsed.
Click to expand it.
include/ACGL/Scene/FixedCamera.hh
+
15
−
5
View file @
ae2c3d70
#pragma once
#include
<Common/ClassHelper.hh>
#include
"CameraBase.hh"
namespace
ACGL
{
...
...
@@ -23,10 +22,21 @@ public:
FixedCamera
();
FixedCamera
(
const
glm
::
vec3
&
_pos
,
const
glm
::
mat4
&
_view
,
const
glm
::
mat4
&
_proj
,
const
glm
::
uvec2
&
_viewport
);
CLASS_GETTER_SETTER2
(
glm
::
vec3
,
Position
)
CLASS_GETTER_SETTER2
(
glm
::
mat4
,
ViewMatrix
)
CLASS_GETTER_SETTER2
(
glm
::
mat4
,
ProjectionMatrix
)
CLASS_GETTER_SETTER2
(
glm
::
uvec2
,
ViewportSize
)
// Getter, Setter for Camera Position
virtual
glm
::
vec3
getPosition
()
const
{
return
mPosition
;
}
virtual
void
setPosition
(
glm
::
vec3
const
&
_val
)
{
mPosition
=
_val
;
}
// Getter, Setter for Camera ViewMatrix
virtual
glm
::
mat4
getViewMatrix
()
const
{
return
mViewMatrix
;
}
virtual
void
setViewMatrix
(
glm
::
mat4
const
&
_val
)
{
mViewMatrix
=
_val
;
}
// Getter, Setter for Camera ProjectionMatrix
virtual
glm
::
mat4
getProjectionMatrix
()
const
{
return
mProjectionMatrix
;
}
virtual
void
setProjectionMatrix
(
glm
::
mat4
const
&
_val
)
{
mProjectionMatrix
=
_val
;
}
// Getter, Setter for Camera ViewportSize
virtual
glm
::
uvec2
getViewportSize
()
const
{
return
mViewportSize
;
}
virtual
void
setViewportSize
(
glm
::
uvec2
const
&
_val
)
{
mViewportSize
=
_val
;
}
};
}
...
...
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