mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 19:34:02 +02:00
Merge pull request #6323 from ericrius1/eraseBoardFix
Fixed bug where eraser wouldn't erase
This commit is contained in:
commit
29ce1d50ae
1 changed files with 39 additions and 10 deletions
|
@ -87,12 +87,24 @@ var light = Entities.addEntity({
|
|||
type: 'Light',
|
||||
name: 'whiteboard light',
|
||||
position: lightPosition,
|
||||
dimensions: {x: 10, y: 10, z: 10},
|
||||
dimensions: {
|
||||
x: 10,
|
||||
y: 10,
|
||||
z: 10
|
||||
},
|
||||
intensity: 2,
|
||||
color: {red: 255, green: 255, blue: 255}
|
||||
color: {
|
||||
red: 255,
|
||||
green: 255,
|
||||
blue: 255
|
||||
}
|
||||
});
|
||||
|
||||
var eraserPosition = Vec3.sum(center, {x: 0, y: 2.05, z: 0 });
|
||||
var eraserPosition = Vec3.sum(center, {
|
||||
x: 0,
|
||||
y: 2.05,
|
||||
z: 0
|
||||
});
|
||||
eraserPosition = Vec3.sum(eraserPosition, Vec3.multiply(-0.1, rotation));
|
||||
scriptURL = Script.resolvePath("eraseBoardEntityScript.js");
|
||||
var eraser = Entities.addEntity({
|
||||
|
@ -103,7 +115,10 @@ var eraser = Entities.addEntity({
|
|||
script: scriptURL,
|
||||
rotation: rotation,
|
||||
userData: JSON.stringify({
|
||||
whiteboard: drawingSurface
|
||||
whiteboard: drawingSurface,
|
||||
grabbableKey: {
|
||||
wantsTrigger: true
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
@ -115,20 +130,32 @@ Script.setTimeout(function() {
|
|||
|
||||
|
||||
function setUp() {
|
||||
var blockerPosition = Vec3.sum(center, {x: 0, y: -1, z: 0 });
|
||||
var blockerPosition = Vec3.sum(center, {
|
||||
x: 0,
|
||||
y: -1,
|
||||
z: 0
|
||||
});
|
||||
blockerPosition = Vec3.sum(blockerPosition, Vec3.multiply(-1, Quat.getFront(rotation)));
|
||||
blocker = Entities.addEntity({
|
||||
type: "Box",
|
||||
rotation: rotation,
|
||||
position: blockerPosition,
|
||||
dimensions: {x: whiteboardDimensions.x, y: 1, z: 0.1},
|
||||
dimensions: {
|
||||
x: whiteboardDimensions.x,
|
||||
y: 1,
|
||||
z: 0.1
|
||||
},
|
||||
shapeType: "box",
|
||||
visible: false
|
||||
});
|
||||
|
||||
var eraseModelDimensions = Entities.getEntityProperties(eraser, "naturalDimensions").naturalDimensions;
|
||||
Entities.editEntity(eraser, {dimensions: eraseModelDimensions});
|
||||
Entities.editEntity(colorIndicatorBorder, {dimensions: colorIndicatorBorderDimensions});
|
||||
Entities.editEntity(eraser, {
|
||||
dimensions: eraseModelDimensions
|
||||
});
|
||||
Entities.editEntity(colorIndicatorBorder, {
|
||||
dimensions: colorIndicatorBorderDimensions
|
||||
});
|
||||
|
||||
scriptURL = Script.resolvePath("colorIndicatorEntityScript.js");
|
||||
var colorIndicatorPosition = Vec3.sum(center, {
|
||||
|
@ -193,7 +220,9 @@ function setUp() {
|
|||
userData: JSON.stringify({
|
||||
whiteboard: drawingSurface,
|
||||
colorIndicator: colorIndicatorBox,
|
||||
grabbableKey: {wantsTrigger: true}
|
||||
grabbableKey: {
|
||||
wantsTrigger: true
|
||||
}
|
||||
})
|
||||
});
|
||||
colorBoxes.push(colorBox);
|
||||
|
@ -218,4 +247,4 @@ function cleanup() {
|
|||
|
||||
|
||||
// Uncomment this line to delete whiteboard and all associated entity on script close
|
||||
// Script.scriptEnding.connect(cleanup);
|
||||
// Script.scriptEnding.connect(cleanup);
|
Loading…
Reference in a new issue