/libs/cocos2d/CCCameraAction.h

http://github.com/kstenerud/ObjectAL-for-iPhone · C Header · 71 lines · 30 code · 9 blank · 32 comment · 0 complexity · 025c4ebd44e80e1c9de8a31e67ddb539 MD5 · raw file

  1. /*
  2. * cocos2d for iPhone: http://www.cocos2d-iphone.org
  3. *
  4. * Copyright (c) 2008-2010 Ricardo Quesada
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. *
  24. */
  25. #import "CCIntervalAction.h"
  26. @class CCCamera;
  27. /** Base class for CCCamera actions
  28. */
  29. @interface CCCameraAction : CCIntervalAction <NSCopying> {
  30. float centerXOrig;
  31. float centerYOrig;
  32. float centerZOrig;
  33. float eyeXOrig;
  34. float eyeYOrig;
  35. float eyeZOrig;
  36. float upXOrig;
  37. float upYOrig;
  38. float upZOrig;
  39. }
  40. @end
  41. /** CCOrbitCamera action
  42. Orbits the camera around the center of the screen using spherical coordinates
  43. */
  44. @interface CCOrbitCamera : CCCameraAction <NSCopying> {
  45. float radius;
  46. float deltaRadius;
  47. float angleZ;
  48. float deltaAngleZ;
  49. float angleX;
  50. float deltaAngleX;
  51. float radZ;
  52. float radDeltaZ;
  53. float radX;
  54. float radDeltaX;
  55. }
  56. /** creates a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX */
  57. +(id) actionWithDuration:(float) t radius:(float)r deltaRadius:(float) dr angleZ:(float)z deltaAngleZ:(float)dz angleX:(float)x deltaAngleX:(float)dx;
  58. /** initializes a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX */
  59. -(id) initWithDuration:(float) t radius:(float)r deltaRadius:(float) dr angleZ:(float)z deltaAngleZ:(float)dz angleX:(float)x deltaAngleX:(float)dx;
  60. /** positions the camera according to spherical coordinates */
  61. -(void) sphericalRadius:(float*) r zenith:(float*) zenith azimuth:(float*) azimuth;
  62. @end