Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

Commit

Permalink
Pre-Physics
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacharyPatten committed Dec 10, 2013
1 parent 4895fa2 commit f744dd1
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Game/Assets/Shaders/Fragment/FragmentShaderGouraud.glsl
@@ -0,0 +1,6 @@
varying vec4 color;

void main()
{
gl_FragColor = color;
}
27 changes: 27 additions & 0 deletions Game/Assets/Shaders/Vertex/VertexShaderGouraud.glsl
@@ -0,0 +1,27 @@
varying vec4 color;

varying vec3 N;
varying vec3 v;
varying vec4 diffuse;
varying vec4 spec;

void main()
{
vec4 diffuse;
vec4 spec;
vec4 ambient;

v = vec3(gl_ModelViewMatrix * gl_Vertex);
N = normalize(gl_NormalMatrix * gl_Normal);
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

vec3 L = normalize(gl_LightSource[0].position.xyz - v);
vec3 E = normalize(-v);
vec3 R = normalize(reflect(-L,N));

ambient = ambientMat;
diffuse = clamp( diffuseMat * max(dot(N,L), 0.0) , 0.0, 1.0 ) ;
spec = clamp ( specMat * pow(max(dot(R,E),0.0),0.3*specPow) , 0.0, 1.0 );

color = ambient + diffuse + spec;
}
26 changes: 26 additions & 0 deletions SevenEngine/InterfaceGameState.cs
@@ -0,0 +1,26 @@
// SEVENENGINE LISCENSE:
// You are free to use, modify, and distribute any or all code segments/files for any purpose
// including commercial use under the following condition: any code using or originally taken
// from the SevenEngine project must include citation to its original author(s) located at the
// top of each source code file, or you may include a reference to the SevenEngine project as
// a whole but you must include the current SevenEngine official website URL and logo.
// - Thanks. :) (support: seven@sevenengine.com)

// Author(s):
// - Zachary Aaron Patten (aka Seven) seven@sevenengine.com
// Last Edited: 11-16-13

using SevenEngine.DataStructures.Interfaces;

namespace SevenEngine
{
/// <summary>INHERIT ME!</summary>
public interface InterfaceGameState : InterfaceStringId
{
new string Id { get; set; }
bool IsReady { get; }
void Load();
string Update(float elapsedTime);
void Render();
}
}
39 changes: 39 additions & 0 deletions SevenEngine/MANAGERS/HardwareManager.cs
@@ -0,0 +1,39 @@
// SEVENENGINE LISCENSE:
// You are free to use, modify, and distribute any or all code segments/files for any purpose
// including commercial use under the following condition: any code using or originally taken
// from the SevenEngine project must include citation to its original author(s) located at the
// top of each source code file, or you may include a reference to the SevenEngine project as
// a whole but you must include the current SevenEngine official website URL and logo.
// - Thanks. :) (support: seven@sevenengine.com)

// Author(s):
// - Zachary Aaron Patten (aka Seven) seven@sevenengine.com
// Last Edited: 12-6-13

using System;
using OpenTK;

namespace SevenEngine
{
/// <summary>Contains hardware constants for dynamic optimizatiions.</summary>
public static class HardwareManager
{
private static int _numberOfCores;
private static int _monitorWidth;
private static int _monitorHeight;

/// <summary>Returns the number of logical cores on the current hardware.</summary>
public static int LogicalCores { get { return _numberOfCores; } }
/// <summary>Returns the width of the default monitor.</summary>
public static int MonitorWidth { get { return _monitorWidth; } }
/// <summary>Returns the height of the default monitor.</summary>
public static int MonitorHeight { get { return _monitorHeight; } }

public static void Initialize()
{
_numberOfCores = System.Environment.ProcessorCount;
_monitorWidth = OpenTK.DisplayDevice.Default.Width;
_monitorHeight = OpenTK.DisplayDevice.Default.Height;
}
}
}
33 changes: 33 additions & 0 deletions SevenEngine/Physics/Matter.cs
@@ -0,0 +1,33 @@
// SEVENENGINE LISCENSE:
// You are free to use, modify, and distribute any or all code segments/files for any purpose
// including commercial use under the following condition: any code using or originally taken
// from the SevenEngine project must include citation to its original author(s) located at the
// top of each source code file, or you may include a reference to the SevenEngine project as
// a whole but you must include the current SevenEngine official website URL and logo.
// - Thanks. :) (support: seven@sevenengine.com)

// Author(s):
// - Zachary Aaron Patten (aka Seven) seven@sevenengine.com
// Last Edited: 11-28-13

using System;
using SevenEngine.Mathematics;

namespace SevenEngine.Physics
{
public enum EnumMatterState { Solid, Liquid, Gas, Plasma }

public class Matter
{
protected Substance _substance;
//protected Shape _space;

protected Vector _acceleration;
protected Vector _velocity;

protected Quaternion _angularAccelteration;
protected Quaternion _angularVelocity;

protected float _tempurature;
}
}
29 changes: 29 additions & 0 deletions SevenEngine/Physics/Shapes/Interfaces/InterfaceShape.cs
@@ -0,0 +1,29 @@
// SEVENENGINE LISCENSE:
// You are free to use, modify, and distribute any or all code segments/files for any purpose
// including commercial use under the following condition: any code using or originally taken
// from the SevenEngine project must include citation to its original author(s) located at the
// top of each source code file, or you may include a reference to the SevenEngine project as
// a whole but you must include the current SevenEngine official website URL and logo.
// - Thanks. :) (support: seven@sevenengine.com)

// Author(s):
// - Zachary Aaron Patten (aka Seven) seven@sevenengine.com
// Last Edited: 11-28-13

using System;

namespace SevenEngine.Physics.Shapes
{
public interface InterfaceShape
{
float SurfaceArea { get; }
float Volume { get; }

float MinimumX { get; }
float MinimumY { get; }
float MinimumZ { get; }
float MaximumX { get; }
float MaximumY { get; }
float MaximumZ { get; }
}
}
26 changes: 26 additions & 0 deletions SevenEngine/Physics/Substance.cs
@@ -0,0 +1,26 @@
// SEVENENGINE LISCENSE:
// You are free to use, modify, and distribute any or all code segments/files for any purpose
// including commercial use under the following condition: any code using or originally taken
// from the SevenEngine project must include citation to its original author(s) located at the
// top of each source code file, or you may include a reference to the SevenEngine project as
// a whole but you must include the current SevenEngine official website URL and logo.
// - Thanks. :) (support: seven@sevenengine.com)

// Author(s):
// - Zachary Aaron Patten (aka Seven) seven@sevenengine.com
// Last Edited: 11-28-13

using System;

namespace SevenEngine.Physics
{
public class Substance
{
protected float _density;
protected float _magnetism;
protected float _radioactivity;
protected float _conductivity;
protected float _integrity;
protected float _elasticity;
}
}

0 comments on commit f744dd1

Please sign in to comment.