Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Node highlighting
- if (m_enable_highlighting) {
- u8 day = m_highlight_mesh_color.getRed();
- u8 night = m_highlight_mesh_color.getGreen();
- video::SColor hc;
- finalColorBlend(hc, day, night, daynight_ratio);
- float sin_r = 0.07 * sin(1.5 * time);
- float sin_g = 0.07 * sin(1.5 * time + irr::core::PI * 0.5);
- float sin_b = 0.07 * sin(1.5 * time + irr::core::PI);
- float base = 0.8;
- if (crack != -1)
- base -= crack * 0.1;
- hc.setRed(core::clamp(core::round32(hc.getRed() * (base + sin_r)), 0, 255));
- hc.setGreen(core::clamp(core::round32(hc.getGreen() * (base + sin_g)), 0, 255));
- hc.setBlue(core::clamp(core::round32(hc.getBlue() * (base + sin_b)), 0, 255));
- for(std::list<u32>::iterator
- i = m_highlighted_materials.begin();
- i != m_highlighted_materials.end(); i++)
- {
- scene::IMeshBuffer *buf = m_mesh->getMeshBuffer(*i);
- video::S3DVertex *vertices = (video::S3DVertex*)buf->getVertices();
- for (u32 j = 0; j < buf->getVertexCount() ;j++)
- vertices[j].Color = hc;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement