Last change
on this file since 230 was
230,
checked in by epyon, 11 years ago
|
- animated_mesh, scene_node, camera and transform classes added
- order in mesh hierarchies
- simplified and generified animation class hierarchy
|
File size:
964 bytes
|
Line | |
---|
1 | // Copyright (C) 2014 ChaosForge / Kornel Kisielewicz
|
---|
2 | // http://chaosforge.org/
|
---|
3 | //
|
---|
4 | // This file is part of NV Libraries.
|
---|
5 | // For conditions of distribution and use, see copyright notice in nv.hh
|
---|
6 | /**
|
---|
7 | * @file camera.hh
|
---|
8 | * @author Kornel Kisielewicz epyon@chaosforge.org
|
---|
9 | * @brief Camera interface class
|
---|
10 | */
|
---|
11 |
|
---|
12 | #ifndef NV_CAMERA_HH
|
---|
13 | #define NV_CAMERA_HH
|
---|
14 |
|
---|
15 | #include <nv/common.hh>
|
---|
16 | #include <nv/math.hh>
|
---|
17 |
|
---|
18 | namespace nv
|
---|
19 | {
|
---|
20 | class camera
|
---|
21 | {
|
---|
22 | public:
|
---|
23 | camera() {}
|
---|
24 |
|
---|
25 | void set_lookat( const vec3& eye, const vec3& focus, const vec3& up )
|
---|
26 | {
|
---|
27 | m_view = glm::lookAt( eye, focus, up );
|
---|
28 | }
|
---|
29 |
|
---|
30 | void set_perspective( f32 fov, f32 aspect, f32 near, f32 far )
|
---|
31 | {
|
---|
32 | m_projection = glm::perspective( fov, aspect, near, far );
|
---|
33 | }
|
---|
34 | const mat4& get_projection() const
|
---|
35 | {
|
---|
36 | return m_projection;
|
---|
37 | }
|
---|
38 | const mat4& get_view() const
|
---|
39 | {
|
---|
40 | return m_view;
|
---|
41 | }
|
---|
42 | private:
|
---|
43 | mat4 m_projection;
|
---|
44 | mat4 m_view;
|
---|
45 | };
|
---|
46 | }
|
---|
47 |
|
---|
48 | #endif // NV_CAMERA_HH
|
---|
Note: See
TracBrowser
for help on using the repository browser.