for(u32 j = 0; j < p.vertices.size(); j++)
{
- video::S3DVertexTangents *vertex = &p.vertices[j];
+ video::S3DVertex *vertex = &p.vertices[j];
// Note applyFacesShading second parameter is precalculated sqrt
// value for speed improvement
// Skip it for lightsources and top faces.
}
// Create meshbuffer
- scene::SMeshBufferTangents *buf = new scene::SMeshBufferTangents();
+ scene::SMeshBuffer *buf = new scene::SMeshBuffer();
// Set material
buf->Material = material;
// Add to mesh
- m_mesh->addMeshBuffer(buf);
+ scene::SMesh *mesh = (scene::SMesh *)m_mesh;
+ mesh->addMeshBuffer(buf);
// Mesh grabbed it
buf->drop();
buf->append(&p.vertices[0], p.vertices.size(),
if (m_enable_shaders) {
scene::IMeshManipulator* meshmanip = m_gamedef->getSceneManager()->getMeshManipulator();
- meshmanip->recalculateTangents(m_mesh, true, false, false);
+ scene::IMesh* tangentMesh = meshmanip->createMeshWithTangents(m_mesh);
+ m_mesh->drop();
+ m_mesh = tangentMesh;
}
if(m_mesh)
i != m_daynight_diffs.end(); ++i)
{
scene::IMeshBuffer *buf = m_mesh->getMeshBuffer(i->first);
- video::S3DVertexTangents *vertices = (video::S3DVertexTangents *)buf->getVertices();
+ video::S3DVertex *vertices = (video::S3DVertex *)buf->getVertices();
for(std::map<u32, std::pair<u8, u8 > >::iterator
j = i->second.begin();
j != i->second.end(); ++j)
i != m_highlighted_materials.end(); ++i)
{
scene::IMeshBuffer *buf = m_mesh->getMeshBuffer(*i);
- video::S3DVertexTangents *vertices = (video::S3DVertexTangents*)buf->getVertices();
+ video::S3DVertex *vertices = (video::S3DVertex *)buf->getVertices();
for (u32 j = 0; j < buf->getVertexCount() ;j++)
vertices[j].Color = hc;
}
}
for (u32 i = 0; i < numVertices; i++) {
- video::S3DVertexTangents vert(vertices[i].Pos, vertices[i].Normal,
+ video::S3DVertex vert(vertices[i].Pos, vertices[i].Normal,
vertices[i].Color, vertices[i].TCoords);
p->vertices.push_back(vert);
}
}
for (u32 i = 0; i < numVertices; i++) {
- video::S3DVertexTangents vert(vertices[i].Pos + pos, vertices[i].Normal,
+ video::S3DVertex vert(vertices[i].Pos + pos, vertices[i].Normal,
c, vertices[i].TCoords);
p->vertices.push_back(vert);
}
// Returns true if anything has been changed.
bool animate(bool faraway, float time, int crack, u32 daynight_ratio);
- scene::SMesh *getMesh()
+ scene::IMesh *getMesh()
{
return m_mesh;
}
void updateCameraOffset(v3s16 camera_offset);
private:
- scene::SMesh *m_mesh;
+ scene::IMesh *m_mesh;
MinimapMapblock *m_minimap_mapblock;
IGameDef *m_gamedef;
ITextureSource *m_tsrc;
{
TileSpec tile;
std::vector<u16> indices;
- std::vector<video::S3DVertexTangents> vertices;
+ std::vector<video::S3DVertex> vertices;
};
struct MeshCollector