Fix bug where an animated texture matrix could never be reset to identity. Fixes #2692
This commit is contained in:
parent
4ee6f6315f
commit
5f0a65a07b
@ -40,6 +40,7 @@ const core::vector3df& scale, RenderInfo* render_info, bool all_parts_colorized)
|
||||
{
|
||||
isGLInitialized = false;
|
||||
isMaterialInitialized = false;
|
||||
m_got_animated_matrix = false;
|
||||
m_mesh_render_info = render_info;
|
||||
m_all_parts_colorized = all_parts_colorized;
|
||||
#ifdef DEBUG
|
||||
@ -192,10 +193,11 @@ void STKAnimatedMesh::updateNoGL()
|
||||
{
|
||||
// Test if texture matrix needs to be updated every frame
|
||||
const core::matrix4& mat = getMaterial(i).getTextureMatrix(0);
|
||||
if (mat.isIdentity())
|
||||
if (mat.isIdentity() && !m_got_animated_matrix)
|
||||
continue;
|
||||
else
|
||||
{
|
||||
m_got_animated_matrix = true;
|
||||
GLmeshes[i].texture_trans.X = mat[8];
|
||||
GLmeshes[i].texture_trans.Y = mat[9];
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ public:
|
||||
private:
|
||||
RenderInfo* m_mesh_render_info;
|
||||
bool m_all_parts_colorized;
|
||||
bool m_got_animated_matrix;
|
||||
};
|
||||
|
||||
#endif // STKANIMATEDMESH_HPP
|
||||
|
@ -61,6 +61,7 @@ STKMeshSceneNode::STKMeshSceneNode(irr::scene::IMesh* mesh, ISceneNode* parent,
|
||||
update_each_frame = false;
|
||||
m_frame_for_mesh = frame_for_mesh;
|
||||
isGlow = false;
|
||||
m_got_animated_matrix = false;
|
||||
|
||||
m_debug_name = debug_name;
|
||||
|
||||
@ -244,10 +245,11 @@ void STKMeshSceneNode::updateNoGL()
|
||||
{
|
||||
// Test if texture matrix needs to be updated every frame
|
||||
const core::matrix4& mat = getMaterial(i).getTextureMatrix(0);
|
||||
if (mat.isIdentity())
|
||||
if (mat.isIdentity() && !m_got_animated_matrix)
|
||||
continue;
|
||||
else
|
||||
{
|
||||
m_got_animated_matrix = true;
|
||||
GLmeshes[i].texture_trans.X = mat[8];
|
||||
GLmeshes[i].texture_trans.Y = mat[9];
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ class STKMeshSceneNode : public irr::scene::CMeshSceneNode, public STKMeshCommon
|
||||
protected:
|
||||
PtrVector<RenderInfo> m_static_render_info;
|
||||
int m_frame_for_mesh;
|
||||
bool m_got_animated_matrix;
|
||||
std::vector<GLMesh> GLmeshes;
|
||||
core::matrix4 ModelViewProjectionMatrix;
|
||||
core::vector3df windDir;
|
||||
|
@ -146,6 +146,8 @@ void RaceGUIBase::reset()
|
||||
|
||||
m_referee_height = 10.0f;
|
||||
m_referee->attachToSceneNode();
|
||||
m_referee->selectReadySetGo(0); // set red color
|
||||
|
||||
m_plunger_move_time = 0;
|
||||
m_plunger_offset = core::vector2di(0,0);
|
||||
m_plunger_speed = core::vector2df(0,0);
|
||||
|
Loading…
Reference in New Issue
Block a user