mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:21:24 +02:00
marker only draws when equipped and held down
This commit is contained in:
parent
69dc9ef68f
commit
b5ec79fd6d
1 changed files with 19 additions and 12 deletions
|
@ -13,7 +13,10 @@
|
|||
|
||||
(function() {
|
||||
Script.include("../../libraries/utils.js");
|
||||
|
||||
var TRIGGER_CONTROLS = [
|
||||
Controller.Standard.LT,
|
||||
Controller.Standard.RT,
|
||||
];
|
||||
var MAX_POINTS_PER_STROKE = 40;
|
||||
var _this;
|
||||
MarkerTip = function() {
|
||||
|
@ -30,21 +33,25 @@ var _this;
|
|||
|
||||
MarkerTip.prototype = {
|
||||
|
||||
continueNearGrab: function() {
|
||||
|
||||
_this.continueHolding();
|
||||
startEquip: function(id, params) {
|
||||
_this.equipped = true;
|
||||
_this.hand = params[0] == "left" ? 0 : 1;
|
||||
},
|
||||
|
||||
continueEquip: function() {
|
||||
this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[_this.hand]);
|
||||
if (_this.triggerValue > 0.2) {
|
||||
print("EBL PAINZT");
|
||||
_this.continueHolding();
|
||||
} else {
|
||||
_this.currentStroke = null;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
continueHolding: function() {
|
||||
// cast a ray from marker and see if it hits anything
|
||||
|
||||
var markerProps = Entities.getEntityProperties(_this.entityID, ["position", "rotation"]);
|
||||
|
||||
|
||||
var pickRay = {
|
||||
origin: markerProps.position,
|
||||
direction: Quat.getFront(markerProps.rotation)
|
||||
|
|
Loading…
Reference in a new issue