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

Method addMeshCallback

tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp:876–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

874}
875
876void CameraCullingDemo::addMeshCallback(Object* sender)
877{
878 _layer3D->removeAllChildren();
879 _objects.clear();
880 _drawAABB->clear();
881
882 ++_row;
883 for (int x = -_row; x < _row; x++)
884 {
885 for (int z = -_row; z < _row; z++)
886 {
887 auto sprite = MeshRenderer::create("MeshRendererTest/orc.c3b");
888 sprite->setPosition3D(Vec3(x * 30.0f, 0.0f, z * 30.0f));
889 sprite->setRotation3D(Vec3(0.0f, 180.0f, 0.0f));
890 _objects.emplace_back(sprite);
891 _layer3D->addChild(sprite);
892 }
893 }
894
895 // set layer mask.
896 _layer3D->setCameraMask((unsigned short)CameraFlag::USER1);
897
898 // update sprite number
899 char szText[64];
900 auto text = fmt::format_to_z(szText, "{} sprits", static_cast<int32_t>(_layer3D->getChildrenCount()));
901 _labelMeshCount->setString(text);
902}
903
904void CameraCullingDemo::delMeshCallback(Object* sender)
905{

Callers

nothing calls this directly

Calls 12

createFunction · 0.85
format_to_zFunction · 0.85
Vec3Function · 0.50
removeAllChildrenMethod · 0.45
clearMethod · 0.45
setPosition3DMethod · 0.45
setRotation3DMethod · 0.45
emplace_backMethod · 0.45
addChildMethod · 0.45
setCameraMaskMethod · 0.45
getChildrenCountMethod · 0.45
setStringMethod · 0.45

Tested by

no test coverage detected