/*
Minetest
-Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
+Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
{
public:
// Builds the mesh given
- MapBlockMesh(MeshMakeData *data);
+ MapBlockMesh(MeshMakeData *data, v3s16 camera_offset);
~MapBlockMesh();
// Main animation function, parameters:
if(m_animation_force_timer > 0)
m_animation_force_timer--;
}
+
+ void updateCameraOffset(v3s16 camera_offset);
private:
scene::SMesh *m_mesh;
u32 m_last_daynight_ratio;
// For each meshbuffer, maps vertex indices to (day,night) pairs
std::map<u32, std::map<u32, std::pair<u8, u8> > > m_daynight_diffs;
+
+ // Camera offset info -> do we have to translate the mesh?
+ v3s16 m_camera_offset;
};
struct PreMeshBuffer
{
TileSpec tile;
- core::array<u16> indices;
- core::array<video::S3DVertex> vertices;
+ std::vector<u16> indices;
+ std::vector<video::S3DVertex> vertices;
};
struct MeshCollector
{
- core::array<PreMeshBuffer> prebuffers;
+ std::vector<PreMeshBuffer> prebuffers;
void append(const TileSpec &material,
const video::S3DVertex *vertices, u32 numVertices,
}
// Compute light at node
-u16 getInteriorLight(MapNode n, s32 increment, MeshMakeData *data);
-u16 getFaceLight(MapNode n, MapNode n2, v3s16 face_dir, MeshMakeData *data);
+u16 getInteriorLight(MapNode n, s32 increment, INodeDefManager *ndef);
+u16 getFaceLight(MapNode n, MapNode n2, v3s16 face_dir, INodeDefManager *ndef);
u16 getSmoothLight(v3s16 p, v3s16 corner, MeshMakeData *data);
// Retrieves the TileSpec of a face of a node