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

Method NavMeshDebugDraw

core/navmesh/NavMeshDebugDraw.cpp:41–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39{
40
41NavMeshDebugDraw::NavMeshDebugDraw()
42{
43 auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_COLOR);
44 _programState = new backend::ProgramState(program);
45 _locMVP = _programState->getUniformLocation("u_MVPMatrix");
46
47 // the POSITION_COLOR default vertex layout is: V3F_C4B, so we need modify it
48 auto vertexLayout = _programState->getMutableVertexLayout();
49 vertexLayout->setAttrib("a_position",
50 _programState->getAttributeLocation(backend::Attribute::POSITION),
51 backend::VertexFormat::FLOAT3,
52 offsetof(V3F_C4F, position),
53 false);
54 vertexLayout->setAttrib("a_color",
55 _programState->getAttributeLocation(backend::Attribute::COLOR),
56 backend::VertexFormat::FLOAT4,
57 offsetof(V3F_C4F, color),
58 false);
59 vertexLayout->setStride(sizeof(V3F_C4F));
60}
61
62void NavMeshDebugDraw::initCustomCommand(CustomCommand& command)
63{

Callers

nothing calls this directly

Calls 5

setAttribMethod · 0.80
getAttributeLocationMethod · 0.80
setStrideMethod · 0.80
getUniformLocationMethod · 0.45

Tested by

no test coverage detected