cocos2d-iphone  1.0.1
Improved Cocos2D API Reference (iOS version) for Kobold2D developers
CCCamera Interface Reference

#include <CCCamera.h>

List of all members.

Public Member Functions

void restore ()
void locate ()
void setEyeX:eyeY:eyeZ: (float x,[eyeY] float y,[eyeZ] float z)
void setCenterX:centerY:centerZ: (float x,[centerY] float y,[centerZ] float z)
void setUpX:upY:upZ: (float x,[upY] float y,[upZ] float z)
void eyeX:eyeY:eyeZ: (float *x,[eyeY] float *y,[eyeZ] float *z)
void centerX:centerY:centerZ: (float *x,[centerY] float *y,[centerZ] float *z)
void upX:upY:upZ: (float *x,[upY] float *y,[upZ] float *z)

Static Public Member Functions

float getZEye ()

Protected Attributes

float eyeX_
float eyeY_
float eyeZ_
float centerX_
float centerY_
float centerZ_
float upX_
float upY_
float upZ_
BOOL dirty_

Properties

BOOL dirty

Detailed Description

A CCCamera is used in every CCNode. Useful to look at the object from different views. The OpenGL gluLookAt() function is used to locate the camera.

If the object is transformed by any of the scale, rotation or position attributes, then they will override the camera.

IMPORTANT: Either your use the camera or the rotation/scale/position properties. You can't use both. World coordinates won't work if you use the camera.

Limitations:

  • Some nodes, like CCParallaxNode, CCParticle uses world node coordinates, and they won't work properly if you move them (or any of their ancestors) using the camera.
  • It is recommended to use it ONLY if you are going to create 3D effects. For 2D effecs, use the action CCFollow or position/scale/rotate.

Member Function Documentation

void CCCamera::centerX:centerY:centerZ: ( float *  x,
[centerY] float *  y,
[centerZ] float *  z 
) [virtual]

get the center vector values in points

void CCCamera::eyeX:eyeY:eyeZ: ( float *  x,
[eyeY] float *  y,
[eyeZ] float *  z 
) [virtual]

get the eye vector values in points

float CCCamera::getZEye ( ) [static, virtual]

returns the Z eye

void CCCamera::locate ( ) [virtual]

Sets the camera using gluLookAt using its eye, center and up_vector

void CCCamera::restore ( ) [virtual]

sets the camera in the defaul position

void CCCamera::setCenterX:centerY:centerZ: ( float  x,
[centerY] float  y,
[centerZ] float  z 
) [virtual]

sets the center values in points

void CCCamera::setEyeX:eyeY:eyeZ: ( float  x,
[eyeY] float  y,
[eyeZ] float  z 
) [virtual]

sets the eye values in points

void CCCamera::setUpX:upY:upZ: ( float  x,
[upY] float  y,
[upZ] float  z 
) [virtual]

sets the up values

void CCCamera::upX:upY:upZ: ( float *  x,
[upY] float *  y,
[upZ] float *  z 
) [virtual]

get the up vector values


Property Documentation

BOOL CCCamera::dirty [read, write, assign]

whether of not the camera is dirty


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