Skip to content

Commit

Permalink
Finished up version for release
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrickbancan committed Nov 21, 2020
1 parent 560c12d commit 0345626
Show file tree
Hide file tree
Showing 12 changed files with 445 additions and 85 deletions.
2 changes: 1 addition & 1 deletion RabbetGameEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<OutputPath></OutputPath>
<OutputPath>C:\Users\disckord\Desktop\RabbetGameEngine workspace\Rabbet-Game-Engine\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
2 changes: 1 addition & 1 deletion Res/Shaders/Planet/Moons.shader
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ vec4 lookAtZeroRotationNoFlip(float rad)
vec4 endPos = vec4(corner.x * rad * 2, corner.y * rad * 2, 0, 0);
mat4 result = mat4(0);
vec3 dir = normalize(-spritePos.xyz);
vec3 up = vec3(axis.x, 0, -axis.y);
vec3 up = vec3(axis.x, 0, axis.y);
vec3 xAxis = cross(up, dir);
xAxis = normalize(xAxis);
vec3 yAxis = cross(dir, xAxis);
Expand Down
2 changes: 1 addition & 1 deletion Src/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static void Main(string[] args)
process.Dispose();
}
}
public static readonly string version = "0.1.1_indev";
public static readonly string version = "0.1.2_indev";
public static readonly string applicationName = "RabbetGameEngine " + version;

/// <summary>
Expand Down
5 changes: 0 additions & 5 deletions Src/Game/MathUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ public static float hypotenuse(float a, float b)
/*Takes in 3 floats and a smooth factor. Smooths the 3 values with strength of smooth factor. Smooth factor of 0 does nothing, and 1 makes each value the average.*/
public static void smooth3(ref float x, ref float y, ref float z, float factor)
{
if (factor <= 0)
return;
if (factor > 1F)
factor = 1F;

float avg = (x + y + z) / 3F;
x = lerp(x, avg, factor);
y = lerp(y, avg, factor);
Expand Down
3 changes: 1 addition & 2 deletions Src/Rendering/SkyboxRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static void setSkyboxToDraw(Planet p)
for (int i = 0; i < p.totalMoons; i++)
{
Vector2 dir = m[i].orbitDirection;
Vector2 axis = new Vector2(dir.Y, -dir.X);
Vector2 axis = new Vector2(dir.Y, dir.X);
axies[p.totalMoons-1-i] = axis;
}
moonsVAO = new VertexArrayObject();
Expand All @@ -132,7 +132,6 @@ public static void setSkyboxToDraw(Planet p)
moonsVAO.finishBuilding();
}

//TODO: Fix z fighting on moons
public static void drawSkybox(Matrix4 viewMatrix)
{
if(skyboxToDraw == null)
Expand Down
17 changes: 8 additions & 9 deletions Src/Universe/Planet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace RabbetGameEngine
{
//TODO: Implement changing of sky colors for dusk and dawn.
//TODO: add moon with unsynced orbit from sun orbit.
public class Planet
{
private CustomColor fogColor;
Expand All @@ -38,7 +36,7 @@ public class Planet
/// <summary>
/// How many minutes a day night cycle will take
/// </summary>
private int dayNightCycleMinutes = 5;
private int dayNightCycleMinutes = 3;

/// <summary>
/// Total number of ticks in a day night cycle from start to finish
Expand Down Expand Up @@ -69,11 +67,11 @@ public class Planet
private float fogEnd;
private float drawDistance = 0;
public Planet(long seed)
{//TODO: Change fog color to match horizon color
{
random = Rand.CreateJavaRandom(seed);
horizonColor = CustomColor.lightOrange;
horizonColorDawn = CustomColor.lightOrange;
horizonColorDusk = CustomColor.dusk;
horizonColorDawn = CustomColor.lightOrange.reduceVibrancy(-0.5F);
horizonColorDusk = CustomColor.dusk.reduceVibrancy(-0.5F);
skyAmbientColor = CustomColor.darkBlue.copy().reduceVibrancy(0.5F);
fogColor = CustomColor.lightGrey;
skyColor = CustomColor.skyBlue;
Expand All @@ -82,7 +80,7 @@ public Planet(long seed)
sunColorDusk = CustomColor.flame;
//dayNightCycleMinutes = rand.Next(15,61);
totalDayNightTicks = (int)TicksAndFrames.getNumOfTicksForSeconds(dayNightCycleMinutes * 60);
dayNightTicks = totalDayNightTicks / 4;
dayNightTicks =(int) ((float)(totalDayNightTicks / 4) * 2.8F);//setting to sunset
setDrawDistanceAndFog(150.0F);
buildMoons();
buildStars();
Expand Down Expand Up @@ -162,7 +160,8 @@ public PointCloudModel getStars()

public Vector3 getFogColor()
{
return new Vector3();
//TODO: make fog color match horizon in direction player is looking.
return skyColor.mix(CustomColor.white, 0.8F).setBrightPercent(getGlobalBrightness()*0.8F).toNormalVec3();
}
public Vector3 getHorizonColor()
{
Expand Down Expand Up @@ -241,7 +240,7 @@ public bool isDawn()
Renderer.addStaticDrawTriangles("ground", groundTextureName, batchedGround);

//adding world colliders
this.addWorldAABB(new AABB(new Vector3(-1000, -2, -1000), new Vector3(1000, 0, 1000)));//AABB for ground
this.addWorldAABB(new AABB(new Vector3(-640, -2, -640), new Vector3(640, 0, 640)));//AABB for ground
this.addWorldAABB(new AABB(new Vector3(-1, 0, -1), new Vector3(1, 1, 1)));//2x1x2 lump in middle of playground
}

Expand Down
Loading

0 comments on commit 0345626

Please sign in to comment.