mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:37:17 +02:00
lasers on webpage work again
This commit is contained in:
parent
5e9c37777c
commit
195b92d05d
1 changed files with 20 additions and 7 deletions
|
@ -866,7 +866,8 @@ function MyController(hand) {
|
||||||
if (WANT_DEBUG || WANT_DEBUG_STATE) {
|
if (WANT_DEBUG || WANT_DEBUG_STATE) {
|
||||||
var oldStateName = stateToName(this.state);
|
var oldStateName = stateToName(this.state);
|
||||||
var newStateName = stateToName(newState);
|
var newStateName = stateToName(newState);
|
||||||
print("STATE (" + this.hand + "): " + newStateName + " <-- " + oldStateName + ", reason = " + reason);
|
print("STATE (" + this.hand + "): " + this.state + "-" + newStateName +
|
||||||
|
" <-- " + oldStateName + ", reason = " + reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
// exit the old state
|
// exit the old state
|
||||||
|
@ -1231,7 +1232,7 @@ function MyController(hand) {
|
||||||
var nearWeb = false;
|
var nearWeb = false;
|
||||||
for (var i = 0; i < candidateEntities.length; i++) {
|
for (var i = 0; i < candidateEntities.length; i++) {
|
||||||
var props = entityPropertiesCache.getProps(candidateEntities[i]);
|
var props = entityPropertiesCache.getProps(candidateEntities[i]);
|
||||||
if (props.type == "Web" || this.isTablet(props)) {
|
if (props && (props.type == "Web" || this.isTablet(props))) {
|
||||||
nearWeb = true;
|
nearWeb = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2740,6 +2741,11 @@ function MyController(hand) {
|
||||||
|
|
||||||
entityPropertiesCache.addEntity(this.grabbedEntity);
|
entityPropertiesCache.addEntity(this.grabbedEntity);
|
||||||
|
|
||||||
|
if (this.state == STATE_ENTITY_LASER_TOUCHING && !this.triggerSmoothedGrab()) {
|
||||||
|
this.setState(STATE_OFF, "released trigger");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// test for intersection between controller laser and web entity plane.
|
// test for intersection between controller laser and web entity plane.
|
||||||
var intersectInfo = handLaserIntersectEntity(this.grabbedEntity,
|
var intersectInfo = handLaserIntersectEntity(this.grabbedEntity,
|
||||||
getControllerWorldLocation(this.handToController(), true));
|
getControllerWorldLocation(this.handToController(), true));
|
||||||
|
@ -2845,6 +2851,11 @@ function MyController(hand) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.state == STATE_OVERLAY_LASER_TOUCHING && !this.triggerSmoothedGrab()) {
|
||||||
|
this.setState(STATE_OFF, "released trigger");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Test for intersection between controller laser and Web overlay plane.
|
// Test for intersection between controller laser and Web overlay plane.
|
||||||
var intersectInfo =
|
var intersectInfo =
|
||||||
handLaserIntersectOverlay(this.grabbedOverlay, getControllerWorldLocation(this.handToController(), true));
|
handLaserIntersectOverlay(this.grabbedOverlay, getControllerWorldLocation(this.handToController(), true));
|
||||||
|
@ -3387,11 +3398,13 @@ var updateIntervalTimer = Script.setInterval(function(){
|
||||||
if (intervalCount == 100) {
|
if (intervalCount == 100) {
|
||||||
|
|
||||||
if (UPDATE_PERFORMANCE_DEBUGGING) {
|
if (UPDATE_PERFORMANCE_DEBUGGING) {
|
||||||
print("handControllerGrab.js -- For " + intervalCount + " samples average= " + totalDelta/intervalCount + " ms"
|
print("handControllerGrab.js -- For " + intervalCount + " samples average= " +
|
||||||
+ " average variance:" + totalVariance/intervalCount + " ms"
|
totalDelta/intervalCount + " ms" +
|
||||||
+ " high variance count:" + highVarianceCount + " [ " + (highVarianceCount/intervalCount) * 100 + "% ] "
|
" average variance:" + totalVariance/intervalCount + " ms" +
|
||||||
+ " VERY high variance count:" + veryhighVarianceCount + " [ " + (veryhighVarianceCount/intervalCount) * 100 + "% ] "
|
" high variance count:" + highVarianceCount + " [ " + (highVarianceCount/intervalCount) * 100 + "% ] " +
|
||||||
+ " average work:" + updateTotalWork/intervalCount + " ms");
|
" VERY high variance count:" + veryhighVarianceCount +
|
||||||
|
" [ " + (veryhighVarianceCount/intervalCount) * 100 + "% ] " +
|
||||||
|
" average work:" + updateTotalWork/intervalCount + " ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
intervalCount = 0;
|
intervalCount = 0;
|
||||||
|
|
Loading…
Reference in a new issue