-
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.
- Loading branch information
Michał Podgajny
committed
Oct 30, 2022
1 parent
206da3f
commit 2a4fc68
Showing
52 changed files
with
443 additions
and
414 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
app/src/main/java/com/example/raycaster/Model/Raycasting/Initializing.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,36 @@ | ||
package com.example.raycaster.Model.Raycasting; | ||
|
||
import com.example.raycaster.Model.RaycasterPoint; | ||
|
||
public final class Initializing { | ||
|
||
|
||
static int startcycles = 0; | ||
|
||
public static void initizer(){ | ||
|
||
int posPix = 0; | ||
if(startcycles<255) { | ||
int level = 200; | ||
|
||
for (int y = 0; y < 399; y++) { | ||
for (int x = 0; x < 639; x++) { | ||
|
||
|
||
RenderProcedure.setPixel(posPix, RenderProcedure.shadowPixel(RenderProcedure.getPixel(posPix),level)); | ||
|
||
posPix+=RenderProcedure.pixelWidth; | ||
} | ||
posPix+=RenderProcedure.pixelWidth; | ||
} | ||
|
||
RenderProcedure.angle +=0.1; | ||
if(RenderProcedure.angle>5){ | ||
RenderProcedure.angle = 0; | ||
} | ||
startcycles +=5; | ||
RenderProcedure.pos = new RaycasterPoint(61.5f,64.5f); | ||
}else{ | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
app/src/main/java/com/example/raycaster/Model/Raycasting/Quality.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,33 @@ | ||
package com.example.raycaster.Model.Raycasting; | ||
|
||
import com.example.raycaster.Model.Game.Moving; | ||
import com.example.raycaster.View.Render; | ||
|
||
public final class Quality { | ||
|
||
|
||
public static final int SCREEN_STEP_STAND =5; | ||
public static final int SCREEN_STEP_WALK = 6; | ||
public final static byte textureResolution = 64; | ||
|
||
public static int SCREEN_STEP; | ||
public static int D_SCREEN_STEP; | ||
public final static float raycasterStep = 0.032f; | ||
public final static float lineHeightStep = (float) RenderProcedure.canvasHeight/(float) RenderProcedure.distance * raycasterStep; | ||
public final static float deltaRaycasterStep = raycasterStep * textureResolution; | ||
|
||
public static float deltaFi; | ||
|
||
public static void adaptationQuality(){ | ||
if(Moving.walking()){ | ||
SCREEN_STEP =SCREEN_STEP_WALK; | ||
}else{ | ||
SCREEN_STEP =SCREEN_STEP_STAND; | ||
} | ||
D_SCREEN_STEP = SCREEN_STEP << 1; | ||
RenderProcedure.realWidth = RenderProcedure.SCREEN_WIDTH << Render.shiftPixelWidth; | ||
|
||
deltaFi = RenderProcedure.pi/((float) 1920/(float) SCREEN_STEP); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/example/raycaster/Model/Raycasting/Raycasting/Analyse/Hit.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,12 @@ | ||
package com.example.raycaster.Model.Raycasting.Raycasting.Analyse; | ||
|
||
public class Hit { | ||
|
||
protected Hit(){ | ||
|
||
} | ||
|
||
public static void analyse(){ | ||
|
||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
...n/java/com/example/raycaster/Model/Raycasting/Raycasting/Analyse/ShapeType/ShapeType.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,13 @@ | ||
package com.example.raycaster.Model.Raycasting.Raycasting.Analyse.ShapeType; | ||
|
||
public class ShapeType { | ||
|
||
public static final int typeIndex = 0; | ||
|
||
private final static int min = 16; | ||
private final static int max = 48; | ||
|
||
protected ShapeType(){ | ||
|
||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...ava/com/example/raycaster/Model/Raycasting/Raycasting/Analyse/ShapeType/Types/Column.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,29 @@ | ||
package com.example.raycaster.Model.Raycasting.Raycasting.Analyse.ShapeType.Types; | ||
|
||
import com.example.raycaster.Model.Raycasting.Raycasting.Analyse.ShapeType.ShapeType; | ||
import com.example.raycaster.Model.Raycasting.Raycasting.PreBaking.Ray.PointOnRay; | ||
|
||
public final class Column extends ShapeType { | ||
|
||
private final static int min = 16; | ||
private final static int max = 48; | ||
|
||
public static final int typeIndex = 11; | ||
private Column(){ | ||
|
||
} | ||
|
||
public static boolean isInShape(){ | ||
boolean inX = PointOnRay.intdeltaPosX > min && PointOnRay.intdeltaPosX < max; | ||
boolean inY = PointOnRay.intdeltaPosY > min && PointOnRay.intdeltaPosY < max; | ||
|
||
int aintX = PointOnRay.intdeltaPosX - 32; | ||
int aintY = PointOnRay.intdeltaPosY - 32; | ||
|
||
int fun = aintX * aintX + aintY * aintY; | ||
|
||
boolean inZ = fun < 256; | ||
|
||
return inX && inY && inZ; | ||
} | ||
} |
21 changes: 17 additions & 4 deletions
21
...in/java/com/example/raycaster/Model/Raycasting/Raycasting/Analyse/Uppers/UpperBlocks.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
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
12 changes: 12 additions & 0 deletions
12
...main/java/com/example/raycaster/Model/Raycasting/Raycasting/MatrixBuffers/InfoBuffer.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,12 @@ | ||
package com.example.raycaster.Model.Raycasting.Raycasting.MatrixBuffers; | ||
|
||
public class InfoBuffer { | ||
|
||
protected final static int neighbourhoodAreaSize = 32 << 5; | ||
protected final static int bufferListSize = 16; | ||
|
||
protected InfoBuffer(){ | ||
|
||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...ava/com/example/raycaster/Model/Raycasting/Raycasting/MatrixBuffers/RenderInfoBuffer.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.MatrixBuffers; | ||
|
||
public final class RenderInfoBuffer extends InfoBuffer{ | ||
|
||
|
||
|
||
public static int[] lfloord =new int[neighbourhoodAreaSize]; | ||
public static int[] lupperd =new int[neighbourhoodAreaSize]; | ||
public static float[] lheightsh = new float[neighbourhoodAreaSize]; | ||
public static int[] lcolumnd =new int[neighbourhoodAreaSize]; | ||
public static int[] lcolumnh =new int[neighbourhoodAreaSize]; | ||
|
||
|
||
private RenderInfoBuffer(){ | ||
|
||
} | ||
|
||
public static void clearBuffers(){ | ||
|
||
|
||
SpriteInfoBuffer.clearBuffers(); | ||
UpperInfoBuffer.clearBuffers(); | ||
|
||
lheightsh= new float[neighbourhoodAreaSize]; | ||
lcolumnd= new int[neighbourhoodAreaSize]; | ||
lcolumnh= new int[neighbourhoodAreaSize]; | ||
lfloord= new int[neighbourhoodAreaSize]; | ||
lupperd= new int[neighbourhoodAreaSize]; | ||
|
||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...ava/com/example/raycaster/Model/Raycasting/Raycasting/MatrixBuffers/SpriteInfoBuffer.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,18 @@ | ||
package com.example.raycaster.Model.Raycasting.Raycasting.MatrixBuffers; | ||
|
||
import com.example.raycaster.Model.Raycasting.RenderProcedure; | ||
|
||
public final class SpriteInfoBuffer extends InfoBuffer{ | ||
|
||
public static float[] mapsprite = new float[neighbourhoodAreaSize]; | ||
public static byte[] mapsprite2 = new byte[neighbourhoodAreaSize]; | ||
public static boolean[] mapspritechange = new boolean[neighbourhoodAreaSize]; | ||
public static int[] reservedSpritePixels = new int[RenderProcedure.canvasHeight<<6]; | ||
|
||
public static void clearBuffers(){ | ||
|
||
mapsprite = new float[neighbourhoodAreaSize]; | ||
mapsprite2 = new byte[neighbourhoodAreaSize]; | ||
mapspritechange= new boolean[neighbourhoodAreaSize]; | ||
} | ||
} |
Oops, something went wrong.