Last active
August 29, 2015 13:57
-
-
Save ToJans/9659764 to your computer and use it in GitHub Desktop.
I am probably overdoing it regarding types ATM
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
namespace Arealities.Models | |
type [<Measure>] mm; // milimeter | |
type [<Measure>] degrees; // degrees | |
type [<Measure>] intensity; // unit = 1 | |
type Vector3D<'a> = {x: 'a; y: 'a; z: 'a} | |
type Placement = Placement of position: decimal<mm> Vector3D * | |
rotation: decimal<degrees> Vector3D | |
type Color = { r: float<intensity>; g: float<intensity>; b: float<intensity>} | |
type Material = Ground | Floor | ShinyStuff | Wall | |
type Geometry = CubeGeometry of size: decimal<mm> Vector3D | |
type Mesh = { | |
geometry: Geometry | |
material: Material | |
placement: Placement | |
castsShadows: bool | |
receivesShadow: bool | |
} | |
type Object3D = {meshes: Mesh list; placement: Placement} | |
type Light = | |
| AmbientLight of Color | |
| DirectionalLight of color:Color * intensity: float<intensity> * direction: decimal<mm> Vector3D | |
type Camera = Camera of position: decimal<mm> Vector3D * lookAt: decimal<mm> Vector3D | |
type SceneObject = | |
| Light | |
| Object3D | |
| Camera | |
type Scene = Scene of SceneObject list | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment