FaceCullMode in a spatial?

Hello everyone, i have the next problem:

I wanted to load a 3d model made in blender with the texture. I found that I could do that exporting the model with blend to ogre exported. I have my model displaying in jmonkey now but there is a problem, inside faces of the mesh are not showed and I wish to show them! :sob:

I know you can adjust FaceCullMode when yo use a material but spatial don,t let me take acces to material, only let me create material an then assing that material to the spatial, and in this case I,m loosing the texture made in Blender.

Basically my question is : Somebody knows how could I get showing the inside faces of a spatial?

Why not creating a material for your spatial? Then you just set the texture and FaceCullMode to off and you are good to go.

EDIT:
In the case you want to keep your blender material: Just check “Double Sided” in mesh options.

2 Likes

Thank you so much, I din,t know this blender option cause I,m newbie, The problem is solved with your help !!

1 Like

In future, get the children of the Spatial and cast them to Geometry, if you wish to dynamically change the cull modes.

For example:

   Geometry turret2 = (Geometry) tank.getChild("Shield"); //The energy shield in my tank spatial.
    Material mat = turret2.getMaterial(); //Get it's material.
   
    if (shield <= 30){ //If no shield is left, 30 because the default bullet damage is 30 in my game so < 30 = "it does nothing".
        mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.FrontAndBack); //Hide the shield
    }else{
     mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Back); //Show the shield
     }