Merge pull request #6539 from imgntn/solidtoys

Fix Solidity of some Single Toy Creators
This commit is contained in:
Clément Brisset 2015-12-03 15:17:02 -08:00
commit 686673795f
4 changed files with 46 additions and 10 deletions

View file

@ -47,7 +47,12 @@ function makeBasketball() {
modelURL: basketballURL,
restitution: 1.0,
damping: 0.00001,
shapeType: "sphere"
shapeType: "sphere",
userData: JSON.stringify({
grabbableKey: {
invertSolidWhileHeld: true
}
})
});
originalPosition = position;
}

View file

@ -15,12 +15,20 @@ function createDoll() {
var scriptURL = Script.resolvePath("doll.js");
var center = Vec3.sum(Vec3.sum(MyAvatar.position, { x: 0, y: 0.5, z: 0 }), Vec3.multiply(0.5, Quat.getFront(Camera.getOrientation())));
var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
x: 0,
y: 0.5,
z: 0
}), Vec3.multiply(0.5, Quat.getFront(Camera.getOrientation())));
var naturalDimensions = { x: 1.63, y: 1.67, z: 0.26};
var naturalDimensions = {
x: 1.63,
y: 1.67,
z: 0.26
};
var desiredDimensions = Vec3.multiply(naturalDimensions, 0.15);
var doll = Entities.addEntity({
type: "Model",
name: "doll",
@ -39,7 +47,12 @@ function createDoll() {
y: 0,
z: 0
},
collisionsWillMove: true
collisionsWillMove: true,
userData: JSON.stringify({
grabbableKey: {
invertSolidWhileHeld: true
}
})
});
return doll;
}

View file

@ -18,14 +18,27 @@ var scriptURL = Script.resolvePath('flashlight.js');
var modelURL = "https://hifi-public.s3.amazonaws.com/models/props/flashlight.fbx";
var center = Vec3.sum(Vec3.sum(MyAvatar.position, {x: 0, y: 0.5, z: 0}), Vec3.multiply(0.5, Quat.getFront(Camera.getOrientation())));
var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
x: 0,
y: 0.5,
z: 0
}), Vec3.multiply(0.5, Quat.getFront(Camera.getOrientation())));
var flashlight = Entities.addEntity({
type: "Model",
modelURL: modelURL,
position: center,
dimensions: { x: 0.08, y: 0.30, z: 0.08},
dimensions: {
x: 0.08,
y: 0.30,
z: 0.08
},
collisionsWillMove: true,
shapeType: 'box',
script: scriptURL
});
script: scriptURL,
userData: JSON.stringify({
grabbableKey: {
invertSolidWhileHeld: true
}
})
});

View file

@ -35,7 +35,12 @@ var pingPongGun = Entities.addEntity({
z: 0.47
},
collisionsWillMove: true,
collisionSoundURL: COLLISION_SOUND_URL
collisionSoundURL: COLLISION_SOUND_URL,
userData: JSON.stringify({
grabbableKey: {
invertSolidWhileHeld: true
}
})
});
function cleanUp() {