Menu

aiGetMaterialFloat() not working? (C)

Luan
2016-07-18
2016-07-28
  • Luan

    Luan - 2016-07-18

    Adding this to my code:

    float f = 1.0f;
    aiGetMaterialFloat(mat, AI_MATKEY_SHININESS, &f);
    

    results in:

    gcc src/*.c examples/game.c -o bin/game.o -lGL -lGLEW -lSDL2 -lSDL2_image -lassimp -lm

    In file included from /usr/include/assimp/scene.h:53:0,
                     from src/../include/mesh.h:13,
                     from src/mesh.c:1:
    src/mesh.c: In function mesh_setMaterialData:
    src/mesh.c:71:2: error: pMat undeclared (first use in this function)
      aiGetMaterialFloat(mat, AI_MATKEY_SHININESS, &f);
      ^
    src/mesh.c:71:2: note: each undeclared identifier is reported only once for each function it appears in
    src/mesh.c:71:2: error: type undeclared (first use in this function)
      aiGetMaterialFloat(mat, AI_MATKEY_SHININESS, &f);
      ^
    src/mesh.c:71:2: error: pKey undeclared (first use in this function)
      aiGetMaterialFloat(mat, AI_MATKEY_SHININESS, &f);
      ^
    src/mesh.c:71:2: error: pOut undeclared (first use in this function)
      aiGetMaterialFloat(mat, AI_MATKEY_SHININESS, &f);
      ^
    src/mesh.c:71:2: error: expected ; before aiGetMaterialFloatArray
      aiGetMaterialFloat(mat, AI_MATKEY_SHININESS, &f);
      ^
    make: *** [makefile:2: ALL] Error 1
    

    mat is of type struct aiMaterial*. What am I doing wrong?

     

    Last edit: Luan 2016-07-18
  • Cesar Himura

    Cesar Himura - 2016-07-28

    Hi,

    I used another function, witih 4 parameter and works well.

    float specularPower = 0.0f;
    int max;
    aiGetMaterialFloatArray(material, AI_MATKEY_SHININESS, &specularPower, &max);
    

    Regards

     

Log in to post a comment.