IPhysics: CPhysicsCamera Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# CPhysicsCamera Class Reference

`#include <CPhysicsCamera.h>`

List of all members.

## Public Member Functions

| CPhysicsCamera ()
| Constructors and destructors of the camera class.
| ~CPhysicsCamera ()
void | init (IrrlichtDevice *dev, NewtonWorld *world, SPhysicsCamera *camera)
| Initialize physics for camera.
void | onEvent (SEvent event)
| On event callback for the camera.
void | update ()
| Camera update function for updating camera movement.
void | setMaterial (int material)
| Apply a material on the current mesh.
void | setKeyMap (SCameraKeyMap *kMap, s32 kMapSize)
| Set the keymap for camera movement.
void | setGround (NewtonBody *grnd)
| Give a pointer to the ground, for stair detection system.
void | setPosition (vector3df position)
| Set camera position.
void | setRotation (vector3df rotation)
| Set camera rotation.
vector3df | getPosition ()
| Get camera position.
vector3df | getRotation ()
| Get camera rotation.
NewtonBody * | getBody ()
| Get a pointer to the camera's newton body.
ICameraSceneNode * | getCameraNode ()
| Get a pointer to the camera scene node.

## Static Private Member Functions

static void _cdecl | camSetTransform (const NewtonBody *body, const float *matrix)
| Newton callbacks.
static void _cdecl | camApplyForce (const NewtonBody *body)
static void _cdecl | destructor (const NewtonBody *body)
| Destructor callback.
static f32 | OnRayCastPlacement (const NewtonBody *body, const dFloat *normal, int collisionID, void *userData, dFloat intersetParam)
| A static callback which is called when a ray cast hits something.
static f32 | OnFloorCheckRayCast (const NewtonBody *body, const dFloat *normal, int collisionID, void *userData, dFloat intersetParam)
| To check in a raycast if it is the floor.

## Private Attributes

IrrlichtDevice * | m_device
| Irrlicht objects.
ICameraSceneNode * | m_node
position2d< f32 > | m_centerCursor
| The position of the center of the screen.
bool | m_firstUpdate
f32 | m_sensitivity
| Sensitivity of the camera.
f32 | m_moveSpeed
| Speed of movement of the camera.
f32 | m_maxStepSize
| The max stepping size of the camera, used for stairs.
array< SCameraKeyMap > | m_keyMap
| Key map for the cameras movement.
bool | m_cursorKeys [4]
| An array for checking key press easily.

## Static Private Attributes

static NewtonWorld * | m_world
| Pointer to newton world.
static NewtonBody * | m_body
| Pointer to the camera scene node and newton created body.
static NewtonBody * | m_ground
| Pointer to the ground newton body.
static vector3df | m_camForce
static vector3df | m_bodySize
| A variable to store the size of the body.
static vector3df | m_rayStart
| The start of the raycast.
static vector3df | m_rayEnd
| The end of the raycast.

## Constructor & Destructor Documentation

CPhysicsCamera::CPhysicsCamera | ( |  | ) |

Constructors and destructors of the camera class.

CPhysicsCamera::~CPhysicsCamera | ( |  | ) |

## Member Function Documentation

void CPhysicsCamera::init | ( | IrrlichtDevice * | dev,
|  | NewtonWorld * | world,
|  | SPhysicsCamera * | camera |
| ) |  |  |

Initialize physics for camera.

Set up local world and device variables.

Get properties from SPhysicsCamera struct.

void CPhysicsCamera::onEvent | ( | SEvent | event | ) |

On event callback for the camera.

A callback for events, this is called by irrlicht when there is a new event.

void CPhysicsCamera::update | ( |  | ) |

Camera update function for updating camera movement.

void CPhysicsCamera::setMaterial | ( | int | material | ) |

Apply a material on the current mesh.

void CPhysicsCamera::setKeyMap | ( | SCameraKeyMap * | kMap,
|  | s32 | kMapSize |
| ) |  |  |

Set the keymap for camera movement.

void CPhysicsCamera::setGround | ( | NewtonBody * | grnd | ) |

Give a pointer to the ground, for stair detection system.

void CPhysicsCamera::setPosition | ( | vector3df | position | ) |

Set camera position.

void CPhysicsCamera::setRotation | ( | vector3df | rotation | ) |

Set camera rotation.

vector3df CPhysicsCamera::getPosition | ( |  | ) |

Get camera position.

vector3df CPhysicsCamera::getRotation | ( |  | ) |

Get camera rotation.

NewtonBody * CPhysicsCamera::getBody | ( |  | ) |

Get a pointer to the camera's newton body.

ICameraSceneNode * CPhysicsCamera::getCameraNode | ( |  | ) |

Get a pointer to the camera scene node.

void CPhysicsCamera::camSetTransform | ( | const NewtonBody * | body,
|  | const float * | matrix |
| ) |  |  | `[static, private]`

Newton callbacks.

void CPhysicsCamera::camApplyForce | ( | const NewtonBody * | body | ) | `[static, private]`

void _cdecl CPhysicsCamera::destructor | ( | const NewtonBody * | body | ) | `[static, private]`

Destructor callback.

f32 CPhysicsCamera::OnRayCastPlacement | ( | const NewtonBody * | body,
|  | const dFloat * | normal,
|  | int | collisionID,
|  | void * | userData,
|  | dFloat | intersetParam |
| ) |  |  | `[static, private]`

A static callback which is called when a ray cast hits something.

f32 CPhysicsCamera::OnFloorCheckRayCast | ( | const NewtonBody * | body,
|  | const dFloat * | normal,
|  | int | collisionID,
|  | void * | userData,
|  | dFloat | intersetParam |
| ) |  |  | `[static, private]`

To check in a raycast if it is the floor.

## Member Data Documentation

NewtonWorld * CPhysicsCamera::m_world`[static, private]`

Pointer to newton world.

IrrlichtDevice* CPhysicsCamera::m_device`[private]`

Irrlicht objects.

NewtonBody * CPhysicsCamera::m_body`[static, private]`

Pointer to the camera scene node and newton created body.

ICameraSceneNode* CPhysicsCamera::m_node`[private]`

position2d<f32> CPhysicsCamera::m_centerCursor`[private]`

The position of the center of the screen.

NewtonBody * CPhysicsCamera::m_ground`[static, private]`

Pointer to the ground newton body.

vector3df CPhysicsCamera::m_camForce`[static, private]`

This variable carries the force which the camera moves to the force and torque event.

bool CPhysicsCamera::m_firstUpdate`[private]`

A boolean to check if this is the first time the camera is being updated.

vector3df CPhysicsCamera::m_bodySize`[static, private]`

A variable to store the size of the body.

f32 CPhysicsCamera::m_sensitivity`[private]`

Sensitivity of the camera.

f32 CPhysicsCamera::m_moveSpeed`[private]`

Speed of movement of the camera.

vector3df CPhysicsCamera::m_rayStart`[static, private]`

The start of the raycast.

vector3df CPhysicsCamera::m_rayEnd`[static, private]`

The end of the raycast.

f32 CPhysicsCamera::m_maxStepSize`[private]`

The max stepping size of the camera, used for stairs.

array<SCameraKeyMap> CPhysicsCamera::m_keyMap`[private]`

Key map for the cameras movement.

bool CPhysicsCamera::m_cursorKeys[4]`[private]`

An array for checking key press easily.

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

- C:/Documents and Settings/user/Desktop/IPhysics 1.5 Irr 1.2/source/CPhysicsCamera.h
- C:/Documents and Settings/user/Desktop/IPhysics 1.5 Irr 1.2/source/CPhysicsCamera.cpp