| Server IP : 162.214.74.102 / Your IP : 216.73.216.59 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/public_html/lrsys_apps/marisol/AR/three.js/src/threex/ |
Upload File : |
var THREEx = THREEx || {}
/**
* @class
*
* @return {[type]} [description]
*/
THREEx.HitTestingTango = function(arContext){
this._arContext = arContext
// seems to be the object bounding sphere for picking
this.boundingSphereRadius = 0.01
// default result scale
this.resultScale = new THREE.Vector3(1,1,1).multiplyScalar(1)
}
//////////////////////////////////////////////////////////////////////////////
// update function
//////////////////////////////////////////////////////////////////////////////
THREEx.HitTestingTango.prototype.update = function(){
}
//////////////////////////////////////////////////////////////////////////////
// Code Separator
//////////////////////////////////////////////////////////////////////////////
/**
* do the actual testing
*
* @param {ARjs.Context} arContext - context to use
* @param {Number} mouseX - mouse x coordinate in [0, 1]
* @param {Numer} mouseY - mouse y coordinate in [0, 1]
* @return {Object} - result
*/
THREEx.HitTestingTango.prototype.test = function(mouseX, mouseY){
var vrDisplay = this._arContext._tangoContext.vrDisplay
if (vrDisplay === null ) return null
if( vrDisplay.displayName !== "Tango VR Device" ) return null
var pointAndPlane = vrDisplay.getPickingPointAndPlaneInPointCloud(mouseX, mouseY)
if( pointAndPlane == null ) {
console.warn('Could not retrieve the correct point and plane.')
return null
}
// FIXME not sure what this is
var boundingSphereRadius = 0.01
// the bigger the number the likeliest it crash chromium-webar
// Orient and position the model in the picking point according
// to the picking plane. The offset is half of the model size.
var object3d = new THREE.Object3D
THREE.WebAR.positionAndRotateObject3DWithPickingPointAndPlaneInPointCloud(
pointAndPlane, object3d, this.boundingSphereRadius
)
object3d.rotateZ(-Math.PI/2)
// return the result
var result = {
position : object3d.position,
quaternion : object3d.quaternion,
scale : this.resultScale,
}
return result
}