Exemple #1
0
void CModelFile::draw()
{
    currentMaterialSet().setAmbient(m_ambient);

    glm::mat4 model = glm::translate(glm::mat4(1), m_position) * glm::mat4(m_rotation) * glm::scale(glm::mat4(1), m_scale);
    CModelData::drawIbos(false, currentMaterialSet(), model);
    CModelData::drawIbos(true,  currentMaterialSet(), model);
}
void CModelFile::draw()
{
    currentMaterialSet().setAmbient(m_ambient);

    CTransform model = CTransform(m_rotation) * CTransformFromScaleVector(m_scale);
    model.m_origin = m_position;
    CModelData::drawIbos(false, currentMaterialSet(), model);
    CModelData::drawIbos(true,  currentMaterialSet(), model);
}
void CModelFile::updateTexturesEnabled(const bool& enabled)
{
    for (atUint32 matId : currentMaterialSet().materials())
    {
        CMaterial& mat = CMaterialCache::instance()->material(matId);
        mat.setTexturesEnabled(enabled);
    }
}
void CModelFile::updateViewProjectionUniforms(const CTransform& view, const CProjection& proj)
{
    for (atUint32 matId : currentMaterialSet().materials())
    {
        CMaterial& mat = CMaterialCache::instance()->material(matId);
        mat.setView(view);
        mat.setProjection(proj);
    }
}
Exemple #5
0
void CModelFile::updateViewProjectionUniforms(const glm::mat4& view, const glm::mat4& proj)
{
    for (atUint32 matId : currentMaterialSet().materials())
    {
        CMaterial& mat = CMaterialCache::instance()->material(matId);
        mat.setViewMatrix(view);
        mat.setProjectionMatrix(proj);
    }
}
void CModelFile::exportToObj(const std::string& filepath)
{
    atUint32 vertexOff = 1;
    atUint32 normalOff = 1;
    atUint32 texCoordOff = 1;
    std::ofstream out(filepath);
    CModelData::exportModel(out, vertexOff, normalOff, texCoordOff, currentMaterialSet());
    out.flush();
    out.close();
}