[Solved in trunk] CMeshManipulator recalculateNormals 32bit

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
FreeFrags
Posts: 16
Joined: Thu Mar 25, 2010 2:04 pm

[Solved in trunk] CMeshManipulator recalculateNormals 32bit

Post by FreeFrags »

I have a DynamicMeshBuffer which has the vertex and index type set to irr::video::EIT_32BIT.

Im trying to do a CMeshManipulator::recalculateNormals on a the buffer. Which means this function is called:

Code: Select all

void CMeshManipulator::recalculateNormals(IMeshBuffer* buffer, bool smooth, bool angleWeighted) const
{
    if (!buffer)
        return;
 
    const u32 vtxcnt = buffer->getVertexCount();
    const u32 idxcnt = buffer->getIndexCount();
    const u16* idx = buffer->getIndices();
now i believe this line is not correct in this case (using a 16 bit index type its fine)

Code: Select all

const u16* idx = buffer->getIndices();
This calls the following function in IDynamicMeshBuffer:

Code: Select all

virtual const u16* getIndices() const
        {
            return (u16*)getIndexBuffer().getData();
        }
But since i set my index type to 32 bit i think we have an issue here.

Im using 1.7.3
Last edited by FreeFrags on Wed Aug 15, 2012 1:28 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: CMeshManipulator::recalculateNormals on a DynamicMeshBuf

Post by hybrid »

Yes, we've updated several of those methods to xsupport 32bit indices in recent SVN versions. Not sure, though, which functions did not get an update.
FreeFrags
Posts: 16
Joined: Thu Mar 25, 2010 2:04 pm

Re: [Solved in trunk] CMeshManipulator recalculateNormals 32

Post by FreeFrags »

Thanks for your reply I checked the trunk and applied copied the patch of the following function and it works

Code: Select all

void CMeshManipulator::recalculateNormals(IMeshBuffer* buffer, bool smooth, bool angleWeighted) const
Post Reply