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

View file

@ -22,7 +22,7 @@
_this = this; _this = this;
_this.ERASER_TRIGGER_THRESHOLD = 0.2; _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_TO_STROKE_SEARCH_RADIUS = 0.7;
_this.ERASER_RESET_WAIT_TIME = 3000; _this.ERASER_RESET_WAIT_TIME = 3000;
}; };

View file

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

View file

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