File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1919,13 +1919,23 @@ void GenericCAO::updateMeshCulling()
1919
1919
if (!m_is_local_player)
1920
1920
return ;
1921
1921
1922
- // Grab the active player scene node so we know there's
1923
- // at least a mesh to occlude from the camera.
1922
+ const bool hidden = m_client->getCamera ()->getCameraMode () == CAMERA_MODE_FIRST;
1923
+
1924
+ if (m_meshnode && m_prop.visual == " upright_sprite" ) {
1925
+ u32 buffers = m_meshnode->getMesh ()->getMeshBufferCount ();
1926
+ for (u32 i = 0 ; i < buffers; i++) {
1927
+ video::SMaterial &mat = m_meshnode->getMesh ()->getMeshBuffer (i)->getMaterial ();
1928
+ // upright sprite has no backface culling
1929
+ mat.setFlag (video::EMF_FRONT_FACE_CULLING, hidden);
1930
+ }
1931
+ return ;
1932
+ }
1933
+
1924
1934
irr::scene::ISceneNode *node = getSceneNode ();
1925
1935
if (!node)
1926
1936
return ;
1927
1937
1928
- if (m_client-> getCamera ()-> getCameraMode () == CAMERA_MODE_FIRST ) {
1938
+ if (hidden ) {
1929
1939
// Hide the mesh by culling both front and
1930
1940
// back faces. Serious hackyness but it works for our
1931
1941
// purposes. This also preserves the skeletal armature.
You can’t perform that action at this time.
0 commit comments