mirror of
https://github.com/overte-org/overte.git
synced 2025-07-29 18:25:25 +02:00
update to parity with createWand.js
This commit is contained in:
parent
c76704dc17
commit
171ae02b03
2 changed files with 36 additions and 27 deletions
|
@ -931,16 +931,18 @@
|
||||||
|
|
||||||
function createWand(position) {
|
function createWand(position) {
|
||||||
var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/wand.fbx';
|
var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/wand.fbx';
|
||||||
var WAND_COLLISION_SHAPE = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/actual_no_top_collision_hull.obj';
|
var WAND_COLLISION_SHAPE = 'http://hifi-content.s3.amazonaws.com/james/bubblewand/wand_collision_hull.obj';
|
||||||
var entity = Entities.addEntity({
|
|
||||||
|
var wand = Entities.addEntity({
|
||||||
name: 'Bubble Wand',
|
name: 'Bubble Wand',
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: WAND_MODEL,
|
modelURL: WAND_MODEL,
|
||||||
|
shapeType: 'compound',
|
||||||
position: position,
|
position: position,
|
||||||
gravity: {
|
gravity: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: -9.8,
|
y: 0,
|
||||||
z: 0
|
z: 0,
|
||||||
},
|
},
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: 0.05,
|
x: 0.05,
|
||||||
|
@ -948,24 +950,27 @@
|
||||||
z: 0.05
|
z: 0.05
|
||||||
},
|
},
|
||||||
//must be enabled to be grabbable in the physics engine
|
//must be enabled to be grabbable in the physics engine
|
||||||
shapeType: 'compound',
|
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
compoundShapeURL: WAND_COLLISION_SHAPE,
|
compoundShapeURL: WAND_COLLISION_SHAPE,
|
||||||
//Look into why bubble wand is going through table when gravity is enabled
|
|
||||||
// gravity: {x: 0, y: -3.5, z: 0},
|
|
||||||
// velocity: {x: 0, y: -0.01, z:0},
|
|
||||||
script: wandScriptURL,
|
script: wandScriptURL,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
|
grabbableKey: {
|
||||||
resetMe: {
|
resetMe: {
|
||||||
resetMe: true
|
resetMe: true
|
||||||
},
|
},
|
||||||
grabbableKey: {
|
invertSolidWhileHeld: true,
|
||||||
invertSolidWhileHeld: true
|
spatialKey: {
|
||||||
|
relativePosition: {
|
||||||
|
x: 0,
|
||||||
|
y: 0.1,
|
||||||
|
z: 0
|
||||||
|
},
|
||||||
|
relativeRotation: Quat.fromPitchYawRollDegrees(0, 0, 90)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createBasketBall(position) {
|
function createBasketBall(position) {
|
||||||
|
|
|
@ -913,17 +913,18 @@ MasterReset = function() {
|
||||||
|
|
||||||
function createWand(position) {
|
function createWand(position) {
|
||||||
var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/wand.fbx';
|
var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/wand.fbx';
|
||||||
var WAND_COLLISION_SHAPE = 'http://hifi-public.s3.amazonaws.com/models/bubblewand/actual_no_top_collision_hull.obj';
|
var WAND_COLLISION_SHAPE = 'http://hifi-content.s3.amazonaws.com/james/bubblewand/wand_collision_hull.obj';
|
||||||
|
|
||||||
var entity = Entities.addEntity({
|
var wand = Entities.addEntity({
|
||||||
name: 'Bubble Wand',
|
name: 'Bubble Wand',
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: WAND_MODEL,
|
modelURL: WAND_MODEL,
|
||||||
|
shapeType: 'compound',
|
||||||
position: position,
|
position: position,
|
||||||
gravity: {
|
gravity: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: -9.8,
|
y: 0,
|
||||||
z: 0
|
z: 0,
|
||||||
},
|
},
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: 0.05,
|
x: 0.05,
|
||||||
|
@ -931,24 +932,27 @@ MasterReset = function() {
|
||||||
z: 0.05
|
z: 0.05
|
||||||
},
|
},
|
||||||
//must be enabled to be grabbable in the physics engine
|
//must be enabled to be grabbable in the physics engine
|
||||||
shapeType: 'compound',
|
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
compoundShapeURL: WAND_COLLISION_SHAPE,
|
compoundShapeURL: WAND_COLLISION_SHAPE,
|
||||||
//Look into why bubble wand is going through table when gravity is enabled
|
|
||||||
// gravity: {x: 0, y: -3.5, z: 0},
|
|
||||||
// velocity: {x: 0, y: -0.01, z:0},
|
|
||||||
script: wandScriptURL,
|
script: wandScriptURL,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
|
grabbableKey: {
|
||||||
resetMe: {
|
resetMe: {
|
||||||
resetMe: true
|
resetMe: true
|
||||||
},
|
},
|
||||||
grabbableKey: {
|
invertSolidWhileHeld: true,
|
||||||
invertSolidWhileHeld: true
|
spatialKey: {
|
||||||
|
relativePosition: {
|
||||||
|
x: 0,
|
||||||
|
y: 0.1,
|
||||||
|
z: 0
|
||||||
|
},
|
||||||
|
relativeRotation: Quat.fromPitchYawRollDegrees(0, 0, 90)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createBasketBall(position) {
|
function createBasketBall(position) {
|
||||||
|
|
Loading…
Reference in a new issue