whiteboard

This commit is contained in:
ericrius1 2015-09-29 09:46:49 -07:00
parent 80405450ce
commit 8857042363
2 changed files with 78 additions and 6 deletions

View file

@ -69,6 +69,12 @@ function createAllToys() {
z: 503.49
});
createWhiteboard({
x: 540,
y: 495.41,
z: 506.15
});
//Handles toggling of all sconce lights
createLightSwitches();
@ -80,12 +86,6 @@ function createAllToys() {
z: 508.22
})
// createPillow({
// x: 549.29,
// y: 495.35,
// z: 508.22
// });
createPottedPlant({
x: 554.26,
y: 495.23,
@ -141,6 +141,32 @@ function createCat(position) {
});
}
function createWhiteboard(position) {
var scriptURL = Script.resolvePath('whiteboard.js?v1');
var whiteboard = Entities.addEntity({
type: "Box",
position: position,
script: scriptURL,
name: "whiteboard",
dimensions: {
x: 2,
y: 1.5,
z: .01
},
color: {
red: 250,
green: 250,
blue: 250
}
});
setEntityCustomData(resetKey, whiteboard, {
resetMe: true
});
}
function createFlashlight(position) {
var scriptURL = Script.resolvePath('flashlight/flashlight.js');
var modelURL = "https://hifi-public.s3.amazonaws.com/models/props/flashlight.fbx";

View file

@ -0,0 +1,46 @@
//
// detectGrabExample.js
// examples/entityScripts
//
// Created by Eric Levin on 9/21/15.
// Copyright 2015 High Fidelity, Inc.
//
// This is an example of an entity script which when assigned to an entity, will detect when the entity is being grabbed by the hydraGrab script
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
(function() {
var _this;
// this is the "constructor" for the entity as a JS object we don't do much here, but we do want to remember
// our this object, so we can access it in cases where we're called without a this (like in the case of various global signals)
Whiteboard = function() {
_this = this;
};
Whiteboard.prototype = {
startNearGrabNonColliding: function() {
print("HEY")
},
// preload() will be called when the entity has become visible (or known) to the interface
// it gives us a chance to set our local JavaScript object up. In this case it means:
preload: function(entityID) {
this.entityID = entityID;
this.position = Entities.getEntityProperties(this.entityID, "position").position;
},
};
// entity scripts always need to return a newly constructed object of our type
return new Whiteboard();
})