mirror of
https://github.com/raysan5/raylib.git
synced 2026-04-09 16:59:09 -04:00
Compare commits
3 Commits
d7bd56ef1b
...
ba83bd33f3
| Author | SHA1 | Date | |
|---|---|---|---|
| ba83bd33f3 | |||
| 98d6e24c44 | |||
| 51f4741912 |
@ -52,7 +52,7 @@ void main()
|
||||
|
||||
float specCo = 0.0;
|
||||
|
||||
if (NdotL > 0.0) specCo = pow(max(0.0, dot(viewDir, reflect(-lightDir, normal))), specularExponent); // 16 refers to shine
|
||||
if (NdotL > 0.0) specCo = pow(max(0.0, dot(viewDir, reflect(-lightDir, normal))), specularExponent);
|
||||
|
||||
specular += specCo;
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ void main()
|
||||
|
||||
float specCo = 0.0;
|
||||
|
||||
if (NdotL > 0.0) specCo = pow(max(0.0, dot(viewDir, reflect(-lightDir, normal))), specularExponent); // 16 refers to shine
|
||||
if (NdotL > 0.0) specCo = pow(max(0.0, dot(viewDir, reflect(-lightDir, normal))), specularExponent);
|
||||
|
||||
specular += specCo;
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ void main()
|
||||
|
||||
float specCo = 0.0;
|
||||
|
||||
if (NdotL > 0.0) specCo = pow(max(0.0, dot(viewDir, reflect(-lightDir, normal))), specularExponent); // 16 refers to shine
|
||||
if (NdotL > 0.0) specCo = pow(max(0.0, dot(viewDir, reflect(-lightDir, normal))), specularExponent);
|
||||
|
||||
specular += specCo;
|
||||
|
||||
|
||||
@ -1281,7 +1281,6 @@ void UploadMesh(Mesh *mesh, bool dynamic)
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||
mesh->vaoId = rlLoadVertexArray();
|
||||
if (mesh->vaoId == 0) return;
|
||||
|
||||
rlEnableVertexArray(mesh->vaoId);
|
||||
|
||||
@ -4086,7 +4085,8 @@ bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, floa
|
||||
*/
|
||||
|
||||
// Check for distances squared to avoid sqrtf()
|
||||
if (Vector3DotProduct(Vector3Subtract(center2, center1), Vector3Subtract(center2, center1)) <= (radius1 + radius2)*(radius1 + radius2)) collision = true;
|
||||
float radSum = radius1 + radius2;
|
||||
if (Vector3DistanceSqr(center1, center2) <= radSum*radSum) collision = true;
|
||||
|
||||
return collision;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user