405 |
NSParameterAssert (camera); |
NSParameterAssert (camera); |
406 |
NSParameterAssert (name); |
NSParameterAssert (name); |
407 |
NSParameterAssert ([name length] != 0); |
NSParameterAssert ([name length] != 0); |
408 |
|
|
409 |
MdlAnimation *animation = [self animation: name]; |
MdlAnimation *animation = [self animation: name]; |
410 |
|
|
411 |
NSParameterAssert ( frame >= [animation startFrame]); |
NSParameterAssert ( frame >= [animation startFrame]); |
412 |
NSParameterAssert ( frame < [animation startFrame] + [animation nbFrames]); |
NSParameterAssert ( frame < [animation startFrame] + [animation nbFrames]); |
413 |
|
|
414 |
|
|
415 |
GLfloat vertice[_nbVertices * 3* 2 + _nbVertices * 2 ]; |
GLfloat vertice[_nbVertices * 3* 2 + _nbVertices * 2 ]; |
416 |
|
|
420 |
int noVertex; |
int noVertex; |
421 |
for (noVertex = 0; noVertex < _nbVertices; noVertex++) |
for (noVertex = 0; noVertex < _nbVertices; noVertex++) |
422 |
{ |
{ |
423 |
|
|
424 |
coord_t currentNormal = _normales [noVertex + frame * _nbVertices]; |
coord_t currentNormal = _normales [noVertex + frame * _nbVertices]; |
425 |
coord_t nextNormal = _normales [noVertex + nextFrame * _nbVertices]; |
coord_t nextNormal = _normales [noVertex + nextFrame * _nbVertices]; |
426 |
|
|
456 |
glEnable(GL_NORMALIZE); |
glEnable(GL_NORMALIZE); |
457 |
int nbElements = [_data meshNbTriangles: noMesh]*3; |
int nbElements = [_data meshNbTriangles: noMesh]*3; |
458 |
glBindTexture(GL_TEXTURE_2D, [self _texture: noMesh]); |
glBindTexture(GL_TEXTURE_2D, [self _texture: noMesh]); |
459 |
|
|
460 |
glDrawElements (GL_TRIANGLES, nbElements, |
glDrawElements (GL_TRIANGLES, nbElements, |
461 |
GL_UNSIGNED_INT, _verticeIndices + ind); |
GL_UNSIGNED_INT, _verticeIndices + ind); |
462 |
glDisable(GL_NORMALIZE); |
glDisable(GL_NORMALIZE); |
563 |
{ |
{ |
564 |
NSParameterAssert (noMesh >= 0); |
NSParameterAssert (noMesh >= 0); |
565 |
NSParameterAssert (noMesh < [_data nbMeshes]); |
NSParameterAssert (noMesh < [_data nbMeshes]); |
566 |
|
|
567 |
return (GLuint) [[_textures objectAtIndex: noMesh] intValue]; |
return (GLuint) [[_textures objectAtIndex: noMesh] intValue]; |
568 |
} |
} |
569 |
|
|