Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Nov 21, 2024
1 parent 49632a9 commit 2d27423
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ open class DrawableShape protected constructor(): Drawable {
program.loadClipDistance((mvpMatrix.m[11] / (mvpMatrix.m[10] - 1.0)).toFloat() / 2.0f) // nearPlane / 2.0f
mvpMatrix.multiplyByMatrix(dc.modelview)
} else {
program.loadClipDistance((dc.projection.m[11] / (dc.projection.m[10] - 1.0f)).toFloat() / 2.0f) // nearPlane / 2.0f
program.loadClipDistance((dc.projection.m[11] / (dc.projection.m[10] - 1.0)).toFloat() / 2.0f) // nearPlane / 2.0f
mvpMatrix.copy(dc.modelviewProjection)
}
mvpMatrix.multiplyByTranslation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,20 @@ open class TriangleShaderProgram : AbstractShaderProgram() {
vec4 pointCScreen = mvpMatrix * vec4(pointC.xyz, 1);
vec4 interpolationPoint = pointB.w < 0.0 ? pointAScreen : pointCScreen; // not a mistake, this should be assigned here
if(pointBScreen.w < 0.0)
{
if (pointBScreen.w < 0.0) {
pointBScreen = mix(pointBScreen, interpolationPoint, clamp((clipDistance - pointBScreen.w)/(interpolationPoint.w - pointBScreen.w), 0.0, 1.0));
if(pointB.w < 0.0)
{
if (pointB.w < 0.0) {
pointCScreen = pointBScreen;
} else
{
} else {
pointAScreen = pointBScreen;
}
}
if(pointAScreen.w < 0.0)
{
if (pointAScreen.w < 0.0) {
pointAScreen = mix(pointAScreen, pointBScreen, clamp((clipDistance - pointAScreen.w)/(pointBScreen.w - pointAScreen.w), 0.0, 1.0));
}
if(pointCScreen.w < 0.0)
{
if (pointCScreen.w < 0.0) {
pointCScreen = mix(pointCScreen, pointBScreen, clamp((clipDistance - pointCScreen.w)/(pointBScreen.w - pointCScreen.w), 0.0, 1.0));
}
Expand Down

0 comments on commit 2d27423

Please sign in to comment.