PuzzleSDK
BillBoardTest.h
浏览该文件的文档.
1/****************************************************************************
2 Copyright (c) 2013 cocos2d-x.org
3 Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
4
5 http://www.cocos2d-x.org
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 THE SOFTWARE.
24 ****************************************************************************/
25
26#ifndef _BILLBOARD_TEST_H_
27#define _BILLBOARD_TEST_H_
28
29#include "../BaseTest.h"
30#include <string>
31
32namespace cocos2d {
33 class BillBoard;
34 class Camera;
35}
36
38{
39public:
42 virtual ~BillBoardRotationTest();
43 virtual std::string title() const override;
44 virtual std::string subtitle() const override;
45
46protected:
47};
48
49class BillBoardTest : public TestCase
50{
51public:
52 virtual ~BillBoardTest();
55 virtual std::string title() const override;
56 virtual std::string subtitle() const override;
57 virtual void update(float dt) override;
58 void addNewBillBoardWithCoords(cocos2d::Vec3 p);
59 void addNewAniBillBoardWithCoords(cocos2d::Vec3 p);
60 void rotateCameraCallback(cocos2d::Ref* sender,float value);
61 void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
62
63 void menuCallback_orientedPoint(cocos2d::Ref* sender);
64 void menuCallback_orientedPlane(cocos2d::Ref* sender);
65
66protected:
67 cocos2d::Camera* _camera;
68 cocos2d::Layer* _layerBillBoard;
69
70 std::vector<cocos2d::BillBoard*> _billboards;
71};
72
73DEFINE_TEST_SUITE(BillBoardTests);
74
75#endif
DEFINE_TEST_SUITE(BillBoardTests)
virtual std::string subtitle() const override
virtual ~BillBoardRotationTest()
CREATE_FUNC(BillBoardRotationTest)
virtual std::string title() const override
virtual void update(float dt) override
void menuCallback_orientedPlane(cocos2d::Ref *sender)
virtual ~BillBoardTest()
cocos2d::Camera * _camera
Definition: BillBoardTest.h:67
cocos2d::Layer * _layerBillBoard
Definition: BillBoardTest.h:68
virtual std::string subtitle() const override
void onTouchesMoved(const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
CREATE_FUNC(BillBoardTest)
virtual std::string title() const override
void addNewBillBoardWithCoords(cocos2d::Vec3 p)
std::vector< cocos2d::BillBoard * > _billboards
Definition: BillBoardTest.h:70
void addNewAniBillBoardWithCoords(cocos2d::Vec3 p)
void menuCallback_orientedPoint(cocos2d::Ref *sender)
void rotateCameraCallback(cocos2d::Ref *sender, float value)