PuzzleSDK
CameraTest2类 参考

#include <NodeTest.h>

+ 类 CameraTest2 继承关系图:
+ CameraTest2 的协作图:

Public 成员函数

 CREATE_FUNC (CameraTest2)
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
virtual void onEnter () override
 
virtual void onExit () override
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 

Protected 成员函数

 CameraTest2 ()
 
- Protected 成员函数 继承自 TestCocosNodeDemo
 TestCocosNodeDemo ()
 
virtual ~TestCocosNodeDemo ()
 

Protected 属性

cocos2d::Sprite * _sprite1
 
cocos2d::Sprite * _sprite2
 
- Protected 属性 继承自 TestCocosNodeDemo
cocos2d::Director::Projection _preProjection
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 

详细描述

在文件 NodeTest.h216 行定义.

构造及析构函数说明

◆ CameraTest2()

CameraTest2::CameraTest2 ( )
protected

在文件 NodeTest.cpp1081 行定义.

1082{
1083 auto s = Director::getInstance()->getWinSize();
1084
1086 addChild( _sprite1 );
1087 _sprite1->setPosition( Vec2(1*s.width/4, s.height/2) );
1088 _sprite1->setScale(0.5);
1089
1090 _sprite2 = Sprite::create(s_back3);
1091 addChild( _sprite2 );
1092 _sprite2->setPosition( Vec2(3*s.width/4, s.height/2) );
1093 _sprite2->setScale(0.5);
1094
1095 Vec3 eye(150, 0, 200), center(0, 0, 0), up(0, 1, 0);
1096
1097 Mat4 lookupMatrix;
1098 Mat4::createLookAt(eye, center, up, &lookupMatrix);
1099
1100 Mat4 lookupMatrix2 = lookupMatrix;
1101
1102 _sprite1->setAdditionalTransform(&lookupMatrix2);
1103 _sprite2->setAdditionalTransform(&lookupMatrix2);
1104
1105}
cocos2d::Sprite * _sprite2
Definition: NodeTest.h:229
cocos2d::Sprite * _sprite1
Definition: NodeTest.h:228
static MySprite * create(const std::string &spritefilename)
Definition: NodeTest.cpp:967
static const char s_back3[]
Definition: testResource.h:41

引用了 _sprite1, _sprite2, MySprite::create() , 以及 s_back3.

+ 函数调用图:

成员函数说明

◆ CREATE_FUNC()

CameraTest2::CREATE_FUNC ( CameraTest2  )

◆ onEnter()

void CameraTest2::onEnter ( )
overridevirtual

重载 TestCase .

在文件 NodeTest.cpp1064 行定义.

1065{
1067 _preProjection = Director::getInstance()->getProjection();
1068 Director::getInstance()->setProjection(Director::Projection::_3D);
1069 Director::getInstance()->getRenderer()->setDepthTest(true);
1070 Director::getInstance()->getRenderer()->setDepthWrite(true);
1071}
virtual void onEnter() override
Definition: BaseTest.cpp:430
cocos2d::Director::Projection _preProjection
Definition: NodeTest.h:44

引用了 TestCocosNodeDemo::_preProjection , 以及 TestCase::onEnter().

+ 函数调用图:

◆ onExit()

void CameraTest2::onExit ( )
overridevirtual

在文件 NodeTest.cpp1073 行定义.

1074{
1075 Director::getInstance()->setProjection(_preProjection);
1076 Director::getInstance()->getRenderer()->setDepthTest(false);
1077 Director::getInstance()->getRenderer()->setDepthWrite(false);
1078 TestCocosNodeDemo::onExit();
1079}

引用了 TestCocosNodeDemo::_preProjection.

◆ subtitle()

std::string CameraTest2::subtitle ( ) const
overridevirtual

重载 TestCase .

在文件 NodeTest.cpp1112 行定义.

1113{
1114 return "Both images should look the same";
1115}

◆ title()

std::string CameraTest2::title ( ) const
overridevirtual

重载 TestCocosNodeDemo .

在文件 NodeTest.cpp1107 行定义.

1108{
1109 return "Camera Test 2";
1110}

类成员变量说明

◆ _sprite1

cocos2d::Sprite* CameraTest2::_sprite1
protected

在文件 NodeTest.h228 行定义.

被这些函数引用 CameraTest2().

◆ _sprite2

cocos2d::Sprite* CameraTest2::_sprite2
protected

在文件 NodeTest.h229 行定义.

被这些函数引用 CameraTest2().


该类的文档由以下文件生成: