本文整理汇总了C++中StaticObject::copyIndices方法的典型用法代码示例。如果您正苦于以下问题:C++ StaticObject::copyIndices方法的具体用法?C++ StaticObject::copyIndices怎么用?C++ StaticObject::copyIndices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StaticObject
的用法示例。
在下文中一共展示了StaticObject::copyIndices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
//.........这里部分代码省略.........
}
if (m_config.findItem(name, KEY_specular)) {
const std::string &str = (std::string)m_config.getItem(name, KEY_specular);
sscanf(str.c_str(), "%f;%f;%f;%f", &m[0], &m[1], &m[2], &m[3]);
so->setSpecular(m);
}
if (m_config.findItem(name, KEY_emission)) {
const std::string &str = (std::string)m_config.getItem(name, KEY_emission);
sscanf(str.c_str(), "%f;%f;%f;%f", &m[0], &m[1], &m[2], &m[3]);
so->setEmission(m);
}
if (m_config.findItem(name, KEY_shininess)) {
so->setShininess((double)m_config.getItem(name, KEY_shininess));
}
}
// Set the transform
so->getMatrix().setMatrix(matrix);
// Set the textures
so->setTexture(0, texture_id, texture_mask_id);
so->setNumPoints(meshp->mesh_header->vertex_count);
so->setNumFaces(meshp->mesh_header->triangle_count);
// Copy data into array.
so->createVertexData(meshp->mesh_header->vertex_count * 3);
float *ptr = so->getVertexDataPtr();
for (int i = 0; i < meshp->mesh_header->vertex_count * 3; ++i) {
ptr[i] = default_scale * (float)meshp->vertices[i];
}
so->copyTextureData(meshp->texcoords, meshp->mesh_header->vertex_count * 2);
so->copyNormalData(meshp->normals, meshp->mesh_header->vertex_count * 3);
so->copyIndices(meshp->triangles, meshp->mesh_header->triangle_count * 3);
m_static_objects.push_back(so);
}
libmd3_file_free(modelFile);
bool ignore_minus_z = false;
Scaling scale = SCALE_NONE;
Alignment align = ALIGN_NONE;
bool process_model = false;
if (m_config.findItem(SECTION_model, KEY_ignore_minus_z)) {
if ((bool)m_config.getItem(SECTION_model, KEY_ignore_minus_z)) {
process_model = true;
ignore_minus_z = true;
}
}
if (m_config.findItem(SECTION_model, KEY_z_align)) {
if ((bool)m_config.getItem(SECTION_model, KEY_z_align)) {
process_model = true;
align = ALIGN_Z;
}
}
if (m_config.findItem(SECTION_model, KEY_scale_isotropic)) {
if ((bool)m_config.getItem(SECTION_model, KEY_scale_isotropic)) {
process_model = true;
scale = SCALE_ISOTROPIC;
}
}
else if (m_config.findItem(SECTION_model, KEY_scale_isotropic_x)) {