Voxvision  1
Creating and manipulating voxel octrees
Public Member Functions | Data Fields
vox_camera_interface Struct Reference

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...
 

Detailed Description

A camera user interface.

Field Documentation

◆ construct_camera

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.

Parameters
cameracan be NULL or another camera instance.

◆ destroy_camera

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.

◆ get_position

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.

Parameters
reswhere result is stored

◆ look_at

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.

◆ move_camera

void(* vox_camera_interface::move_camera) (struct vox_camera *camera, const vox_dot delta)

Move the camera.

Parameters
deltaa vector with deltas of camera position coordinates (in camera's coordinate system). Must contain 3 elements.

◆ rotate_camera

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.

Parameters
deltaa vector with deltas of rotation angles. Must contain 3 elements.

◆ screen2world

void(* vox_camera_interface::screen2world) (const struct vox_camera *camera, vox_dot ray, int sx, int sy)

Translate screen coordinated to a direction vector.

Parameters
raythe result is stored in this vector
sxscreen x coordinate
syscreen y coordinate

◆ set_window_size

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.

Parameters
wwidth of the window
hheight of the window

The documentation for this struct was generated from the following file: