mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-22 18:13:52 +02:00
add bow to master reset
This commit is contained in:
parent
be7d52a773
commit
a10d00f34d
2 changed files with 124 additions and 2 deletions
|
@ -22,6 +22,7 @@
|
||||||
var dollScriptURL = Script.resolvePath("../examples/toybox/doll/doll.js");
|
var dollScriptURL = Script.resolvePath("../examples/toybox/doll/doll.js");
|
||||||
var lightsScriptURL = Script.resolvePath("../examples/toybox/lights/lightSwitch.js");
|
var lightsScriptURL = Script.resolvePath("../examples/toybox/lights/lightSwitch.js");
|
||||||
var targetsScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/wallTarget.js');
|
var targetsScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/wallTarget.js');
|
||||||
|
var bowScriptURL = Script.resolvePath('../examples/toybox/bow/bow.js');
|
||||||
var basketballResetterScriptURL = Script.resolvePath('basketballsResetter.js');
|
var basketballResetterScriptURL = Script.resolvePath('basketballsResetter.js');
|
||||||
var targetsResetterScriptURL = Script.resolvePath('targetsResetter.js');
|
var targetsResetterScriptURL = Script.resolvePath('targetsResetter.js');
|
||||||
|
|
||||||
|
@ -134,6 +135,9 @@
|
||||||
y: 495.6,
|
y: 495.6,
|
||||||
z: 503.91
|
z: 503.91
|
||||||
});
|
});
|
||||||
|
|
||||||
|
createBow();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteAllToys() {
|
function deleteAllToys() {
|
||||||
|
@ -148,6 +152,64 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createBow() {
|
||||||
|
|
||||||
|
var startPosition = {
|
||||||
|
x: 546.41,
|
||||||
|
y: 495.33,
|
||||||
|
z: 506.46
|
||||||
|
};
|
||||||
|
|
||||||
|
var BOW_ROTATION = Quat.fromPitchYawRollDegrees(-103.05, -178.60, -87.27);
|
||||||
|
|
||||||
|
var MODEL_URL = "https://hifi-public.s3.amazonaws.com/models/bow/new/bow-deadly.fbx";
|
||||||
|
var COLLISION_HULL_URL = "https://hifi-public.s3.amazonaws.com/models/bow/new/bow_collision_hull.obj";
|
||||||
|
var BOW_DIMENSIONS = {
|
||||||
|
x: 0.04,
|
||||||
|
y: 1.3,
|
||||||
|
z: 0.21
|
||||||
|
};
|
||||||
|
|
||||||
|
var BOW_GRAVITY = {
|
||||||
|
x: 0,
|
||||||
|
y: -9.8,
|
||||||
|
z: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var bow = Entities.addEntity({
|
||||||
|
name: 'Hifi-Bow',
|
||||||
|
type: "Model",
|
||||||
|
modelURL: MODEL_URL,
|
||||||
|
position: startPosition,
|
||||||
|
rotation: BOW_ROTATION,
|
||||||
|
dimensions: BOW_DIMENSIONS,
|
||||||
|
collisionsWillMove: true,
|
||||||
|
gravity: BOW_GRAVITY,
|
||||||
|
shapeType: 'compound',
|
||||||
|
compoundShapeURL: COLLISION_HULL_URL,
|
||||||
|
script: bowScriptURL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
},
|
||||||
|
grabbableKey: {
|
||||||
|
invertSolidWhileHeld: true,
|
||||||
|
spatialKey: {
|
||||||
|
relativePosition: {
|
||||||
|
x: 0,
|
||||||
|
y: 0.06,
|
||||||
|
z: 0.11
|
||||||
|
},
|
||||||
|
relativeRotation: Quat.fromPitchYawRollDegrees(0, -90, 90)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function createFire() {
|
function createFire() {
|
||||||
|
|
||||||
|
|
||||||
|
@ -1250,6 +1312,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
deleteAllToys();
|
deleteAllToys();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ var pingPongScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/pin
|
||||||
var wandScriptURL = Script.resolvePath("../examples/toybox/bubblewand/wand.js");
|
var wandScriptURL = Script.resolvePath("../examples/toybox/bubblewand/wand.js");
|
||||||
var dollScriptURL = Script.resolvePath("../examples/toybox/doll/doll.js");
|
var dollScriptURL = Script.resolvePath("../examples/toybox/doll/doll.js");
|
||||||
var lightsScriptURL = Script.resolvePath("../examples/toybox/lights/lightSwitch.js");
|
var lightsScriptURL = Script.resolvePath("../examples/toybox/lights/lightSwitch.js");
|
||||||
|
var bowScriptURL = Script.resolvePath("../examples/toybox/bow/bow.js");
|
||||||
var targetsScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/wallTarget.js');
|
var targetsScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/wallTarget.js');
|
||||||
var basketballResetterScriptURL = Script.resolvePath('basketballsResetter.js');
|
var basketballResetterScriptURL = Script.resolvePath('basketballsResetter.js');
|
||||||
var targetsResetterScriptURL = Script.resolvePath('targetsResetter.js');
|
var targetsResetterScriptURL = Script.resolvePath('targetsResetter.js');
|
||||||
|
@ -36,6 +37,8 @@ MasterReset = function() {
|
||||||
deleteAllToys();
|
deleteAllToys();
|
||||||
createAllToys();
|
createAllToys();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function createAllToys() {
|
function createAllToys() {
|
||||||
createBlocks({
|
createBlocks({
|
||||||
x: 548.3,
|
x: 548.3,
|
||||||
|
@ -111,7 +114,7 @@ MasterReset = function() {
|
||||||
z: 503.91
|
z: 503.91
|
||||||
});
|
});
|
||||||
|
|
||||||
|
createBow();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +130,62 @@ MasterReset = function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createBow() {
|
||||||
|
|
||||||
|
var startPosition = {
|
||||||
|
x: 546.41,
|
||||||
|
y: 495.33,
|
||||||
|
z: 506.46
|
||||||
|
};
|
||||||
|
|
||||||
|
var BOW_ROTATION = Quat.fromPitchYawRollDegrees(-103.05, -178.60, -87.27);
|
||||||
|
|
||||||
|
var MODEL_URL = "https://hifi-public.s3.amazonaws.com/models/bow/new/bow-deadly.fbx";
|
||||||
|
var COLLISION_HULL_URL = "https://hifi-public.s3.amazonaws.com/models/bow/new/bow_collision_hull.obj";
|
||||||
|
var BOW_DIMENSIONS = {
|
||||||
|
x: 0.04,
|
||||||
|
y: 1.3,
|
||||||
|
z: 0.21
|
||||||
|
};
|
||||||
|
|
||||||
|
var BOW_GRAVITY = {
|
||||||
|
x: 0,
|
||||||
|
y: -9.8,
|
||||||
|
z: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
var bow = Entities.addEntity({
|
||||||
|
name: 'Hifi-Bow',
|
||||||
|
type: "Model",
|
||||||
|
modelURL: MODEL_URL,
|
||||||
|
position: startPosition,
|
||||||
|
rotation: BOW_ROTATION,
|
||||||
|
dimensions: BOW_DIMENSIONS,
|
||||||
|
collisionsWillMove: true,
|
||||||
|
gravity: BOW_GRAVITY,
|
||||||
|
shapeType: 'compound',
|
||||||
|
compoundShapeURL: COLLISION_HULL_URL,
|
||||||
|
script: bowScriptURL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
},
|
||||||
|
grabbableKey: {
|
||||||
|
invertSolidWhileHeld: true,
|
||||||
|
spatialKey: {
|
||||||
|
relativePosition: {
|
||||||
|
x: 0,
|
||||||
|
y: 0.06,
|
||||||
|
z: 0.11
|
||||||
|
},
|
||||||
|
relativeRotation: Quat.fromPitchYawRollDegrees(0, -90, 90)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function createFire() {
|
function createFire() {
|
||||||
|
|
||||||
|
|
||||||
|
@ -883,7 +942,7 @@ MasterReset = function() {
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: MODEL_URL,
|
modelURL: MODEL_URL,
|
||||||
shapeType: 'compound',
|
shapeType: 'compound',
|
||||||
compoundShapeURL:COLLISION_HULL_URL,
|
compoundShapeURL: COLLISION_HULL_URL,
|
||||||
script: pingPongScriptURL,
|
script: pingPongScriptURL,
|
||||||
position: position,
|
position: position,
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
|
|
Loading…
Reference in a new issue