My Project
Static Public Member Functions | List of all members
ParaScripting::ParaCamera Class Reference

The camera controller. More...

#include <ParaScriptingScene.h>

Static Public Member Functions

static void FollowObject (ParaObject obj)
 set the character to follow. More...
 
static void FollowObject (const char *strObjectName)
 set the character to follow. More...
 
static void FirstPerson (int nTransitionMode, float fHeight, float fAngle)
 Set the current camera to follow a certain object, using first person view of the object. More...
 
static void ThirdPerson (int nTransitionMode, float fHeight, float fFacing, float fAngle)
 Set the current camera to follow a certain object, using Third Person view of the object, where character is always centered while allowing rotation around it from 360 degree angles,. More...
 
static void Default (int nTransitionMode, float fHeight, float fAngle)
 : Set the current camera to follow a certain object, using the default view of the object. More...
 
static void Fixed (int nTransitionMode, float fX, float fY, float fZ)
 Set the current camera to look at a certain object, from a fixed camera location while allowing rotation around it from 360 degree angles,. More...
 
static void GetPosition (float *x, float *y, float *z)
 get the world position of the camera eye. More...
 
static void GetLookAtPosition (float *x, float *y, float *z)
 get the position that the camera is currently looking at. More...
 
static void SetKeyMap (int key, int scancode)
 we can alter key map at runtime More...
 
static int GetKeyMap (int key)
 get scancode from key id
 
static ParaAttributeObject GetAttributeObject ()
 get the attribute object associated with the current camera object. More...
 
static void GetAttributeObject_ (ParaAttributeObject &output)
 used for API exportation. More...
 

Detailed Description

The camera controller.

First call FollowObject() method to set the character to follow. set call any of the camera transition functions to set the camera follow mode

Member Function Documentation

§ Default()

void ParaScripting::ParaCamera::Default ( int  nTransitionMode,
float  fHeight,
float  fAngle 
)
static

: Set the current camera to follow a certain object, using the default view of the object.

character restricted to move within a rectangular region, while camera is facing a fixed direction.

Parameters
nTransitionMode1 (default) smooth move or 0 immediate move
fHeightrelative camera height above the object.
fAnglecamera lift up angle, this is usually Pi/4: 45 degrees

§ FirstPerson()

void ParaScripting::ParaCamera::FirstPerson ( int  nTransitionMode,
float  fHeight,
float  fAngle 
)
static

Set the current camera to follow a certain object, using first person view of the object.

Parameters
nTransitionMode1 (default) smooth move or 0 immediate move
fRadiusthe distance from the person to the camera
fAnglecamera lift up angle, this is usually Pi/4: 45 degrees

§ Fixed()

void ParaScripting::ParaCamera::Fixed ( int  nTransitionMode,
float  fX,
float  fY,
float  fZ 
)
static

Set the current camera to look at a certain object, from a fixed camera location while allowing rotation around it from 360 degree angles,.

Parameters
nTransitionMode1 (default) smooth move or 0 immediate move
fXcamera location: x
fYcamera location: y
fZcamera location: z

§ FollowObject() [1/2]

void ParaScripting::ParaCamera::FollowObject ( ParaObject  obj)
static

set the character to follow.

the object is also set as the current player

Parameters
objthe ParaObject to follow, one can call

§ FollowObject() [2/2]

void ParaScripting::ParaCamera::FollowObject ( const char *  strObjectName)
static

set the character to follow.

the object must be global in order to be found by its name. It is also set as the current player currently,

Parameters
strObjectNamethe name of the object to follow

§ GetAttributeObject()

ParaAttributeObject ParaScripting::ParaCamera::GetAttributeObject ( )
static

get the attribute object associated with the current camera object.

§ GetAttributeObject_()

void ParaScripting::ParaCamera::GetAttributeObject_ ( ParaAttributeObject output)
static

used for API exportation.

§ GetLookAtPosition()

void ParaScripting::ParaCamera::GetLookAtPosition ( float *  x,
float *  y,
float *  z 
)
static

get the position that the camera is currently looking at.

§ GetPosition()

void ParaScripting::ParaCamera::GetPosition ( float *  x,
float *  y,
float *  z 
)
static

get the world position of the camera eye.

This function takes no parameters. x,y,z are not input, but pure output. In the script, we can call it as below x,y,z = ParaCamera.GetPosition(); – get the camera's eye position in Luabind, it is defined as .def("GetPosition", &ParaCamera::GetPosition, pure_out_value(_1) + pure_out_value(_2) + pure_out_value(_3)) please note, y is the absolute position in world coordinate

See also
SetPosition(float x, float y, float z)

§ SetKeyMap()

void ParaScripting::ParaCamera::SetKeyMap ( int  key,
int  scancode 
)
static

we can alter key map at runtime

Parameters
keyCharacterAndCameraKeys . [0-10]
scancodeDIK_A, DIK_D,DIK_W,DIK_S,DIK_Q,DIK_E,DIK_SPACE,0,0,DIK_INSERT,DIK_DELETE

§ ThirdPerson()

void ParaScripting::ParaCamera::ThirdPerson ( int  nTransitionMode,
float  fHeight,
float  fFacing,
float  fAngle 
)
static

Set the current camera to follow a certain object, using Third Person view of the object, where character is always centered while allowing rotation around it from 360 degree angles,.

Parameters
nTransitionMode1 (default) smooth move or 0 immediate move
fRadiusthe distance from the person to the camera
fFacingcamera facing, around the y axis, which is the world height axis.
fAnglecamera lift up angle, this is usually Pi/4: 45 degrees

The documentation for this class was generated from the following files: