Voxvision  1
Creating and manipulating voxel octrees
camera.h
Go to the documentation of this file.
1 
7 #ifndef CAMERA_H
8 #define CAMERA_H
9 
10 #include "object.h"
11 
12 struct vox_camera;
13 
18 {
19  VOX_OBJECT (vox_camera);
20  /*
21  * -------
22  * Methods
23  * -------
24  */
25  void (*screen2world) (const struct vox_camera *camera, vox_dot ray, int sx, int sy);
34  void (*rotate_camera) (struct vox_camera *camera, const vox_dot delta);
46  void (*move_camera) (struct vox_camera *camera, const vox_dot delta);
54  void (*look_at) (struct vox_camera *camera, const vox_dot coord);
62  /*
63  * ------------------------
64  * Specific setters/getters
65  * ------------------------
66  */
67  void (*get_position) (const struct vox_camera *camera, vox_dot res);
76  void (*set_window_size) (struct vox_camera *camera, int w, int h);
88  /*
89  * --------------
90  * 64-byte border
91  * --------------
92  */
93 
94  /*
95  * ----------------------
96  * Constructor/destructor
97  * ----------------------
98  */
99  struct vox_camera* (*construct_camera) (const struct vox_camera *camera);
111  void (*destroy_camera) (struct vox_camera *camera);
117 };
118 
135 {
137 };
138 
146 VOX_EXPORT void vox_use_camera_methods (struct vox_camera *camera,
147  const struct vox_camera_interface *iface);
148 
160 VOX_EXPORT void vox_init_camera (struct vox_camera *camera);
161 
175 VOX_EXPORT struct vox_camera_interface* vox_camera_methods (const char *name);
176 #endif
VOX_EXPORT struct vox_camera_interface * vox_camera_methods(const char *name)
Get camera methods.
VOX_EXPORT void vox_use_camera_methods(struct vox_camera *camera, const struct vox_camera_interface *iface)
Use defined camera methods from another interface implementation.
VOX_EXPORT void vox_init_camera(struct vox_camera *camera)
Initialize camera.
Common object definitions and dummy methods.
A camera user interface.
Definition: camera.h:18
void(* rotate_camera)(struct vox_camera *camera, const vox_dot delta)
Rotate the camera.
Definition: camera.h:34
void(* screen2world)(const struct vox_camera *camera, vox_dot ray, int sx, int sy)
Translate screen coordinated to a direction vector.
Definition: camera.h:25
void(* get_position)(const struct vox_camera *camera, vox_dot res)
Get camera position.
Definition: camera.h:67
void(* set_window_size)(struct vox_camera *camera, int w, int h)
Set screen/window size for a camera.
Definition: camera.h:76
void(* destroy_camera)(struct vox_camera *camera)
Destroy camera after use.
Definition: camera.h:111
void(* move_camera)(struct vox_camera *camera, const vox_dot delta)
Move the camera.
Definition: camera.h:46
void(* look_at)(struct vox_camera *camera, const vox_dot coord)
Look at the object.
Definition: camera.h:54
A generic camera class.
Definition: camera.h:135
struct vox_camera_interface * iface
camera methods
Definition: camera.h:136