Hello,
I have this piece of code:
if (glfwGetKey( window, GLFW_KEY_O ) == GLFW_PRESS){
if (glfwGetKey( window, GLFW_KEY_1 ) == GLFW_PRESS){//1 pawn
if(strcmp(selected->name,"dummy")!=0 && selected != &mpawn[8]){
EXselected = selected;
if(selected->Kd.x == 0,549){
printf("%f",selected->Kd.x);
selected->Kd.x = 0.0;
selected->Kd.y = 0.0;
selected->Kd.z = 0.0;
}
else if(selected->Kd.x == 0,898){
selected->Kd.x = 0.800;
selected->Kd.y = 0.800;
selected->Kd.z = 0.800;
}
}
selected = &mpawn[8];
selected->Kd.x = 0.898;
selected->Kd.y = 0.227;
selected->Kd.z = 0.227;
selected->Vchange = true;
}
}
selected->Kd is a glm::vec3, with 3 float stored inside x, y and z.
The problem is with the 2 if statements:
if I write if(selected->Kd.x == 0,549) with the comma on 0,549 the statement result is always true.
if I write if(selected->Kd.x == 0.549) with the dot on 0.549 the statement result is always false.
What I am wrong?
if I forgot some informations, please tell me.
Thanks