ngraph.physics.primitives
Advanced tools
Comparing version 0.0.6 to 0.0.7
11
index.js
@@ -16,2 +16,7 @@ module.exports = { | ||
Body.prototype.setPosition = function (x, y) { | ||
this.prevPos.x = this.pos.x = x; | ||
this.prevPos.y = this.pos.y = y; | ||
}; | ||
function Vector2d(x, y) { | ||
@@ -40,2 +45,8 @@ if (x && typeof x !== 'number') { | ||
Body3d.prototype.setPosition = function (x, y, z) { | ||
this.prevPos.x = this.pos.x = x; | ||
this.prevPos.y = this.pos.y = y; | ||
this.prevPos.z = this.pos.z = z; | ||
}; | ||
function Vector3d(x, y, z) { | ||
@@ -42,0 +53,0 @@ if (x && typeof x !== 'number') { |
{ | ||
"name": "ngraph.physics.primitives", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Physics primitives for ngraph.* libraries", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -76,1 +76,25 @@ var test = require('tap').test, | ||
}); | ||
test('Body3d can set position', function(t) { | ||
var body = new primitives.Body3d(); | ||
body.setPosition(10, 11, 12); | ||
t.equal(body.pos.x, 10, 'x is correct'); | ||
t.equal(body.pos.y, 11, 'y is correct'); | ||
t.equal(body.pos.z, 12, 'z is correct'); | ||
t.equal(body.prevPos.x, 10, 'prev x is correct'); | ||
t.equal(body.prevPos.y, 11, 'prev y is correct'); | ||
t.equal(body.prevPos.z, 12, 'prev z is correct'); | ||
t.end(); | ||
}); | ||
test('Body can set position', function(t) { | ||
var body = new primitives.Body(); | ||
body.setPosition(10, 11); | ||
t.equal(body.pos.x, 10, 'x is correct'); | ||
t.equal(body.pos.y, 11, 'y is correct'); | ||
t.equal(body.prevPos.x, 10, 'prev x is correct'); | ||
t.equal(body.prevPos.y, 11, 'prev y is correct'); | ||
t.end(); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8583
142