stepheight = 0,
automatic_face_movement_dir = 0.0,
-- ^ automatically set yaw to movement direction; offset in degrees; false to disable
+ backface_culling = true, -- false to disable backface_culling for model
}
### Entity definition (`register_entity`)
u8 li = m_last_light;
setMeshColor(m_animated_meshnode->getMesh(), video::SColor(255,li,li,li));
+ bool backface_culling = m_prop.backface_culling;
+ if (m_is_player)
+ backface_culling = false;
+
m_animated_meshnode->setMaterialFlag(video::EMF_LIGHTING, false);
m_animated_meshnode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
m_animated_meshnode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
m_animated_meshnode->setMaterialFlag(video::EMF_FOG_ENABLE, true);
+ m_animated_meshnode->setMaterialFlag(video::EMF_BACK_FACE_CULLING, backface_culling);
}
else
errorstream<<"GenericCAO::addToScene(): Could not load mesh "<<m_prop.mesh<<std::endl;
automatic_rotate(0),
stepheight(0),
automatic_face_movement_dir(false),
- automatic_face_movement_dir_offset(0.0)
+ automatic_face_movement_dir_offset(0.0),
+ backface_culling(true)
{
textures.push_back("unknown_object.png");
colors.push_back(video::SColor(255,255,255,255));
os<<", is_visible="<<is_visible;
os<<", makes_footstep_sound="<<makes_footstep_sound;
os<<", automatic_rotate="<<automatic_rotate;
+ os<<", backface_culling="<<backface_culling;
return os.str();
}
writeF1000(os,stepheight);
writeU8(os, automatic_face_movement_dir);
writeF1000(os, automatic_face_movement_dir_offset);
+ writeU8(os, backface_culling);
// Add stuff only at the bottom.
// Never remove anything, because we don't want new versions of this
}
stepheight = readF1000(is);
automatic_face_movement_dir = readU8(is);
automatic_face_movement_dir_offset = readF1000(is);
+ backface_culling = readU8(is);
}catch(SerializationError &e){}
}
else
throw SerializationError("unsupported ObjectProperties version");
}
}
-
f32 stepheight;
bool automatic_face_movement_dir;
f32 automatic_face_movement_dir_offset;
+ bool backface_culling;
ObjectProperties();
};
#endif
-
prop->automatic_face_movement_dir_offset = 0.0;
}
lua_pop(L, 1);
+ getboolfield(L, -1, "backface_culling", prop->backface_culling);
}
/******************************************************************************/
else
lua_pushboolean(L, false);
lua_setfield(L, -2, "automatic_face_movement_dir");
+ lua_pushboolean(L, prop->backface_culling);
+ lua_setfield(L, -2, "backface_culling");
}
/******************************************************************************/
}
lua_pop(L, 1); // Pop value
}
-