MCPcopy Create free account
hub / github.com/axmolengine/axmol / init

Method init

tests/cpp-tests/Source/NavMeshTest/NavMeshTest.cpp:79–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79bool NavMeshBaseTestDemo::init()
80{
81 if (!TestCase::init())
82 return false;
83
84 if (initPhysicsWorld())
85 {
86
87 _angle = 0.0f;
88
89 Size size = Director::getInstance()->getWinSize();
90 _camera = Camera::createPerspective(30.0f, size.width / size.height, 1.0f, 1000.0f);
91 _camera->setPosition3D(Vec3(0.0f, 50.0f, 100.0f));
92 _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f));
93 _camera->setCameraFlag(CameraFlag::USER1);
94 this->addChild(_camera);
95
96 auto listener = EventListenerTouchAllAtOnce::create();
97 listener->onTouchesBegan = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesBegan, this);
98 listener->onTouchesMoved = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesMoved, this);
99 listener->onTouchesEnded = AX_CALLBACK_2(NavMeshBaseTestDemo::onTouchesEnded, this);
100 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
101
102 initScene();
103 scheduleUpdate();
104 }
105
106 return true;
107}
108
109void NavMeshBaseTestDemo::onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event)
110{

Callers 1

drawMethod · 0.45

Calls 15

getInstanceFunction · 0.85
createFunction · 0.85
scheduleUpdateFunction · 0.85
getNavMeshFunction · 0.85
leftFunction · 0.85
topFunction · 0.85
randomFunction · 0.85
getPhysics3DWorldFunction · 0.85
lookAtMethod · 0.80
initFunction · 0.50
Vec3Function · 0.50

Tested by

no test coverage detected