mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
reviewed ALL non-external files to follow raylib's convention of no spaces around / or * (#5153)
This commit is contained in:
@ -127,8 +127,8 @@ int main(void)
|
||||
if (IsMouseButtonDown(MOUSE_BUTTON_MIDDLE))
|
||||
{
|
||||
const Vector2 mouseDelta = GetMouseDelta();
|
||||
camerarot.x = mouseDelta.x * 0.05f;
|
||||
camerarot.y = mouseDelta.y * 0.05f;
|
||||
camerarot.x = mouseDelta.x*0.05f;
|
||||
camerarot.y = mouseDelta.y*0.05f;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -138,14 +138,14 @@ int main(void)
|
||||
|
||||
UpdateCameraPro(&camera,
|
||||
(Vector3) {
|
||||
(IsKeyDown(KEY_W) || IsKeyDown(KEY_UP)) * 0.1f - // Move forward-backward
|
||||
(IsKeyDown(KEY_S) || IsKeyDown(KEY_DOWN)) * 0.1f,
|
||||
(IsKeyDown(KEY_D) || IsKeyDown(KEY_RIGHT)) * 0.1f - // Move right-left
|
||||
(IsKeyDown(KEY_A) || IsKeyDown(KEY_LEFT)) * 0.1f,
|
||||
(IsKeyDown(KEY_W) || IsKeyDown(KEY_UP))*0.1f - // Move forward-backward
|
||||
(IsKeyDown(KEY_S) || IsKeyDown(KEY_DOWN))*0.1f,
|
||||
(IsKeyDown(KEY_D) || IsKeyDown(KEY_RIGHT))*0.1f - // Move right-left
|
||||
(IsKeyDown(KEY_A) || IsKeyDown(KEY_LEFT))*0.1f,
|
||||
0.0f // Move up-down
|
||||
},
|
||||
camerarot,
|
||||
GetMouseWheelMove() * -2.0f); // Move to target (zoom)
|
||||
GetMouseWheelMove()*-2.0f); // Move to target (zoom)
|
||||
|
||||
// Cycle between models on mouse click
|
||||
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) currentModel = (currentModel + 1) % MAX_VOX_FILES;
|
||||
|
||||
@ -79,9 +79,9 @@ int main(void)
|
||||
// Projection from XYZW to XYZ from perspective point (0, 0, 0, 3)
|
||||
// NOTE: Trace a ray from (0, 0, 0, 3) > p and continue until W = 0
|
||||
float c = 3.0f/(3.0f - p.w);
|
||||
p.x = c * p.x;
|
||||
p.y = c * p.y;
|
||||
p.z = c * p.z;
|
||||
p.x = c*p.x;
|
||||
p.y = c*p.y;
|
||||
p.z = c*p.z;
|
||||
|
||||
// Split XYZ coordinate and W values later for drawing
|
||||
transformed[i] = (Vector3){ p.x, p.y, p.z };
|
||||
@ -125,4 +125,4 @@ int main(void)
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ void main()
|
||||
light = normalize(lights[i].position - fragPosition);
|
||||
|
||||
float NdotL = max(dot(normal, light), 0.0);
|
||||
lightDot += lights[i].color.rgb * NdotL;
|
||||
lightDot += lights[i].color.rgb*NdotL;
|
||||
|
||||
if (NdotL > 0.0)
|
||||
{
|
||||
@ -56,8 +56,8 @@ void main()
|
||||
}
|
||||
}
|
||||
|
||||
vec4 finalColor = (fragColor * ((colDiffuse + vec4(specular, 1.0)) * vec4(lightDot, 1.0)));
|
||||
finalColor += fragColor * (ambient / 10.0) * colDiffuse;
|
||||
vec4 finalColor = (fragColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0)));
|
||||
finalColor += fragColor*(ambient/10.0)*colDiffuse;
|
||||
|
||||
finalColor = pow(finalColor, vec4(1.0/2.2)); // gamma correction
|
||||
|
||||
|
||||
@ -20,9 +20,9 @@ varying vec3 fragNormal;
|
||||
|
||||
void main()
|
||||
{
|
||||
fragPosition = vec3(matModel * vec4(vertexPosition, 1.0));
|
||||
fragPosition = vec3(matModel*vec4(vertexPosition, 1.0));
|
||||
fragColor = vertexColor;
|
||||
fragNormal = normalize(vec3(matNormal * vec4(vertexNormal, 1.0)));
|
||||
fragNormal = normalize(vec3(matNormal*vec4(vertexNormal, 1.0)));
|
||||
|
||||
gl_Position = mvp * vec4(vertexPosition, 1.0);
|
||||
gl_Position = mvp*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ void main()
|
||||
light = normalize(lights[i].position - fragPosition);
|
||||
|
||||
float NdotL = max(dot(normal, light), 0.0);
|
||||
lightDot += lights[i].color.rgb * NdotL;
|
||||
lightDot += lights[i].color.rgb*NdotL;
|
||||
|
||||
if (NdotL > 0.0)
|
||||
{
|
||||
@ -53,8 +53,8 @@ void main()
|
||||
}
|
||||
}
|
||||
|
||||
vec4 finalColor = (fragColor * ((colDiffuse + vec4(specular, 1.0)) * vec4(lightDot, 1.0)));
|
||||
finalColor += fragColor * (ambient / 10.0) * colDiffuse;
|
||||
vec4 finalColor = (fragColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0)));
|
||||
finalColor += fragColor*(ambient/10.0)*colDiffuse;
|
||||
|
||||
finalColor = pow(finalColor, vec4(1.0/2.2)); // gamma correction
|
||||
|
||||
|
||||
@ -16,9 +16,9 @@ varying vec3 fragNormal;
|
||||
|
||||
void main()
|
||||
{
|
||||
fragPosition = vec3(matModel * vec4(vertexPosition, 1.0));
|
||||
fragPosition = vec3(matModel*vec4(vertexPosition, 1.0));
|
||||
fragColor = vertexColor;
|
||||
fragNormal = normalize(vec3(matNormal * vec4(vertexNormal, 1.0)));
|
||||
fragNormal = normalize(vec3(matNormal*vec4(vertexNormal, 1.0)));
|
||||
|
||||
gl_Position = mvp * vec4(vertexPosition, 1.0);
|
||||
gl_Position = mvp*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user