urdf-loader 0.12.4 → 0.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/URDFDragControls.js
CHANGED
|
@@ -236,8 +236,9 @@ export class PointerURDFDragControls extends URDFDragControls {
|
|
|
236
236
|
|
|
237
237
|
function updateMouse(e) {
|
|
238
238
|
|
|
239
|
-
|
|
240
|
-
mouse.
|
|
239
|
+
const rect = domElement.getBoundingClientRect();
|
|
240
|
+
mouse.x = ((e.clientX - rect.left) / rect.width) * 2 - 1;
|
|
241
|
+
mouse.y = -((e.clientY - rect.top) / rect.height) * 2 + 1;
|
|
241
242
|
|
|
242
243
|
}
|
|
243
244
|
|
|
@@ -263,8 +263,9 @@
|
|
|
263
263
|
|
|
264
264
|
function updateMouse(e) {
|
|
265
265
|
|
|
266
|
-
|
|
267
|
-
mouse.
|
|
266
|
+
const rect = domElement.getBoundingClientRect();
|
|
267
|
+
mouse.x = ((e.clientX - rect.left) / rect.width) * 2 - 1;
|
|
268
|
+
mouse.y = -((e.clientY - rect.top) / rect.height) * 2 + 1;
|
|
268
269
|
|
|
269
270
|
}
|
|
270
271
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urdf-manipulator-element.js","sources":["../src/URDFDragControls.js","../src/urdf-manipulator-element.js"],"sourcesContent":["import { Raycaster, Vector3, Plane, Vector2 } from 'three';\n\n// Find the nearest parent that is a joint\nfunction isJoint(j) {\n\n return j.isURDFJoint && j.jointType !== 'fixed';\n\n};\n\nfunction findNearestJoint(child) {\n\n let curr = child;\n while (curr) {\n\n if (isJoint(curr)) {\n\n return curr;\n\n }\n\n curr = curr.parent;\n\n }\n\n return curr;\n\n};\n\nconst prevHitPoint = new Vector3();\nconst newHitPoint = new Vector3();\nconst pivotPoint = new Vector3();\nconst tempVector = new Vector3();\nconst tempVector2 = new Vector3();\nconst projectedStartPoint = new Vector3();\nconst projectedEndPoint = new Vector3();\nconst plane = new Plane();\nexport class URDFDragControls {\n\n constructor(scene) {\n\n this.enabled = true;\n this.scene = scene;\n this.raycaster = new Raycaster();\n this.initialGrabPoint = new Vector3();\n\n this.hitDistance = -1;\n this.hovered = null;\n this.manipulating = null;\n\n }\n\n update() {\n\n const {\n raycaster,\n hovered,\n manipulating,\n scene,\n } = this;\n\n if (manipulating) {\n\n return;\n\n }\n\n let hoveredJoint = null;\n const intersections = raycaster.intersectObject(scene, true);\n if (intersections.length !== 0) {\n\n const hit = intersections[0];\n this.hitDistance = hit.distance;\n hoveredJoint = findNearestJoint(hit.object);\n this.initialGrabPoint.copy(hit.point);\n\n }\n\n if (hoveredJoint !== hovered) {\n\n if (hovered) {\n\n this.onUnhover(hovered);\n\n }\n\n this.hovered = hoveredJoint;\n\n if (hoveredJoint) {\n\n this.onHover(hoveredJoint);\n\n }\n\n }\n\n }\n\n updateJoint(joint, angle) {\n\n joint.setJointValue(angle);\n\n }\n\n onDragStart(joint) {\n\n }\n\n onDragEnd(joint) {\n\n }\n\n onHover(joint) {\n\n }\n\n onUnhover(joint) {\n\n }\n\n getRevoluteDelta(joint, startPoint, endPoint) {\n\n // set up the plane\n tempVector\n .copy(joint.axis)\n .transformDirection(joint.matrixWorld)\n .normalize();\n pivotPoint\n .set(0, 0, 0)\n .applyMatrix4(joint.matrixWorld);\n plane\n .setFromNormalAndCoplanarPoint(tempVector, pivotPoint);\n\n // project the drag points onto the plane\n plane.projectPoint(startPoint, projectedStartPoint);\n plane.projectPoint(endPoint, projectedEndPoint);\n\n // get the directions relative to the pivot\n projectedStartPoint.sub(pivotPoint);\n projectedEndPoint.sub(pivotPoint);\n\n tempVector.crossVectors(projectedStartPoint, projectedEndPoint);\n\n const direction = Math.sign(tempVector.dot(plane.normal));\n return direction * projectedEndPoint.angleTo(projectedStartPoint);\n\n }\n\n getPrismaticDelta(joint, startPoint, endPoint) {\n\n tempVector.subVectors(endPoint, startPoint);\n plane\n .normal\n .copy(joint.axis)\n .transformDirection(joint.parent.matrixWorld)\n .normalize();\n\n return tempVector.dot(plane.normal);\n\n }\n\n moveRay(toRay) {\n\n const { raycaster, hitDistance, manipulating } = this;\n const { ray } = raycaster;\n\n if (manipulating) {\n\n ray.at(hitDistance, prevHitPoint);\n toRay.at(hitDistance, newHitPoint);\n\n let delta = 0;\n if (manipulating.jointType === 'revolute' || manipulating.jointType === 'continuous') {\n\n delta = this.getRevoluteDelta(manipulating, prevHitPoint, newHitPoint);\n\n } else if (manipulating.jointType === 'prismatic') {\n\n delta = this.getPrismaticDelta(manipulating, prevHitPoint, newHitPoint);\n\n }\n\n if (delta) {\n\n this.updateJoint(manipulating, manipulating.angle + delta);\n\n }\n\n }\n\n this.raycaster.ray.copy(toRay);\n this.update();\n\n }\n\n setGrabbed(grabbed) {\n\n const { hovered, manipulating } = this;\n\n if (grabbed) {\n\n if (manipulating !== null || hovered === null) {\n\n return;\n\n }\n\n this.manipulating = hovered;\n this.onDragStart(hovered);\n\n } else {\n\n if (this.manipulating === null) {\n return;\n }\n\n this.onDragEnd(this.manipulating);\n this.manipulating = null;\n this.update();\n\n }\n\n }\n\n}\n\nexport class PointerURDFDragControls extends URDFDragControls {\n\n constructor(scene, camera, domElement) {\n\n super(scene);\n this.camera = camera;\n this.domElement = domElement;\n\n const raycaster = new Raycaster();\n const mouse = new Vector2();\n\n function updateMouse(e) {\n\n mouse.x = ((e.pageX - domElement.offsetLeft) / domElement.offsetWidth) * 2 - 1;\n mouse.y = -((e.pageY - domElement.offsetTop) / domElement.offsetHeight) * 2 + 1;\n\n }\n\n this._mouseDown = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n this.setGrabbed(true);\n\n };\n\n this._mouseMove = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n\n };\n\n this._mouseUp = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n this.setGrabbed(false);\n\n };\n\n domElement.addEventListener('mousedown', this._mouseDown);\n domElement.addEventListener('mousemove', this._mouseMove);\n domElement.addEventListener('mouseup', this._mouseUp);\n\n }\n\n getRevoluteDelta(joint, startPoint, endPoint) {\n\n const { camera, initialGrabPoint } = this;\n\n // set up the plane\n tempVector\n .copy(joint.axis)\n .transformDirection(joint.matrixWorld)\n .normalize();\n pivotPoint\n .set(0, 0, 0)\n .applyMatrix4(joint.matrixWorld);\n plane\n .setFromNormalAndCoplanarPoint(tempVector, pivotPoint);\n\n tempVector\n .copy(camera.position)\n .sub(initialGrabPoint)\n .normalize();\n\n // if looking into the plane of rotation\n if (Math.abs(tempVector.dot(plane.normal)) > 0.3) {\n\n return super.getRevoluteDelta(joint, startPoint, endPoint);\n\n } else {\n\n // get the up direction\n tempVector.set(0, 1, 0).transformDirection(camera.matrixWorld);\n\n // get points projected onto the plane of rotation\n plane.projectPoint(startPoint, projectedStartPoint);\n plane.projectPoint(endPoint, projectedEndPoint);\n\n tempVector.set(0, 0, -1).transformDirection(camera.matrixWorld);\n tempVector.cross(plane.normal);\n tempVector2.subVectors(endPoint, startPoint);\n\n return tempVector.dot(tempVector2);\n\n }\n\n }\n\n dispose() {\n\n const { domElement } = this;\n domElement.removeEventListener('mousedown', this._mouseDown);\n domElement.removeEventListener('mousemove', this._mouseMove);\n domElement.removeEventListener('mouseup', this._mouseUp);\n\n }\n\n}\n","import * as THREE from 'three';\nimport URDFViewer from './urdf-viewer-element.js';\nimport { PointerURDFDragControls } from './URDFDragControls.js';\n\n// urdf-manipulator element\n// Displays a URDF model that can be manipulated with the mouse\n\n// Events\n// joint-mouseover: Fired when a joint is hovered over\n// joint-mouseout: Fired when a joint is no longer hovered over\n// manipulate-start: Fires when a joint is manipulated\n// manipulate-end: Fires when a joint is done being manipulated\nexport default\nclass URDFManipulator extends URDFViewer {\n\n static get observedAttributes() {\n\n return ['highlight-color', ...super.observedAttributes];\n\n }\n\n get disableDragging() { return this.hasAttribute('disable-dragging'); }\n set disableDragging(val) { val ? this.setAttribute('disable-dragging', !!val) : this.removeAttribute('disable-dragging'); }\n\n get highlightColor() { return this.getAttribute('highlight-color') || '#FFFFFF'; }\n set highlightColor(val) { val ? this.setAttribute('highlight-color', val) : this.removeAttribute('highlight-color'); }\n\n constructor(...args) {\n\n super(...args);\n\n // The highlight material\n this.highlightMaterial =\n new THREE.MeshPhongMaterial({\n shininess: 10,\n color: this.highlightColor,\n emissive: this.highlightColor,\n emissiveIntensity: 0.25,\n });\n\n const isJoint = j => {\n\n return j.isURDFJoint && j.jointType !== 'fixed';\n\n };\n\n // Highlight the link geometry under a joint\n const highlightLinkGeometry = (m, revert) => {\n\n const traverse = c => {\n\n // Set or revert the highlight color\n if (c.type === 'Mesh') {\n\n if (revert) {\n\n c.material = c.__origMaterial;\n delete c.__origMaterial;\n\n } else {\n\n c.__origMaterial = c.material;\n c.material = this.highlightMaterial;\n\n }\n\n }\n\n // Look into the children and stop if the next child is\n // another joint\n if (c === m || !isJoint(c)) {\n\n for (let i = 0; i < c.children.length; i++) {\n\n const child = c.children[i];\n if (!child.isURDFCollider) {\n\n traverse(c.children[i]);\n\n }\n\n }\n\n }\n\n };\n\n traverse(m);\n\n };\n\n const el = this.renderer.domElement;\n\n const dragControls = new PointerURDFDragControls(this.scene, this.camera, el);\n dragControls.onDragStart = joint => {\n\n this.dispatchEvent(new CustomEvent('manipulate-start', { bubbles: true, cancelable: true, detail: joint.name }));\n this.controls.enabled = false;\n this.redraw();\n\n };\n dragControls.onDragEnd = joint => {\n\n this.dispatchEvent(new CustomEvent('manipulate-end', { bubbles: true, cancelable: true, detail: joint.name }));\n this.controls.enabled = true;\n this.redraw();\n\n };\n dragControls.updateJoint = (joint, angle) => {\n\n this.setJointValue(joint.name, angle);\n\n };\n dragControls.onHover = joint => {\n\n highlightLinkGeometry(joint, false);\n this.dispatchEvent(new CustomEvent('joint-mouseover', { bubbles: true, cancelable: true, detail: joint.name }));\n this.redraw();\n\n };\n dragControls.onUnhover = joint => {\n\n highlightLinkGeometry(joint, true);\n this.dispatchEvent(new CustomEvent('joint-mouseout', { bubbles: true, cancelable: true, detail: joint.name }));\n this.redraw();\n\n };\n\n this.dragControls = dragControls;\n\n }\n\n disconnectedCallback() {\n\n super.disconnectedCallback();\n this.dragControls.dispose();\n\n }\n\n attributeChangedCallback(attr, oldval, newval) {\n\n super.attributeChangedCallback(attr, oldval, newval);\n\n switch (attr) {\n\n case 'highlight-color':\n this.highlightMaterial.color.set(this.highlightColor);\n this.highlightMaterial.emissive.set(this.highlightColor);\n break;\n\n }\n\n }\n\n};\n"],"names":["Vector3","Plane","Raycaster","Vector2","URDFViewer","THREE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEA;IACA,SAAS,OAAO,CAAC,CAAC,EAAE;AACpB;IACA,IAAI,OAAO,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC;AACpD;IACA,CAAC,CAAC;AACF;IACA,SAAS,gBAAgB,CAAC,KAAK,EAAE;AACjC;IACA,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC;IACrB,IAAI,OAAO,IAAI,EAAE;AACjB;IACA,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;AAC3B;IACA,YAAY,OAAO,IAAI,CAAC;AACxB;IACA,SAAS;AACT;IACA,QAAQ,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B;IACA,KAAK;AACL;IACA,IAAI,OAAO,IAAI,CAAC;AAChB;IACA,CAAC,CAAC;AACF;IACA,MAAM,YAAY,GAAG,IAAIA,aAAO,EAAE,CAAC;IACnC,MAAM,WAAW,GAAG,IAAIA,aAAO,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,IAAIA,aAAO,EAAE,CAAC;IACjC,MAAM,UAAU,GAAG,IAAIA,aAAO,EAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAIA,aAAO,EAAE,CAAC;IAClC,MAAM,mBAAmB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,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;AACnD;IACA,QAAQ,KAAK,CAAC,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7D;IACA,QAAQ,QAAQ,IAAI;AACpB;IACA,YAAY,KAAK,iBAAiB;IAClC,gBAAgB,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACtE,gBAAgB,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACzE,gBAAgB,MAAM;AACtB;IACA,SAAS;AACT;IACA,KAAK;AACL;IACA,CAAC;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"urdf-manipulator-element.js","sources":["../src/URDFDragControls.js","../src/urdf-manipulator-element.js"],"sourcesContent":["import { Raycaster, Vector3, Plane, Vector2 } from 'three';\n\n// Find the nearest parent that is a joint\nfunction isJoint(j) {\n\n return j.isURDFJoint && j.jointType !== 'fixed';\n\n};\n\nfunction findNearestJoint(child) {\n\n let curr = child;\n while (curr) {\n\n if (isJoint(curr)) {\n\n return curr;\n\n }\n\n curr = curr.parent;\n\n }\n\n return curr;\n\n};\n\nconst prevHitPoint = new Vector3();\nconst newHitPoint = new Vector3();\nconst pivotPoint = new Vector3();\nconst tempVector = new Vector3();\nconst tempVector2 = new Vector3();\nconst projectedStartPoint = new Vector3();\nconst projectedEndPoint = new Vector3();\nconst plane = new Plane();\nexport class URDFDragControls {\n\n constructor(scene) {\n\n this.enabled = true;\n this.scene = scene;\n this.raycaster = new Raycaster();\n this.initialGrabPoint = new Vector3();\n\n this.hitDistance = -1;\n this.hovered = null;\n this.manipulating = null;\n\n }\n\n update() {\n\n const {\n raycaster,\n hovered,\n manipulating,\n scene,\n } = this;\n\n if (manipulating) {\n\n return;\n\n }\n\n let hoveredJoint = null;\n const intersections = raycaster.intersectObject(scene, true);\n if (intersections.length !== 0) {\n\n const hit = intersections[0];\n this.hitDistance = hit.distance;\n hoveredJoint = findNearestJoint(hit.object);\n this.initialGrabPoint.copy(hit.point);\n\n }\n\n if (hoveredJoint !== hovered) {\n\n if (hovered) {\n\n this.onUnhover(hovered);\n\n }\n\n this.hovered = hoveredJoint;\n\n if (hoveredJoint) {\n\n this.onHover(hoveredJoint);\n\n }\n\n }\n\n }\n\n updateJoint(joint, angle) {\n\n joint.setJointValue(angle);\n\n }\n\n onDragStart(joint) {\n\n }\n\n onDragEnd(joint) {\n\n }\n\n onHover(joint) {\n\n }\n\n onUnhover(joint) {\n\n }\n\n getRevoluteDelta(joint, startPoint, endPoint) {\n\n // set up the plane\n tempVector\n .copy(joint.axis)\n .transformDirection(joint.matrixWorld)\n .normalize();\n pivotPoint\n .set(0, 0, 0)\n .applyMatrix4(joint.matrixWorld);\n plane\n .setFromNormalAndCoplanarPoint(tempVector, pivotPoint);\n\n // project the drag points onto the plane\n plane.projectPoint(startPoint, projectedStartPoint);\n plane.projectPoint(endPoint, projectedEndPoint);\n\n // get the directions relative to the pivot\n projectedStartPoint.sub(pivotPoint);\n projectedEndPoint.sub(pivotPoint);\n\n tempVector.crossVectors(projectedStartPoint, projectedEndPoint);\n\n const direction = Math.sign(tempVector.dot(plane.normal));\n return direction * projectedEndPoint.angleTo(projectedStartPoint);\n\n }\n\n getPrismaticDelta(joint, startPoint, endPoint) {\n\n tempVector.subVectors(endPoint, startPoint);\n plane\n .normal\n .copy(joint.axis)\n .transformDirection(joint.parent.matrixWorld)\n .normalize();\n\n return tempVector.dot(plane.normal);\n\n }\n\n moveRay(toRay) {\n\n const { raycaster, hitDistance, manipulating } = this;\n const { ray } = raycaster;\n\n if (manipulating) {\n\n ray.at(hitDistance, prevHitPoint);\n toRay.at(hitDistance, newHitPoint);\n\n let delta = 0;\n if (manipulating.jointType === 'revolute' || manipulating.jointType === 'continuous') {\n\n delta = this.getRevoluteDelta(manipulating, prevHitPoint, newHitPoint);\n\n } else if (manipulating.jointType === 'prismatic') {\n\n delta = this.getPrismaticDelta(manipulating, prevHitPoint, newHitPoint);\n\n }\n\n if (delta) {\n\n this.updateJoint(manipulating, manipulating.angle + delta);\n\n }\n\n }\n\n this.raycaster.ray.copy(toRay);\n this.update();\n\n }\n\n setGrabbed(grabbed) {\n\n const { hovered, manipulating } = this;\n\n if (grabbed) {\n\n if (manipulating !== null || hovered === null) {\n\n return;\n\n }\n\n this.manipulating = hovered;\n this.onDragStart(hovered);\n\n } else {\n\n if (this.manipulating === null) {\n return;\n }\n\n this.onDragEnd(this.manipulating);\n this.manipulating = null;\n this.update();\n\n }\n\n }\n\n}\n\nexport class PointerURDFDragControls extends URDFDragControls {\n\n constructor(scene, camera, domElement) {\n\n super(scene);\n this.camera = camera;\n this.domElement = domElement;\n\n const raycaster = new Raycaster();\n const mouse = new Vector2();\n\n function updateMouse(e) {\n\n const rect = domElement.getBoundingClientRect();\n mouse.x = ((e.clientX - rect.left) / rect.width) * 2 - 1;\n mouse.y = -((e.clientY - rect.top) / rect.height) * 2 + 1;\n\n }\n\n this._mouseDown = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n this.setGrabbed(true);\n\n };\n\n this._mouseMove = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n\n };\n\n this._mouseUp = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n this.setGrabbed(false);\n\n };\n\n domElement.addEventListener('mousedown', this._mouseDown);\n domElement.addEventListener('mousemove', this._mouseMove);\n domElement.addEventListener('mouseup', this._mouseUp);\n\n }\n\n getRevoluteDelta(joint, startPoint, endPoint) {\n\n const { camera, initialGrabPoint } = this;\n\n // set up the plane\n tempVector\n .copy(joint.axis)\n .transformDirection(joint.matrixWorld)\n .normalize();\n pivotPoint\n .set(0, 0, 0)\n .applyMatrix4(joint.matrixWorld);\n plane\n .setFromNormalAndCoplanarPoint(tempVector, pivotPoint);\n\n tempVector\n .copy(camera.position)\n .sub(initialGrabPoint)\n .normalize();\n\n // if looking into the plane of rotation\n if (Math.abs(tempVector.dot(plane.normal)) > 0.3) {\n\n return super.getRevoluteDelta(joint, startPoint, endPoint);\n\n } else {\n\n // get the up direction\n tempVector.set(0, 1, 0).transformDirection(camera.matrixWorld);\n\n // get points projected onto the plane of rotation\n plane.projectPoint(startPoint, projectedStartPoint);\n plane.projectPoint(endPoint, projectedEndPoint);\n\n tempVector.set(0, 0, -1).transformDirection(camera.matrixWorld);\n tempVector.cross(plane.normal);\n tempVector2.subVectors(endPoint, startPoint);\n\n return tempVector.dot(tempVector2);\n\n }\n\n }\n\n dispose() {\n\n const { domElement } = this;\n domElement.removeEventListener('mousedown', this._mouseDown);\n domElement.removeEventListener('mousemove', this._mouseMove);\n domElement.removeEventListener('mouseup', this._mouseUp);\n\n }\n\n}\n","import * as THREE from 'three';\nimport URDFViewer from './urdf-viewer-element.js';\nimport { PointerURDFDragControls } from './URDFDragControls.js';\n\n// urdf-manipulator element\n// Displays a URDF model that can be manipulated with the mouse\n\n// Events\n// joint-mouseover: Fired when a joint is hovered over\n// joint-mouseout: Fired when a joint is no longer hovered over\n// manipulate-start: Fires when a joint is manipulated\n// manipulate-end: Fires when a joint is done being manipulated\nexport default\nclass URDFManipulator extends URDFViewer {\n\n static get observedAttributes() {\n\n return ['highlight-color', ...super.observedAttributes];\n\n }\n\n get disableDragging() { return this.hasAttribute('disable-dragging'); }\n set disableDragging(val) { val ? this.setAttribute('disable-dragging', !!val) : this.removeAttribute('disable-dragging'); }\n\n get highlightColor() { return this.getAttribute('highlight-color') || '#FFFFFF'; }\n set highlightColor(val) { val ? this.setAttribute('highlight-color', val) : this.removeAttribute('highlight-color'); }\n\n constructor(...args) {\n\n super(...args);\n\n // The highlight material\n this.highlightMaterial =\n new THREE.MeshPhongMaterial({\n shininess: 10,\n color: this.highlightColor,\n emissive: this.highlightColor,\n emissiveIntensity: 0.25,\n });\n\n const isJoint = j => {\n\n return j.isURDFJoint && j.jointType !== 'fixed';\n\n };\n\n // Highlight the link geometry under a joint\n const highlightLinkGeometry = (m, revert) => {\n\n const traverse = c => {\n\n // Set or revert the highlight color\n if (c.type === 'Mesh') {\n\n if (revert) {\n\n c.material = c.__origMaterial;\n delete c.__origMaterial;\n\n } else {\n\n c.__origMaterial = c.material;\n c.material = this.highlightMaterial;\n\n }\n\n }\n\n // Look into the children and stop if the next child is\n // another joint\n if (c === m || !isJoint(c)) {\n\n for (let i = 0; i < c.children.length; i++) {\n\n const child = c.children[i];\n if (!child.isURDFCollider) {\n\n traverse(c.children[i]);\n\n }\n\n }\n\n }\n\n };\n\n traverse(m);\n\n };\n\n const el = this.renderer.domElement;\n\n const dragControls = new PointerURDFDragControls(this.scene, this.camera, el);\n dragControls.onDragStart = joint => {\n\n this.dispatchEvent(new CustomEvent('manipulate-start', { bubbles: true, cancelable: true, detail: joint.name }));\n this.controls.enabled = false;\n this.redraw();\n\n };\n dragControls.onDragEnd = joint => {\n\n this.dispatchEvent(new CustomEvent('manipulate-end', { bubbles: true, cancelable: true, detail: joint.name }));\n this.controls.enabled = true;\n this.redraw();\n\n };\n dragControls.updateJoint = (joint, angle) => {\n\n this.setJointValue(joint.name, angle);\n\n };\n dragControls.onHover = joint => {\n\n highlightLinkGeometry(joint, false);\n this.dispatchEvent(new CustomEvent('joint-mouseover', { bubbles: true, cancelable: true, detail: joint.name }));\n this.redraw();\n\n };\n dragControls.onUnhover = joint => {\n\n highlightLinkGeometry(joint, true);\n this.dispatchEvent(new CustomEvent('joint-mouseout', { bubbles: true, cancelable: true, detail: joint.name }));\n this.redraw();\n\n };\n\n this.dragControls = dragControls;\n\n }\n\n disconnectedCallback() {\n\n super.disconnectedCallback();\n this.dragControls.dispose();\n\n }\n\n attributeChangedCallback(attr, oldval, newval) {\n\n super.attributeChangedCallback(attr, oldval, newval);\n\n switch (attr) {\n\n case 'highlight-color':\n this.highlightMaterial.color.set(this.highlightColor);\n this.highlightMaterial.emissive.set(this.highlightColor);\n break;\n\n }\n\n }\n\n};\n"],"names":["Vector3","Plane","Raycaster","Vector2","URDFViewer","THREE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEA;IACA,SAAS,OAAO,CAAC,CAAC,EAAE;AACpB;IACA,IAAI,OAAO,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC;AACpD;IACA,CAAC,CAAC;AACF;IACA,SAAS,gBAAgB,CAAC,KAAK,EAAE;AACjC;IACA,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC;IACrB,IAAI,OAAO,IAAI,EAAE;AACjB;IACA,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;AAC3B;IACA,YAAY,OAAO,IAAI,CAAC;AACxB;IACA,SAAS;AACT;IACA,QAAQ,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B;IACA,KAAK;AACL;IACA,IAAI,OAAO,IAAI,CAAC;AAChB;IACA,CAAC,CAAC;AACF;IACA,MAAM,YAAY,GAAG,IAAIA,aAAO,EAAE,CAAC;IACnC,MAAM,WAAW,GAAG,IAAIA,aAAO,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,IAAIA,aAAO,EAAE,CAAC;IACjC,MAAM,UAAU,GAAG,IAAIA,aAAO,EAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAIA,aAAO,EAAE,CAAC;IAClC,MAAM,mBAAmB,GAAG,IAAIA,aAAO,EAAE,CAAC;IAC1C,MAAM,iBAAiB,GAAG,IAAIA,aAAO,EAAE,CAAC;IACxC,MAAM,KAAK,GAAG,IAAIC,WAAK,EAAE,CAAC;IACnB,MAAM,gBAAgB,CAAC;AAC9B;IACA,IAAI,WAAW,CAAC,KAAK,EAAE;AACvB;IACA,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IAC5B,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK,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