Class cocos.actions.camera_actions.OrbitCamera

             object --+            
                      |            
    base_actions.Action --+        
                          |        
base_actions.IntervalAction --+    
                              |    
                 Camera3DAction --+
                                  |
                                 OrbitCamera
Orbits the camera around the center of the screen using spherical coordinates

Methods

  init(self, radius=None, delta_radius=0, angle_z=None, delta_z=0, angle_x=None, delta_x=0, *args, **kw)
Initialize the camera with spherical coordinates
  start(self)
Before we start executing an action, self.target is assigned and this method is called.
( radius, zenith, azimuth ) get_spherical_coords(self)
returns the spherical coordinates from a cartesian coordinates
  update(self, t)
Gets called on every frame.
  __reversed__(self) (Inherited from cocos.actions.camera_actions.Camera3DAction)
Inherited from base_actions.IntervalAction: done Inherited from base_actions.Action: __add__, __init__, __mul__, __or__, step, stop Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Instance Variables

Inherited from base_actions.Action: target

Method Details

init

init(self, radius=None, delta_radius=0, angle_z=None, delta_z=0, angle_x=None, delta_x=0, *args, **kw)

Initialize the camera with spherical coordinates

For more information regarding spherical coordinates, read this:
http://en.wikipedia.org/wiki/Spherical_coordinates
Parameters:
radius : float
Radius of the orbit. Default: current radius
delta_radius : float
Delta movement of the radius. Default: 0
angle_z : float
The zenith angle of the spherical coordinate in degrees. Default: current
delta_z : float
Relative movement of the zenith angle. Default: 0
angle_x : float
The azimuth angle of the spherical coordinate in degrees. Default: 0
delta_x : float
Relative movement of the azimuth angle. Default: 0
Overrides:
Camera3DAction.init

start

start(self)
Before we start executing an action, self.target is assigned and this method is called. It will be called for every execution of the action.
Overrides:
Camera3DAction.start

get_spherical_coords

get_spherical_coords(self)

returns the spherical coordinates from a cartesian coordinates

using this formula:

Returns: ( radius, zenith, azimuth )

update

update(self, t)
Gets called on every frame. t is in [0,1] If this action takes 5 seconds to execute, t will be equal to 0 at 0 seconds. t will be 0.5 at 2.5 seconds and t will be 1 at 5sec.
Overrides:
base_actions.IntervalAction.update