Skip to content

Commit

Permalink
Cleaning up repo root
Browse files Browse the repository at this point in the history
  • Loading branch information
hamaluik committed Nov 7, 2017
1 parent ec88270 commit c5f3e8a
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# adapted from https://github.com/andyli/HaxeCI/blob/master/.travis.yml
language: haxe

# keep everything in the test subdir
before_script: cd test

env:
matrix:
- TARGET=interp
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ var P:Mat4 = GLM.perspective(
```

```haxe
using glm.Quat;
// transform components
var pos:Vec3 = new Vec3(0, 0, 1.5);
var rot:Quat = Quat.identity(new Quat());
var rot:Quat = new Quat().identity();
var sca:Vec3 = new Vec3(1, 1, 1);
var modelMatrix:Mat4 = new Mat4();
Expand Down
15 changes: 10 additions & 5 deletions sample/Sample.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,32 @@ package;

import Sys;
import glm.GLM;
import glm.Mat4;
import glm.Vec4;
using glm.Mat4;
using glm.Vec3;
using glm.Vec4;
using glm.Quat;

class Sample {
public static function main() {
var P:Mat4 = GLM.perspective(45 * Math.PI / 180, 640 / 480, 0.1, 100, new Mat4());
Sys.println('P:');
Sys.println(P.toString());

var camM:Mat4 = GLM.translate(0, 0, 6, new Mat4());
var V:Mat4 = Mat4.invert(camM, new Mat4());
var camM:Mat4 = GLM.translate(new Vec3(0, 0, 6) , new Mat4());
var V:Mat4 = camM.invert(new Mat4());
Sys.println('V:');
Sys.println(V.toString());

var PV:Mat4 = Mat4.multMat(P, V, new Mat4());
var PV:Mat4 = P.multMat(V, new Mat4());
Sys.println('PV:');
Sys.println(PV.toString());

var p3d:Vec4 = new Vec4(1, 1, 0, 1);
var p2d:Vec4 = PV * p3d;
Vec4.multiplyScalar(p2d, 1 / p2d.w, p2d);
Sys.println(p3d.toString() + ' -> ' + p2d.toString());

var rot:Quat = new Quat().identity();
Sys.println('\nrot: ' + rot.toString());
}
}
3 changes: 2 additions & 1 deletion sample/build.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-lib glm
-D glm
-cp ../src
-main Sample
-dce full
--interp
1 change: 1 addition & 0 deletions test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin/
File renamed without changes.
4 changes: 2 additions & 2 deletions profile.each.hxml → test/profile.each.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-cp src
-cp test
-cp .
-cp ../src
-dce full
-main ProfileMain
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test.each.hxml → test/test.each.hxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-lib buddy
-cp test
-cp src
-cp .
-cp ../src
-D testing
#-D kha
-main TestMain
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c5f3e8a

Please sign in to comment.