plant hull and whiteboard marker delay

This commit is contained in:
James B. Pollack 2016-04-04 10:06:06 -07:00
parent 4998ceb604
commit 9e8f590ffe
2 changed files with 14 additions and 11 deletions

View file

@ -12,7 +12,7 @@
//
var PLANT_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/growingPlantEntityScript.js");
var WATER_CAN_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/waterCanEntityScript.js");
var WATER_CAN_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/waterCanEntityScript.js");
Plant = function(spawnPosition, spawnRotation) {
var orientation;
if (spawnRotation !== undefined) {
@ -57,7 +57,7 @@ Plant = function(spawnPosition, spawnRotation) {
y: plantDimensions.y / 2,
z: 0
});
var plant = Entities.addEntity({
type: "Model",
modelURL: PLANT_MODEL_URL,
@ -89,8 +89,7 @@ Plant = function(spawnPosition, spawnRotation) {
y: 0.2762,
z: 0.4115
},
shapeType: 'compound',
compoundShapeURL: WATER_CAN_COLLIISION_HULL_URL,
shapeType: 'box',
position: waterCanPosition,
collisionSoundURL: "atp:/growingPlant/watering_can_drop.L.wav",
dynamic: true,
@ -139,7 +138,7 @@ Plant = function(spawnPosition, spawnRotation) {
var waterSpoutPosition = Vec3.sum(waterCanPosition, Vec3.multiply(0.21, Quat.getFront(orientation)))
var waterSpoutRotation = Quat.multiply(waterCanRotation, Quat.fromPitchYawRollDegrees(10, 0, 0));
var WATER_SPOUT_NAME = "home_box_waterSpout";
var WATER_SPOUT_NAME = "home_box_waterSpout";
var waterSpout = Entities.addEntity({
type: "Box",
name: WATER_SPOUT_NAME,

View file

@ -10,9 +10,9 @@
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
var ERASER_SCRIPT_URL = Script.resolvePath("eraserEntityScript.js" );
var ERASER_SCRIPT_URL = Script.resolvePath("eraserEntityScript.js");
var MARKER_SCRIPT_URL = Script.resolvePath("markerEntityScript.js" );
var MARKER_SCRIPT_URL = Script.resolvePath("markerEntityScript.js");
Whiteboard = function(spawnPosition, spawnRotation) {
@ -57,7 +57,7 @@ Whiteboard = function(spawnPosition, spawnRotation) {
whiteboardSurfacePosition = Vec3.sum(whiteboardSurfacePosition, Vec3.multiply(-0.02, Quat.getRight(whiteboardRotation)));
var moveForwardDistance = 0.02;
whiteboardFrontSurfacePosition = Vec3.sum(whiteboardSurfacePosition, Vec3.multiply(-moveForwardDistance, Quat.getFront(whiteboardRotation)));
var WHITEBOARD_SURFACE_NAME = "home_box_whiteboardDrawingSurface";
var WHITEBOARD_SURFACE_NAME = "home_box_whiteboardDrawingSurface";
var whiteboardSurfaceSettings = {
type: "Box",
name: WHITEBOARD_SURFACE_NAME,
@ -98,7 +98,7 @@ Whiteboard = function(spawnPosition, spawnRotation) {
eraserPosition = Vec3.sum(eraserPosition, Vec3.multiply(-0.5, Quat.getRight(whiteboardRotation)));
var eraserRotation = markerRotation;
var eraser = Entities.addEntity({
var eraserProps = {
type: "Model",
name: "home_model_whiteboardEraser",
modelURL: ERASER_MODEL_URL,
@ -153,9 +153,8 @@ Whiteboard = function(spawnPosition, spawnRotation) {
}
}
})
});
}
createMarkers();
function createMarkers() {
var modelURLS = [
@ -249,6 +248,11 @@ Whiteboard = function(spawnPosition, spawnRotation) {
markers.push(marker);
}
var eraser;
Script.setTimeout(function() {
eraser = Entities.addEntity(eraserProps);
createMarkers();
}, 1500)
function cleanup() {
print('WHITEBOARD CLEANUP')