changed name of whiteboard stuff

This commit is contained in:
ericrius1 2016-04-01 15:12:57 -07:00
parent 56ab1e86ba
commit 68642099b7
3 changed files with 8 additions and 15 deletions
unpublishedScripts/DomainContent/Home/whiteboard

View file

@ -22,7 +22,7 @@
_this = this;
_this.ERASER_TRIGGER_THRESHOLD = 0.2;
_this.STROKE_NAME = "hifi-marker-stroke";
_this.STROKE_NAME = "home_polyline_markerStroke";
_this.ERASER_TO_STROKE_SEARCH_RADIUS = 0.7;
_this.ERASER_RESET_WAIT_TIME = 3000;
};

View file

@ -36,8 +36,8 @@
_this.MAX_DISTANCE_BETWEEN_POINTS = 0.1;
_this.strokes = [];
_this.PAINTING_TRIGGER_THRESHOLD = 0.2;
_this.STROKE_NAME = "hifi-marker-stroke";
_this.WHITEBOARD_SURFACE_NAME = "hifi-whiteboardDrawingSurface";
_this.STROKE_NAME = "home_polyline_markerStroke";
_this.WHITEBOARD_SURFACE_NAME = "home_box_whiteboardDrawingSurface"
_this.MARKER_RESET_WAIT_TIME = 3000;
};
@ -48,25 +48,17 @@
_this.whiteboards = [];
_this.equipped = true;
_this.hand = params[0] == "left" ? 0 : 1;
print('before thing', id)
print('GET user data?' + typeof getEntityUserData)
_this.markerColor = getEntityUserData(_this.entityID).markerColor;
print('after thing')
// search for whiteboards
var markerPosition = Entities.getEntityProperties(_this.entityID, "position").position;
var entities = Entities.findEntities(markerPosition, 10);
print('LOOKING FOR BOARDS')
entities.forEach(function(entity) {
var entityName = Entities.getEntityProperties(entity, "name").name;
print('NAME ' + entityName)
if (entityName === _this.WHITEBOARD_SURFACE_NAME) {
print('FOUND A WHITEBOARD!!')
_this.whiteboards.push(entity);
}
});
print("intersectable entities " + JSON.stringify(_this.whiteboards))
},
releaseEquip: function() {

View file

@ -29,7 +29,7 @@ Whiteboard = function(spawnPosition, spawnRotation) {
var WHITEBOARD_COLLISION_HULL_URL = "atp:/whiteboard/whiteboardCollisionHull.obj";
var whiteboard = Entities.addEntity({
type: "Model",
name: "whiteboard",
name: "home_model_whiteboard",
modelURL: WHITEBOARD_MODEL_URL,
position: whiteboardPosition,
rotation: whiteboardRotation,
@ -57,9 +57,10 @@ 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 whiteboardSurfaceSettings = {
type: "Box",
name: "hifi-whiteboardDrawingSurface",
name: WHITEBOARD_SURFACE_NAME,
dimensions: {
x: 1.82,
y: 1.8,
@ -99,6 +100,7 @@ Whiteboard = function(spawnPosition, spawnRotation) {
var eraser = Entities.addEntity({
type: "Model",
name: "home_model_whiteboardEraser",
modelURL: ERASER_MODEL_URL,
position: eraserPosition,
script: ERASER_SCRIPT_URL,
@ -191,7 +193,7 @@ Whiteboard = function(spawnPosition, spawnRotation) {
modelURL: modelURL,
rotation: markerRotation,
shapeType: "box",
name: "marker",
name: "home_model_marker",
dynamic: true,
gravity: {
x: 0,
@ -209,7 +211,6 @@ Whiteboard = function(spawnPosition, spawnRotation) {
y: 0.027,
z: 0.164
},
name: "marker",
script: MARKER_SCRIPT_URL,
userData: JSON.stringify({
'hifiHomeKey': {