Voxvision
1
Creating and manipulating voxel octrees
|
A camera user interface. More...
#include <camera.h>
Public Member Functions | |
VOX_OBJECT (vox_camera) | |
Data Fields | |
void(* | screen2world )(const struct vox_camera *camera, vox_dot ray, int sx, int sy) |
Translate screen coordinated to a direction vector. More... | |
void(* | rotate_camera )(struct vox_camera *camera, const vox_dot delta) |
Rotate the camera. More... | |
void(* | move_camera )(struct vox_camera *camera, const vox_dot delta) |
Move the camera. More... | |
void(* | look_at )(struct vox_camera *camera, const vox_dot coord) |
Look at the object. More... | |
void(* | get_position )(const struct vox_camera *camera, vox_dot res) |
Get camera position. More... | |
void(* | set_window_size )(struct vox_camera *camera, int w, int h) |
Set screen/window size for a camera. More... | |
struct vox_camera *(* | construct_camera )(const struct vox_camera *camera) |
Create a new camera object. More... | |
void(* | destroy_camera )(struct vox_camera *camera) |
Destroy camera after use. More... | |
A camera user interface.
struct vox_camera*(* vox_camera_interface::construct_camera) (const struct vox_camera *camera) |
Create a new camera object.
If camera is supplied, its internal fields will be copied to a newly created camera. If data layout of the supplied camera is different from one being created (i.e. their classes are not related to each other), expect undefined behaviour. This is a class method.
camera | can be NULL or another camera instance. |
void(* vox_camera_interface::destroy_camera) (struct vox_camera *camera) |
Destroy camera after use.
This method should be called when camera is no longer needed.
void(* vox_camera_interface::get_position) (const struct vox_camera *camera, vox_dot res) |
Get camera position.
Camera position is copied to function's argument.
res | where result is stored |
void(* vox_camera_interface::look_at) (struct vox_camera *camera, const vox_dot coord) |
Look at the object.
Turn the camera so that the object with given coordinates will be in center of the screen.
void(* vox_camera_interface::move_camera) (struct vox_camera *camera, const vox_dot delta) |
Move the camera.
delta | a vector with deltas of camera position coordinates (in camera's coordinate system). Must contain 3 elements. |
void(* vox_camera_interface::rotate_camera) (struct vox_camera *camera, const vox_dot delta) |
Rotate the camera.
Deltas of rotation angles are in the camera coordinate system. Positive direction of axis Ox is to the camera's right, of axis Oy is to the front, of axis Oz is up.
delta | a vector with deltas of rotation angles. Must contain 3 elements. |
void(* vox_camera_interface::screen2world) (const struct vox_camera *camera, vox_dot ray, int sx, int sy) |
Translate screen coordinated to a direction vector.
ray | the result is stored in this vector |
sx | screen x coordinate |
sy | screen y coordinate |
void(* vox_camera_interface::set_window_size) (struct vox_camera *camera, int w, int h) |
Set screen/window size for a camera.
This method must be called before any screen2world() calls. Usually this happens automatically when vox_make_renderer_context() and/or vox_rc_set_camera() are called.
w | width of the window |
h | height of the window |