clothsimulation using opengl

前端 未结 1 619
醉话见心
醉话见心 2021-01-29 13:40

some portion of my code where I m getting error,in line 249,252 and 255

void drawTriangle(Particle *p1, Particle *p2, Particle *p3, const Vec3 color)         


        
相关标签:
1条回答
  • 2021-01-29 14:07

    If the return type of

    p1->getNormal().normalized()
    

    is a value, it is a temporary value that doesn't have an address.

    However if you store it in a varilable

    auto instance = p1->getNormal().normalized();
    

    You can take the address of instance. If this is a good idea or not depends on if glNormal3fv expects that pointer to be valid longer than the scope of your function.

    0 讨论(0)
提交回复
热议问题