Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngraph.physics.primitives

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngraph.physics.primitives - npm Package Compare versions

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') {

2

package.json
{
"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();
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc