mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:28:09 +02:00
ray cast
This commit is contained in:
parent
7f23ee04be
commit
728e8c763d
1 changed files with 15 additions and 2 deletions
|
@ -21,12 +21,25 @@
|
||||||
MarkerTip.prototype = {
|
MarkerTip.prototype = {
|
||||||
|
|
||||||
continueNearGrab: function() {
|
continueNearGrab: function() {
|
||||||
print("EBL Conintue ")
|
|
||||||
|
// cast a ray from marker and see if it hits anything
|
||||||
|
|
||||||
|
var props = Entities.getEntityProperties(_this.entityID, ["position", "rotation"]);
|
||||||
|
|
||||||
|
var pickRay = {
|
||||||
|
origin: props.position,
|
||||||
|
direction: Quat.getFront(props.rotation)
|
||||||
|
}
|
||||||
|
|
||||||
|
var intersection = Entities.findRayIntersection(pickRay, true);
|
||||||
|
|
||||||
|
if (intersection.intersects) {
|
||||||
|
print("INTERSECTION!")
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
preload: function(entityID) {
|
preload: function(entityID) {
|
||||||
this.entityID = entityID;
|
this.entityID = entityID;
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue