mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
whitelist and blacklist inner contianer and corner entities
This commit is contained in:
parent
87e13543c2
commit
cd233165e7
2 changed files with 12 additions and 6 deletions
|
@ -9,7 +9,7 @@ var TANK_DIMENSIONS = {
|
|||
|
||||
var INNER_TANK_SCALE = 0.7;
|
||||
var INNER_TANK_DIMENSIONS = Vec3.multiply(INNER_TANK_SCALE, TANK_DIMENSIONS);
|
||||
INNER_TANK_DIMENSIONS.y = INNER_TANK_DIMENSIONS.y -0.25;
|
||||
INNER_TANK_DIMENSIONS.y = INNER_TANK_DIMENSIONS.y -0.4;
|
||||
var TANK_WIDTH = TANK_DIMENSIONS.z;
|
||||
var TANK_HEIGHT = TANK_DIMENSIONS.y;
|
||||
|
||||
|
@ -238,7 +238,7 @@ var data = {
|
|||
innerContainer: innerContainer,
|
||||
|
||||
}
|
||||
// print('DATA AT CREATE IS:::' + JSON.stringify(data));
|
||||
print('DATA AT CREATE IS:::' + JSON.stringify(data));
|
||||
setEntityCustomData(customKey, id, data);
|
||||
setEntityCustomData('grabbableKey', id, {
|
||||
grabbable: false
|
||||
|
@ -248,6 +248,8 @@ function cleanup() {
|
|||
Entities.deleteEntity(fishTank);
|
||||
Entities.deleteEntity(bubbleSystem);
|
||||
Entities.deleteEntity(innerContainer);
|
||||
Entities.deleteEntity(lowerCorner);
|
||||
Entities.deleteEntity(upperCorner);
|
||||
bubbleInjector.stop();
|
||||
bubbleInjector = null;
|
||||
}
|
||||
|
|
|
@ -225,10 +225,15 @@
|
|||
};
|
||||
|
||||
|
||||
// var intersection = Entities.findRayIntersection(pickRay, true, [_this.entityID]);
|
||||
var userData = JSON.parse(_this.currentProperties.userData);
|
||||
var intersection = Entities.findRayIntersection(pickRay, true, [userData['hifi-home-fishtank'].innerContainer],[_this.entityID]);
|
||||
if (intersection.intersects && intersection.entityID === userData['hifi-home-fishtank'].innerContainer) {
|
||||
|
||||
var brn = userData['hifi-home-fishtank']['corners'].brn;
|
||||
var tfl = userData['hifi-home-fishtank']['corners'].tfl;
|
||||
var innerContainer = userData['hifi-home-fishtank'].innerContainer;
|
||||
|
||||
var intersection = Entities.findRayIntersection(pickRay, true, [innerContainer], [_this.entityID, brn, tfl]);
|
||||
|
||||
if (intersection.intersects && intersection.entityID === innerContainer) {
|
||||
//print('intersecting a tank')
|
||||
if (WANT_LOOK_DEBUG_SPHERE === true) {
|
||||
if (_this.debugSphere === null) {
|
||||
|
@ -422,7 +427,6 @@
|
|||
z: 0
|
||||
};
|
||||
|
||||
//var center = _this.currentProperties.position;
|
||||
var bounds = Entities.getEntityProperties(_this.entityID, "boundingBox").boundingBox;
|
||||
lowerCorner = bounds.brn;
|
||||
upperCorner = bounds.tfl;
|
||||
|
|
Loading…
Reference in a new issue