World of Hello
Static Public Member Functions | List of all members
camera Class Reference

the 3D camera. More...

#include <camera.h>

Static Public Member Functions

static camera lookAt (mesh *m)
 face camera toward a 3D mesh. More...
 
static camera rotateAround (mesh *m, float dist=1, float offsetX=0, float offsetY=0, float offsetZ=0)
 rotate the camera around a 3D mesh. More...
 
static camera setRotateAroundChange (float x, float y=0)
 manually rotate the camera around a 3D mesh. More...
 
static multiReturn< float, float > getRotateAroundDirection ()
 get the X and Y axis of rotateAround(). More...
 
static camera setRotateAroundDirection (float x, float y)
 set the X and Y axis of rotateAround(). More...
 
static camera setDefaultControls (bool movable)
 makes the 3D camera movable. More...
 
static multiReturn< float, float, float > getPosition (bool absolute=true)
 get the position of the 3D camera. More...
 
static camera setPosition (float x, float y, float z)
 set the position of the 3D camera. More...
 
static multiReturn< float, float, float > getRotation ()
 get the rotation of the 3D camera. More...
 
static camera setRotation (float x, float y, float z)
 set the rotation of the 3D camera. More...
 

Detailed Description

the 3D camera.

Control the 3D camera and set movement options as well as rotational options.

Member Function Documentation

◆ getPosition()

static multiReturn<float, float, float> camera::getPosition ( bool  absolute = true)
static

get the position of the 3D camera.

   Get the X, Y, and Z axis of the 3D camera.\n
   The absolute position is where the camera really is being displayed from, otherwise it is where the camera was set to display from.
Parameters
(optional)Whether or not you should get the real display position of the camera.
Returns
The X, Y, and Z axis of the 3D camera.

◆ getRotateAroundDirection()

static multiReturn<float, float> camera::getRotateAroundDirection ( )
static

get the X and Y axis of rotateAround().

   When the camera is rotating around (using the rotateAround() function) a mesh,
   use this function to get the X and Y axis of the camera.
Returns
(1) the X axis of the camera during rotateAround(). (2) the Y axis of the camera during rotateAround().

◆ getRotation()

static multiReturn<float, float, float> camera::getRotation ( )
static

get the rotation of the 3D camera.

   Get the X, Y, and Z rotational axis of the 3D camera.
Returns
The X, Y, and Z rotational axis of the 3D camera.

◆ lookAt()

static camera camera::lookAt ( mesh m)
static

face camera toward a 3D mesh.

Parameters
The3D mesh the camera should look at.
Returns
Returns itself.

◆ rotateAround()

static camera camera::rotateAround ( mesh m,
float  dist = 1,
float  offsetX = 0,
float  offsetY = 0,
float  offsetZ = 0 
)
static

rotate the camera around a 3D mesh.

   Mouse click anywhere on the screen (except on 2D elements) and drag the mouse to rotate around.
   Also rotates around objects on mobile devices and handles multi-touch events.
Parameters
The3D mesh the camera should rotate around.
(optional)The distance to rotate from.
(optional)The amount to offset the camera's rotation X axis.
(optional)The amount to offset the camera's rotation Y axis.
(optional)The amount to offset the camera's rotation Z axis.
Returns
Returns itself.

◆ setDefaultControls()

static camera camera::setDefaultControls ( bool  movable)
static

makes the 3D camera movable.

   Cannot be used while rotating around (using the rotateAround() function) a mesh.
   Enables the camera to be controlled with the arrow keys (no mobile support).
Parameters
Whetheror not the camera should be movable.
Returns
Returns itself.

◆ setPosition()

static camera camera::setPosition ( float  x,
float  y,
float  z 
)
static

set the position of the 3D camera.

   Set the X, Y, and Z axis of the 3D camera.
Parameters
Thenew X axis of the camera.
Thenew Y axis of the camera.
thenew Z axis of the camera.
Returns
Returns itself.

◆ setRotateAroundChange()

static camera camera::setRotateAroundChange ( float  x,
float  y = 0 
)
static

manually rotate the camera around a 3D mesh.

   When the camera is rotating around (using the rotateAround() function) a mesh,
   use this function to rotate across the X or Y axis.
   May be used in situations like left-arrow presses or mobile joysticks.
Parameters
Theamount the camera should rotate around the mesh's X axis.
(optional)The amount the camera should rotate around the mesh's Y axis.
Returns
Returns itself.

◆ setRotateAroundDirection()

static camera camera::setRotateAroundDirection ( float  x,
float  y 
)
static

set the X and Y axis of rotateAround().

   When the camera is rotating around (using the rotateAround() function) a mesh,
   use this function to set the X and Y axis which the camera is rotating around the mesh.
Parameters
TheX axis of the camera rotation around the mesh.
TheY axis of the camera rotation around the mesh.
Returns
Returns itself.

◆ setRotation()

static camera camera::setRotation ( float  x,
float  y,
float  z 
)
static

set the rotation of the 3D camera.

   Set the X, Y, and Z rotational axis of the 3D camera.
Parameters
Thenew X rotational axis of the camera.
Thenew Y rotational axis of the camera.
thenew Z rotational axis of the camera.
Returns
Returns itself.