| 39 | { |
| 40 | |
| 41 | NavMeshDebugDraw::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 | |
| 62 | void NavMeshDebugDraw::initCustomCommand(CustomCommand& command) |
| 63 | { |
nothing calls this directly
no test coverage detected