本文整理汇总了C++中MeshBuilder::AddLine方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshBuilder::AddLine方法的具体用法?C++ MeshBuilder::AddLine怎么用?C++ MeshBuilder::AddLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshBuilder
的用法示例。
在下文中一共展示了MeshBuilder::AddLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
//-----------------------------------------------------------------------------------
void Skeleton::Render() const
{
if (!m_joints)
{
MeshBuilder builder;
for (const Matrix4x4& modelSpaceMatrix : m_boneToModelSpace)
{
builder.AddIcoSphere(1.0f, RGBA::BLUE, 0, modelSpaceMatrix.GetTranslation());
}
m_joints = new MeshRenderer(new Mesh(), new Material(new ShaderProgram("Data/Shaders/fixedVertexFormat.vert", "Data/Shaders/fixedVertexFormat.frag"),
RenderState(RenderState::DepthTestingMode::OFF, RenderState::FaceCullingMode::RENDER_BACK_FACES, RenderState::BlendMode::ALPHA_BLEND)));
m_joints->m_material->SetDiffuseTexture(Renderer::instance->m_defaultTexture);
builder.CopyToMesh(m_joints->m_mesh, &Vertex_PCUTB::Copy, sizeof(Vertex_PCUTB), &Vertex_PCUTB::BindMeshToVAO);
}
if (!m_bones)
{
MeshBuilder builder;
for (unsigned int i = 0; i < m_parentIndices.size(); i++)
{
int parentIndex = m_parentIndices[i];
if (parentIndex >= 0)
{
builder.AddLine(m_boneToModelSpace[i].GetTranslation(), m_boneToModelSpace[parentIndex].GetTranslation(), RGBA::SEA_GREEN);
}
}
m_bones = new MeshRenderer(new Mesh(), new Material(new ShaderProgram("Data/Shaders/fixedVertexFormat.vert", "Data/Shaders/fixedVertexFormat.frag"),
RenderState(RenderState::DepthTestingMode::OFF, RenderState::FaceCullingMode::RENDER_BACK_FACES, RenderState::BlendMode::ALPHA_BLEND)));
m_bones->m_material->SetDiffuseTexture(Renderer::instance->m_defaultTexture);
builder.CopyToMesh(m_bones->m_mesh, &Vertex_PCUTB::Copy, sizeof(Vertex_PCUTB), &Vertex_PCUTB::BindMeshToVAO);
}
m_joints->Render();
m_bones->Render();
}