CCActionPageTurn3D.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /****************************************************************************
  2. Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/
  3. Copyright (c) 2010-2012 cocos2d-x.org
  4. Copyright (c) 2013-2017 Chukong Technologies Inc.
  5. http://www.cocos2d-x.org
  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. The above copyright notice and this permission notice shall be included in
  13. all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. THE SOFTWARE.
  21. ****************************************************************************/
  22. #ifndef __ACTION_CCPAGETURN3D_ACTION_H__
  23. #define __ACTION_CCPAGETURN3D_ACTION_H__
  24. #include "2d/CCActionGrid3D.h"
  25. NS_CC_BEGIN
  26. /**
  27. * @addtogroup actions
  28. * @{
  29. */
  30. /**
  31. @brief This action simulates a page turn from the bottom right hand corner of the screen.
  32. @details It's not much use by itself but is used by the PageTurnTransition.
  33. Based on an original paper by L Hong et al.
  34. http://www.parc.com/publication/1638/turning-pages-of-3d-electronic-books.html
  35. @since v0.8.2
  36. */
  37. class CC_DLL PageTurn3D : public Grid3DAction
  38. {
  39. public:
  40. /**
  41. * @js NA
  42. */
  43. virtual GridBase* getGrid() override;
  44. /**
  45. @brief Create an action with duration, grid size.
  46. @param duration Specify the duration of the PageTurn3D action. It's a value in seconds.
  47. @param gridSize Specify the size of the grid.
  48. @return If the creation success, return a pointer of PageTurn3D action; otherwise, return nil.
  49. */
  50. static PageTurn3D* create(float duration, const Size& gridSize);
  51. // Overrides
  52. virtual PageTurn3D* clone() const override;
  53. virtual void update(float time) override;
  54. };
  55. // end of actions group
  56. /// @}
  57. NS_CC_END
  58. #endif // __ACTION_CCPAGETURN3D_ACTION_H__