[solved]changing obj loader to 32bit index type

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
kaos
Posts: 155
Joined: Tue Aug 12, 2008 8:25 pm
Location: Spain

[solved]changing obj loader to 32bit index type

Post by kaos »

I have changed the constructor class.

Code: Select all

 
 
        struct SObjMtl
        {
                SObjMtl() : Meshbuffer(0), Bumpiness (1.0f), Illumination(0),
                        RecalculateNormals(false)
                {
                        Meshbuffer = new CDynamicMeshBuffer(video::EVT_STANDARD,video::EIT_32BIT);
                        //Meshbuffer = new SMeshBuffer();
                        Meshbuffer->Material.Shininess = 0.0f;
                        Meshbuffer->Material.AmbientColor = video::SColorf(0.2f, 0.2f, 0.2f, 1.0f).toSColor();
                        Meshbuffer->Material.DiffuseColor = video::SColorf(0.8f, 0.8f, 0.8f, 1.0f).toSColor();
                        Meshbuffer->Material.SpecularColor = video::SColorf(1.0f, 1.0f, 1.0f, 1.0f).toSColor();
                }
 
                SObjMtl(const SObjMtl& o)
                        : Name(o.Name), Group(o.Group),
                        Bumpiness(o.Bumpiness), Illumination(o.Illumination),
                        RecalculateNormals(false)
                {
                        Meshbuffer = new CDynamicMeshBuffer(video::EVT_STANDARD,video::EIT_32BIT);
                        //Meshbuffer = new SMeshBuffer();
                        Meshbuffer->Material = o.Meshbuffer->Material;
                }
 
                core::map<video::S3DVertex, int> VertMap;
                //scene::SMeshBuffer *Meshbuffer;
                CDynamicMeshBuffer *Meshbuffer;
                core::stringc Name;
                core::stringc Group;
                f32 Bumpiness;
                c8 Illumination;
                bool RecalculateNormals;
        };
 
 
there aren't warnnings, but the mesh don't load correctly. ¿any play more for make changes?
Last edited by kaos on Wed Apr 25, 2012 3:54 pm, edited 2 times in total.
kaos
Posts: 155
Joined: Tue Aug 12, 2008 8:25 pm
Location: Spain

Re: changing obj loader to 32bit index type[solve]

Post by kaos »

I found the problem.

fast_atof don't work if we have a big float values(like long double) in ascii files.
Post Reply