basic-camera
Advanced tools
+7
-15
@@ -5,7 +5,3 @@ var glm = require('gl-matrix') | ||
| var mat4 = glm.mat4 | ||
| var quat = glm.quat | ||
| var scratch0 = new Float32Array(16) | ||
| var scratch1 = new Float32Array(16) | ||
| module.exports = noclip | ||
@@ -17,3 +13,3 @@ | ||
| this.position = position || vec3.create() | ||
| this.rotation = quat.create() | ||
| this.rotationX = this.rotationY = this.rotationZ = 0.0 | ||
| } | ||
@@ -23,10 +19,6 @@ | ||
| if (!output) output = mat4.create() | ||
| scratch1[0] = | ||
| scratch1[1] = | ||
| scratch1[2] = 0 | ||
| mat4.fromRotationTranslation(output | ||
| , quat.conjugate(scratch0, this.rotation) | ||
| , scratch1 | ||
| ) | ||
| mat4.rotateX(output, output, this.rotationX) | ||
| mat4.rotateY(output, output, this.rotationY) | ||
| mat4.rotateZ(output, output, this.rotationZ) | ||
| mat4.translate(output | ||
@@ -41,3 +33,3 @@ , output | ||
| noclip.prototype.rotateX = function(angle) { | ||
| quat.rotateX(this.rotation, this.rotation, angle) | ||
| this.rotationX += angle | ||
| return this | ||
@@ -47,3 +39,3 @@ } | ||
| noclip.prototype.rotateY = function(angle) { | ||
| quat.rotateY(this.rotation, this.rotation, angle) | ||
| this.rotationY += angle | ||
| return this | ||
@@ -53,4 +45,4 @@ } | ||
| noclip.prototype.rotateZ = function(angle) { | ||
| quat.rotateZ(this.rotation, this.rotation, angle) | ||
| this.rotationZ += angle | ||
| return this | ||
| } |
+1
-1
| { | ||
| "name": "basic-camera", | ||
| "version": "0.0.1", | ||
| "version": "1.0.0", | ||
| "description": "A very basic camera for use in WebGL projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
-50%7020
-2.2%142
-4.7%