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

Method delMeshCallback

tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp:904–931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

902}
903
904void CameraCullingDemo::delMeshCallback(Object* sender)
905{
906 if (_row == 0)
907 return;
908
909 _layer3D->removeAllChildren();
910 _objects.clear();
911
912 --_row;
913 for (int x = -_row; x < _row; x++)
914 {
915 for (int z = -_row; z < _row; z++)
916 {
917 auto sprite = MeshRenderer::create("MeshRendererTest/orc.c3b");
918 sprite->setPosition3D(Vec3(x * 30.0f, 0.0f, z * 30.0f));
919 _objects.emplace_back(sprite);
920 _layer3D->addChild(sprite);
921 }
922 }
923
924 // set layer mask.
925 _layer3D->setCameraMask((unsigned short)CameraFlag::USER1);
926
927 // update sprite number
928 char szText[64];
929 auto text = fmt::format_to_z(szText, "{} sprits", static_cast<int32_t>(_layer3D->getChildrenCount()));
930 _labelMeshCount->setString(text);
931}
932
933void CameraCullingDemo::drawCameraFrustum()
934{

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected