urdf-loader
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -122,7 +122,7 @@ /* globals animToggle viewer THREE */ | ||
li.update = () => { | ||
let val = joint.urdf.type === 'revolute' ? joint.urdf.angle * RAD2DEG : joint.urdf.angle; | ||
if (Math.abs(val) > 1) val = val.toFixed(1); | ||
else val = val.toPrecision(2); | ||
let degVal = joint.urdf.type === 'revolute' ? joint.urdf.angle * RAD2DEG : joint.urdf.angle; | ||
if (Math.abs(degVal) > 1) degVal = degVal.toFixed(1); | ||
else degVal = degVal.toPrecision(2); | ||
input.value = parseFloat(val); | ||
input.value = parseFloat(degVal); | ||
slider.value = joint.urdf.angle; | ||
@@ -134,4 +134,4 @@ | ||
input.min = -6.28; | ||
input.max = 6.28; | ||
input.min = -6.28 * RAD2DEG; | ||
input.max = 6.28 * RAD2DEG; | ||
} else { | ||
@@ -141,4 +141,4 @@ slider.min = joint.urdf.limit.lower; | ||
input.min = joint.urdf.limit.lower; | ||
input.max = joint.urdf.limit.upper; | ||
input.min = joint.urdf.limit.lower * RAD2DEG; | ||
input.max = joint.urdf.limit.upper * RAD2DEG; | ||
} | ||
@@ -166,3 +166,3 @@ }; | ||
input.addEventListener('change', () => { | ||
viewer.setAngle(joint.name, input.value); | ||
viewer.setAngle(joint.name, input.value * DEG2RAD); | ||
li.update(); | ||
@@ -169,0 +169,0 @@ }); |
{ | ||
"name": "urdf-loader", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "URDF Loader for THREE.js and webcomponent viewer", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -0,0 +0,0 @@ /* globals THREE URDFLoader */ |
Sorry, the diff of this file is too big to display
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
2581197
6642