mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 13:44:36 +02:00
invert solidity of most toybox objects while held
This commit is contained in:
parent
0f2ad8dd49
commit
309cde7f28
2 changed files with 686 additions and 603 deletions
|
@ -319,6 +319,9 @@
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -459,6 +462,9 @@
|
|||
resetMe: {
|
||||
resetMe: true
|
||||
},
|
||||
grabbableKey: {
|
||||
grabbable: false
|
||||
}
|
||||
})
|
||||
};
|
||||
var target = Entities.addEntity(targetProperties);
|
||||
|
@ -492,7 +498,15 @@
|
|||
compoundShapeURL: COLLISION_HULL_URL,
|
||||
position: originalPositions[index],
|
||||
rotation: rotation,
|
||||
script: scriptURL
|
||||
script: scriptURL,
|
||||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true
|
||||
},
|
||||
grabbableKey: {
|
||||
grabbable: false
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
targets[index] = Entities.addEntity(targetProperties);
|
||||
|
@ -553,6 +567,9 @@
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true
|
||||
},
|
||||
grabbableKey: {
|
||||
grabbable: false
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -588,7 +605,11 @@
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
|
@ -856,6 +877,9 @@
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
})
|
||||
};
|
||||
|
@ -945,6 +969,9 @@
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -1019,6 +1046,9 @@
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -1058,6 +1088,9 @@
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -1095,6 +1128,9 @@
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -1131,6 +1167,9 @@
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
})
|
||||
});
|
||||
|
|
|
@ -291,6 +291,9 @@ MasterReset = function() {
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true
|
||||
},
|
||||
grabbable: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -466,7 +469,16 @@ MasterReset = function() {
|
|||
compoundShapeURL: COLLISION_HULL_URL,
|
||||
position: originalPositions[index],
|
||||
rotation: rotation,
|
||||
script: scriptURL
|
||||
script: scriptURL,
|
||||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true
|
||||
},
|
||||
grabbableKey: {
|
||||
grabbable: false
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
targets[index] = Entities.addEntity(targetProperties);
|
||||
|
@ -496,9 +508,9 @@ MasterReset = function() {
|
|||
|
||||
addTargets();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function createCat(position) {
|
||||
function createCat(position) {
|
||||
|
||||
var modelURL = "http://hifi-public.s3.amazonaws.com/ryan/Dark_Cat.fbx";
|
||||
var animationURL = "http://hifi-public.s3.amazonaws.com/ryan/sleeping.fbx";
|
||||
|
@ -527,13 +539,17 @@ MasterReset = function() {
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true
|
||||
},
|
||||
grabbableKey: {
|
||||
grabbable: false
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function createFlashlight(position) {
|
||||
function createFlashlight(position) {
|
||||
var modelURL = "https://hifi-public.s3.amazonaws.com/models/props/flashlight.fbx";
|
||||
|
||||
var flashlight = Entities.addEntity({
|
||||
|
@ -562,14 +578,18 @@ MasterReset = function() {
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function createLights() {
|
||||
function createLights() {
|
||||
var modelURL = "http://hifi-public.s3.amazonaws.com/ryan/lightswitch.fbx";
|
||||
|
||||
|
||||
|
@ -795,11 +815,11 @@ MasterReset = function() {
|
|||
})
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function createDice() {
|
||||
function createDice() {
|
||||
var diceProps = {
|
||||
type: "Model",
|
||||
modelURL: "http://s3.amazonaws.com/hifi-public/models/props/Dice/goldDie.fbx",
|
||||
|
@ -830,23 +850,27 @@ MasterReset = function() {
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
var dice1 = Entities.addEntity(diceProps);
|
||||
};
|
||||
var dice1 = Entities.addEntity(diceProps);
|
||||
|
||||
diceProps.position = {
|
||||
diceProps.position = {
|
||||
x: 541.05,
|
||||
y: 494.96,
|
||||
z: 509.0
|
||||
};
|
||||
};
|
||||
|
||||
var dice2 = Entities.addEntity(diceProps);
|
||||
var dice2 = Entities.addEntity(diceProps);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function createGates() {
|
||||
function createGates() {
|
||||
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/ryan/fence.fbx';
|
||||
|
||||
var rotation = Quat.fromPitchYawRollDegrees(0, -16, 0);
|
||||
|
@ -884,9 +908,9 @@ MasterReset = function() {
|
|||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function createPingPongBallGun() {
|
||||
function createPingPongBallGun() {
|
||||
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun.fbx';
|
||||
var COLLISION_HULL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/ping_pong_gun_collision_hull.obj';
|
||||
|
||||
|
@ -919,12 +943,16 @@ MasterReset = function() {
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function createBasketballHoop() {
|
||||
function createBasketballHoop() {
|
||||
var position = {
|
||||
x: 539.23,
|
||||
y: 496.13,
|
||||
|
@ -961,9 +989,9 @@ MasterReset = function() {
|
|||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function createWand(position) {
|
||||
function createWand(position) {
|
||||
var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/wand.fbx';
|
||||
var WAND_COLLISION_SHAPE = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/actual_no_top_collision_hull.obj';
|
||||
|
||||
|
@ -993,14 +1021,18 @@ MasterReset = function() {
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function createBasketBall(position) {
|
||||
function createBasketBall(position) {
|
||||
|
||||
var modelURL = "http://s3.amazonaws.com/hifi-public/models/content/basketball2.fbx";
|
||||
|
||||
|
@ -1032,13 +1064,17 @@ MasterReset = function() {
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function createDoll(position) {
|
||||
function createDoll(position) {
|
||||
var modelURL = "http://hifi-public.s3.amazonaws.com/models/Bboys/bboy2/bboy2.fbx";
|
||||
|
||||
var naturalDimensions = {
|
||||
|
@ -1069,13 +1105,17 @@ MasterReset = function() {
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function createSprayCan(position) {
|
||||
function createSprayCan(position) {
|
||||
|
||||
var modelURL = "https://hifi-public.s3.amazonaws.com/eric/models/paintcan.fbx";
|
||||
|
||||
|
@ -1105,13 +1145,17 @@ MasterReset = function() {
|
|||
userData: JSON.stringify({
|
||||
resetMe: {
|
||||
resetMe: true,
|
||||
},
|
||||
grabbableKey: {
|
||||
invertSolidWhileHeld: true
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function createPottedPlant(position) {
|
||||
function createPottedPlant(position) {
|
||||
var modelURL = "http://hifi-public.s3.amazonaws.com/models/potted_plant/potted_plant.fbx";
|
||||
|
||||
var entity = Entities.addEntity({
|
||||
|
@ -1146,10 +1190,10 @@ MasterReset = function() {
|
|||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function createCombinedArmChair(position) {
|
||||
function createCombinedArmChair(position) {
|
||||
var modelURL = "http://hifi-public.s3.amazonaws.com/models/red_arm_chair/combined_chair.fbx";
|
||||
var RED_ARM_CHAIR_COLLISION_HULL = "http://hifi-public.s3.amazonaws.com/models/red_arm_chair/red_arm_chair_collision_hull.obj";
|
||||
|
||||
|
@ -1190,9 +1234,9 @@ MasterReset = function() {
|
|||
})
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function createBlocks(position) {
|
||||
function createBlocks(position) {
|
||||
var baseURL = HIFI_PUBLIC_BUCKET + "models/content/planky/";
|
||||
var collisionSoundURL = "https://hifi-public.s3.amazonaws.com/sounds/Collisions-otherorganic/ToyWoodBlock.L.wav";
|
||||
var NUM_BLOCKS_PER_COLOR = 4;
|
||||
|
@ -1271,14 +1315,14 @@ MasterReset = function() {
|
|||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
function cleanup() {
|
||||
deleteAllToys();
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldDeleteOnEndScript) {
|
||||
if (shouldDeleteOnEndScript) {
|
||||
|
||||
Script.scriptEnding.connect(cleanup);
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue