-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvement quality of floors and ceilings
- Loading branch information
Michał Podgajny
committed
Oct 13, 2022
1 parent
77f8c65
commit 8f49399
Showing
26 changed files
with
437 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...example/raycaster/Model/Raycasting/Raycasting/PreBaking/Ray/PreColumns/HalfPreColumn.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Ray.PreColumns; | ||
|
||
import com.example.raycaster.Model.Raycasting.Raycasting.Analyse.Entities.InPoint; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Ray.PointOnRay; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.RenderInfoBuffer; | ||
|
||
public final class HalfPreColumn { | ||
|
||
public static void bufferHalfUpperColumn(double height){ | ||
|
||
RenderInfoBuffer.llhheight[ PreColumn.uppernum] = height; | ||
|
||
|
||
RenderInfoBuffer.lluposX[ PreColumn.uppernum] = (int) PointOnRay.posX; | ||
RenderInfoBuffer.lluposY[ PreColumn.uppernum] = (int) PointOnRay.posY; | ||
|
||
RenderInfoBuffer.lhheight[InPoint.countPos] = height; | ||
|
||
if ( PreColumn.uppernum < RenderInfoBuffer.lhheight.length - 1) PreColumn.uppernum++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...xample/raycaster/Model/Raycasting/Raycasting/PreBaking/Ray/PreColumns/UpperPreColumn.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Ray.PreColumns; | ||
|
||
import com.example.raycaster.Model.Raycasting.Raycasting.Analyse.Entities.InPoint; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.Analyse.Entities.Ray; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.Analyse.Entities.Sight; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Ray.AngleRay; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Ray.PointOnRay; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.RenderInfoBuffer; | ||
import com.example.raycaster.Model.Resources.Map.Map; | ||
import com.example.raycaster.View.Raycasting.BasicElements.Column; | ||
|
||
public final class UpperPreColumn { | ||
|
||
|
||
public static double getLastUpperBuildingHeight(double height){ | ||
double lhaa = RenderInfoBuffer.lhhheight[InPoint.countPos]; | ||
|
||
if (Map.isNeighbourhood((int) PointOnRay.posX, (int) PointOnRay.posY, RenderInfoBuffer.llluposX[PreColumn.uppernumh],RenderInfoBuffer.llluposY[ PreColumn.uppernumh])) { | ||
if (Column.noTrapeze(PointOnRay.deltaPosY, AngleRay.val) || (!Sight.lupperbuildingXa || Ray.upperbuildingXa)) { | ||
lhaa = height; | ||
} | ||
} | ||
|
||
if (lhaa == 0) { | ||
lhaa = RenderInfoBuffer.lllhheight[PreColumn.uppernumh]; | ||
if(lhaa == 0) lhaa = height; | ||
|
||
double taa = height / lhaa; | ||
if (taa > 4 || taa < 0.25) lhaa = height; | ||
} | ||
|
||
return lhaa; | ||
} | ||
|
||
public static void bufferUpperBuildingColumn(double height){ | ||
RenderInfoBuffer.llluposX[PreColumn.uppernumh] = (int) PointOnRay.posX; | ||
RenderInfoBuffer.llluposY[PreColumn.uppernumh] = (int) PointOnRay.posY; | ||
|
||
|
||
RenderInfoBuffer.lhhheight[InPoint.countPos] = height; | ||
Ray.upperbuildingXa = true; | ||
|
||
RenderInfoBuffer.lllhheight[PreColumn.uppernumh] = height; | ||
if (PreColumn.uppernumh < RenderInfoBuffer.lhheight.length - 1) PreColumn.uppernumh++; | ||
} | ||
|
||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...va/com/example/raycaster/Model/Raycasting/Raycasting/PreBaking/Sprites/DynamicSprite.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Sprites; | ||
|
||
import com.example.raycaster.Model.Raycasting.Raycasting.Analyse.Entities.Ray; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.Analyse.Entities.Sight; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Math.Functions; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Ray.PointOnRay; | ||
import com.example.raycaster.View.Raycasting.Sprites.SpriteRotateColumn; | ||
|
||
public final class DynamicSprite { | ||
|
||
public static boolean statusofangle = false; | ||
|
||
public static void renderDynamicSprite(double heights,int shadows){ | ||
final int fun = (int) (-Sight.tan * (double) PointOnRay.intdeltaPosX + Sight.tan * (double) Sight.spritePosX + (double) Sight.spritePosY); | ||
|
||
|
||
final int posTexX = Functions.getSqrt(SpriteDetector.eq) + 1; | ||
statusofangle = PointOnRay.intdeltaPosY > fun; | ||
|
||
if (statusofangle != Ray.lstatusofAngle) { | ||
|
||
SpriteRotateColumn.render(heights, (byte) posTexX, shadows); | ||
|
||
} | ||
|
||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...a/com/example/raycaster/Model/Raycasting/Raycasting/PreBaking/Sprites/SpriteDetector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Sprites; | ||
|
||
import com.example.raycaster.Model.Raycasting.Raycasting.Analyse.Entities.Sight; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Ray.PointOnRay; | ||
import com.example.raycaster.Model.Raycasting.RenderProcedure; | ||
|
||
public final class SpriteDetector { | ||
|
||
public static int eq; | ||
|
||
public static boolean isSprite(){ | ||
boolean decision; | ||
|
||
if (Sight.obj != 3) decision = true; | ||
else { | ||
|
||
int sqx = (PointOnRay.intdeltaPosX - Sight.spritePosX); | ||
int sqy = (PointOnRay.intdeltaPosY - Sight.spritePosY); | ||
eq = sqx * sqx + sqy * sqy; | ||
decision = eq < 512; | ||
} | ||
|
||
|
||
if ((int) PointOnRay.posX == (int) RenderProcedure.pos.x && (int) PointOnRay.posY == (int) RenderProcedure.pos.y) { | ||
decision = false; | ||
} | ||
|
||
return decision; | ||
} | ||
|
||
} |
Oops, something went wrong.