mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 09:07:19 +02:00
Merge remote-tracking branch 'james/homereset' into atpHomeReset
This commit is contained in:
commit
5c680e9982
6 changed files with 66 additions and 70 deletions
|
@ -123,13 +123,6 @@
|
|||
|
||||
putTransformerOnRotatorBlock: function(blockPosition) {
|
||||
print('transformer should get set on rotator block')
|
||||
|
||||
blockPosition.y = blockPosition.y + 1;
|
||||
// var newPosition = {
|
||||
// x:blockPosition.x,
|
||||
// y:blockPosition.y+1,
|
||||
// z:blockPosition
|
||||
// };
|
||||
return blockPosition
|
||||
},
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
var TANK_SCRIPT = Script.resolvePath('entityLocalFish.js');
|
||||
|
||||
FishTank = function(spawnPosition, spawnRotation) {
|
||||
var fishTank, tankBase, bubbleSystem, secondBubbleSystem, thirdBubbleSystem, innerContainer, bubbleInjector, lowerCorner, upperCorner, anemone, treasure, rocks;
|
||||
var fishTank, tankBase, bubbleSystem, secondBubbleSystem, thirdBubbleSystem, anemone, treasure, rocks;
|
||||
var CLEANUP = true;
|
||||
|
||||
var TANK_DIMENSIONS = {
|
||||
|
@ -22,11 +22,11 @@ FishTank = function(spawnPosition, spawnRotation) {
|
|||
z: 2.1404
|
||||
};
|
||||
|
||||
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.4;
|
||||
var TANK_WIDTH = TANK_DIMENSIONS.z;
|
||||
var TANK_HEIGHT = TANK_DIMENSIONS.y;
|
||||
// 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.4;
|
||||
// var TANK_WIDTH = TANK_DIMENSIONS.z;
|
||||
// var TANK_HEIGHT = TANK_DIMENSIONS.y;
|
||||
|
||||
var DEBUG_COLOR = {
|
||||
red: 255,
|
||||
|
@ -101,14 +101,6 @@ FishTank = function(spawnPosition, spawnRotation) {
|
|||
z: 0.1020
|
||||
}
|
||||
|
||||
var LOWER_CORNER_VERTICAL_OFFSET = (-TANK_DIMENSIONS.y / 2) + 0.3;
|
||||
var LOWER_CORNER_FORWARD_OFFSET = TANK_DIMENSIONS.x;
|
||||
var LOWER_CORNER_LATERAL_OFFSET = -TANK_DIMENSIONS.z / 8;
|
||||
|
||||
var UPPER_CORNER_VERTICAL_OFFSET = (TANK_DIMENSIONS.y / 2) - 0.3;
|
||||
var UPPER_CORNER_FORWARD_OFFSET = -TANK_DIMENSIONS.x;
|
||||
var UPPER_CORNER_LATERAL_OFFSET = TANK_DIMENSIONS.z / 8;
|
||||
|
||||
function createFishTank() {
|
||||
var tankProperties = {
|
||||
name: 'hifi-home-fishtank',
|
||||
|
@ -229,6 +221,7 @@ FishTank = function(spawnPosition, spawnRotation) {
|
|||
modelURL: ROCK_MODEL_URL,
|
||||
position: finalPosition,
|
||||
dimensions: ROCK_DIMENSIONS,
|
||||
rotation: Quat.fromPitchYawRollDegrees(0, 180, 0),
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
'reset': true
|
||||
|
@ -258,7 +251,7 @@ FishTank = function(spawnPosition, spawnRotation) {
|
|||
modelURL: ANEMONE_MODEL_URL,
|
||||
position: finalPosition,
|
||||
shapeType: 'Sphere',
|
||||
rotation: Quat.fromPitchYawRollDegrees(0, 90, 0),
|
||||
rotation: Quat.fromPitchYawRollDegrees(0, 270, 0),
|
||||
dimensions: ANEMONE_DIMENSIONS,
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
|
@ -281,7 +274,7 @@ FishTank = function(spawnPosition, spawnRotation) {
|
|||
modelURL: TREASURE_MODEL_URL,
|
||||
position: finalPosition,
|
||||
dimensions: TREASURE_DIMENSIONS,
|
||||
rotation: Quat.fromPitchYawRollDegrees(10, -45, 10),
|
||||
rotation: Quat.fromPitchYawRollDegrees(10, 135, 10),
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
'reset': true
|
||||
|
@ -305,6 +298,7 @@ FishTank = function(spawnPosition, spawnRotation) {
|
|||
y: TANK_POSITION.y - BASE_VERTICAL_OFFSET,
|
||||
z: TANK_POSITION.z
|
||||
},
|
||||
rotation: Quat.fromPitchYawRollDegrees(0, 180, 0),
|
||||
dimensions: TANK_BASE_DIMENSIONS,
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
function WaterSpout() {
|
||||
_this = this;
|
||||
_this.waterSound = SoundCache.getSound("atp:/sounds/watering_can_pour.L.wav");
|
||||
_this.waterSound = SoundCache.getSound("atp:/growingPlant/watering_can_pour.L.wav");
|
||||
_this.POUR_ANGLE_THRESHOLD = 0;
|
||||
_this.waterPouring = false;
|
||||
_this.WATER_SPOUT_NAME = "hifi-water-spout";
|
||||
|
@ -37,17 +37,21 @@
|
|||
},
|
||||
|
||||
startHold: function() {
|
||||
if (_this.waterSpout) {
|
||||
_this.waterSpoutPosition = Entities.getEntityProperties(_this.waterSpout, "position").position;
|
||||
_this.waterSpoutRotation = Entities.getEntityProperties(_this.waterSpout, "rotation").rotation;
|
||||
_this.createWaterEffect();
|
||||
} else {
|
||||
print("EBL NO WATER SPOUT FOUND RETURNING");
|
||||
return;
|
||||
}
|
||||
var entities = Entities.findEntities(_this.position, 2);
|
||||
print("EBL SEARCHING FOR SPOUT");
|
||||
entities.forEach(function(entity) {
|
||||
var name = Entities.getEntityProperties(entity, "name").name;
|
||||
if (name === _this.WATER_SPOUT_NAME) {
|
||||
print("EBL FOUND SPOUT");
|
||||
_this.waterSpout = entity;
|
||||
_this.waterSpoutPosition = Entities.getEntityProperties(_this.waterSpout, "position").position;
|
||||
_this.waterSpoutRotation = Entities.getEntityProperties(_this.waterSpout, "rotation").rotation;
|
||||
_this.createWaterEffect();
|
||||
}
|
||||
});
|
||||
|
||||
_this.findGrowableEntities();
|
||||
},
|
||||
|
||||
releaseEquip: function() {
|
||||
_this.releaseHold();
|
||||
},
|
||||
|
@ -220,14 +224,17 @@
|
|||
},
|
||||
|
||||
preload: function(entityID) {
|
||||
print("EBL PRELOADING WATER CAN")
|
||||
_this.entityID = entityID;
|
||||
_this.position = Entities.getEntityProperties(_this.entityID, "position").position;
|
||||
// Wait a a bit for spout to spawn for case where preload is initial spawn, then save it
|
||||
Script.setTimeout(function() {
|
||||
var entities = Entities.findEntities(_this.position, 2);
|
||||
print("EBL SEARCHING FOR SPOUT");
|
||||
entities.forEach(function(entity) {
|
||||
var name = Entities.getEntityProperties(entity, "name").name;
|
||||
if (name === _this.WATER_SPOUT_NAME) {
|
||||
print("EBL FOUND SPOUT");
|
||||
_this.waterSpout = entity;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
var PLANT_SCRIPT_URL = Script.resolvePath("atp:/scripts/growingPlantEntityScript.js");
|
||||
var WATER_CAN_SCRIPT_URL = Script.resolvePath("atp:/scripts/waterCanEntityScript.js");
|
||||
var PLANT_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/growingPlantEntityScript.js");
|
||||
var WATER_CAN_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/waterCanEntityScript.js");
|
||||
Plant = function(spawnPosition, spawnRotation) {
|
||||
var orientation;
|
||||
if (spawnRotation !== undefined) {
|
||||
|
@ -20,7 +20,7 @@ Plant = function(spawnPosition, spawnRotation) {
|
|||
}
|
||||
print("EBL ORIENTATION " + JSON.stringify(orientation));
|
||||
var bowlPosition = spawnPosition;
|
||||
var BOWL_MODEL_URL = "atp:/models/Flowers-Bowl.fbx";
|
||||
var BOWL_MODEL_URL = "atp:/growingPlant/Flowers-Bowl.fbx";
|
||||
var bowlDimensions = {
|
||||
x: 0.518,
|
||||
y: 0.1938,
|
||||
|
@ -40,7 +40,7 @@ Plant = function(spawnPosition, spawnRotation) {
|
|||
});
|
||||
|
||||
|
||||
var PLANT_MODEL_URL = "atp:/models/Flowers-Rock.fbx";
|
||||
var PLANT_MODEL_URL = "atp:/growingPlant/Flowers-Rock.fbx";
|
||||
|
||||
var plantDimensions = {
|
||||
x: 0.52,
|
||||
|
@ -68,7 +68,7 @@ Plant = function(spawnPosition, spawnRotation) {
|
|||
});
|
||||
|
||||
|
||||
var WATER_CAN_MODEL_URL = "atp:/models/waterCan.fbx";
|
||||
var WATER_CAN_MODEL_URL = "atp:/growingPlant/waterCan.fbx";
|
||||
|
||||
var waterCanPosition = Vec3.sum(plantPosition, Vec3.multiply(0.6, Quat.getRight(orientation)));
|
||||
var waterCanRotation = orientation;
|
||||
|
@ -84,7 +84,7 @@ Plant = function(spawnPosition, spawnRotation) {
|
|||
z: 0.4115
|
||||
},
|
||||
position: waterCanPosition,
|
||||
collisionSoundURL: "atp:/sounds/watering_can_drop.L.wav",
|
||||
collisionSoundURL: "atp:/growingPlant/watering_can_drop.L.wav",
|
||||
angularDamping: 1,
|
||||
dynamic: true,
|
||||
gravity: {
|
||||
|
|
|
@ -65,20 +65,35 @@
|
|||
},
|
||||
|
||||
showTidyingButton: function() {
|
||||
var textureString =
|
||||
'Texture.001:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/Head-Housing-Texture.png",\ntex.face.screen.emit:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face-Emit.png",\ntex.face.sceen:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face.png",\ntex.button.blanks:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks.png",\ntex.button.blanks.normal:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks-Normal.png",\nbutton.tidy.emit:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidy-Up-Button-Orange-Emit.png",\nbutton.tidy:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidy-Up-Button-Orange.png"'
|
||||
|
||||
|
||||
Entities.editEntity(_this.entityID, {
|
||||
textures: textureString
|
||||
textures: {
|
||||
"Texture.001": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Head-Housing-Texture.png",
|
||||
"button.tidy": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Tidy-Up-Button-Orange.png",
|
||||
"button.tidy.emit": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Tidy-Up-Button-Orange-Emit.png",
|
||||
"tex.button.blanks": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks.png",
|
||||
"tex.button.blanks.normal": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks-Normal.png",
|
||||
"tex.face.sceen": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face.png",
|
||||
"tex.face.screen.emit": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face-Emit.png"
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
showTidyButton: function() {
|
||||
var textureString =
|
||||
'Texture.001:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/Head-Housing-Texture.png",\ntex.face.screen.emit:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face-Emit.png",\ntex.face.sceen:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face.png",\ntex.button.blanks:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks.png",\ntex.button.blanks.normal:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks-Normal.png",\nbutton.tidy.emit:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/Tidy-Up-Button-Green-Emit.png",\nbutton.tidy:"http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx/Tidyguy-6.fbm/Tidy-Up-Button-Green.png"'
|
||||
|
||||
|
||||
Entities.editEntity(_this.entityID, {
|
||||
textures: textureString
|
||||
textures: {
|
||||
"Texture.001": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Head-Housing-Texture.png",
|
||||
"button.tidy": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Tidy-Up-Button-Green.png",
|
||||
"button.tidy.emit": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Tidy-Up-Button-Green-Emit.png",
|
||||
"tex.button.blanks": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks.png",
|
||||
"tex.button.blanks.normal": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks-Normal.png",
|
||||
"tex.face.sceen": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face.png",
|
||||
"tex.face.screen.emit": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face-Emit.png"
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -291,11 +306,7 @@
|
|||
},
|
||||
collisionless: true,
|
||||
angularDamping: 0,
|
||||
angularVelocity: {
|
||||
x: 0,
|
||||
y: 6,
|
||||
z: 0
|
||||
},
|
||||
angularVelocity: Quat.fromPitchYawRollDegrees(0, 6, 0),
|
||||
dynamic: false,
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
|
@ -314,8 +325,8 @@
|
|||
},
|
||||
|
||||
createTransformingDais: function() {
|
||||
var DAIS_MODEL_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/dressingRoom/Dressing-Dais.fbx';
|
||||
var COLLISION_HULL_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/dressingRoom/Dressing-Dais.obj';
|
||||
var DAIS_MODEL_URL = 'atp:/dressingRoom/Dressing-Dais.fbx';
|
||||
var COLLISION_HULL_URL = 'atp:/dressingRoom/Dressing-Dais.obj';
|
||||
|
||||
var DAIS_DIMENSIONS = {
|
||||
x: 1.0654,
|
||||
|
@ -351,7 +362,7 @@
|
|||
createTransformers: function() {
|
||||
var firstDollPosition = {
|
||||
x: 1107.61,
|
||||
y: 460.5,
|
||||
y: 460.6,
|
||||
z: -77.34
|
||||
}
|
||||
|
||||
|
|
|
@ -47,10 +47,6 @@
|
|||
blue: 0
|
||||
};
|
||||
|
||||
var THROTTLE = true;
|
||||
var THROTTLE_RATE = 1000;
|
||||
var sinceLastUpdate = 0;
|
||||
|
||||
var _this;
|
||||
|
||||
function Maze() {
|
||||
|
@ -72,6 +68,14 @@
|
|||
this.testBallDistance();
|
||||
},
|
||||
|
||||
clickReleaseOnEntity: function() {
|
||||
this.testBallDistance();
|
||||
},
|
||||
|
||||
clickDownOnEntity: function() {
|
||||
this.testBallDistance();
|
||||
},
|
||||
|
||||
continueNearGrab: function() {
|
||||
this.testWinDistance();
|
||||
this.testBallDistance();
|
||||
|
@ -232,19 +236,6 @@
|
|||
|
||||
},
|
||||
|
||||
update: function(deltaTime) {
|
||||
//anyone can clean up loose balls
|
||||
if (THROTTLE === true) {
|
||||
sinceLastUpdate = sinceLastUpdate + deltaTime * 100;
|
||||
if (sinceLastUpdate > THROTTLE_RATE) {
|
||||
sinceLastUpdate = 0;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
_this.testBallDistance();
|
||||
},
|
||||
|
||||
unload: function() {
|
||||
Script.update.disconnect(_this.update);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue