mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 15:59:49 +02:00
Merge pull request #6539 from imgntn/solidtoys
Fix Solidity of some Single Toy Creators
This commit is contained in:
commit
686673795f
4 changed files with 46 additions and 10 deletions
|
@ -47,7 +47,12 @@ function makeBasketball() {
|
||||||
modelURL: basketballURL,
|
modelURL: basketballURL,
|
||||||
restitution: 1.0,
|
restitution: 1.0,
|
||||||
damping: 0.00001,
|
damping: 0.00001,
|
||||||
shapeType: "sphere"
|
shapeType: "sphere",
|
||||||
|
userData: JSON.stringify({
|
||||||
|
grabbableKey: {
|
||||||
|
invertSolidWhileHeld: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
originalPosition = position;
|
originalPosition = position;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,12 +15,20 @@ function createDoll() {
|
||||||
|
|
||||||
var scriptURL = Script.resolvePath("doll.js");
|
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 desiredDimensions = Vec3.multiply(naturalDimensions, 0.15);
|
||||||
|
|
||||||
var doll = Entities.addEntity({
|
var doll = Entities.addEntity({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
name: "doll",
|
name: "doll",
|
||||||
|
@ -39,7 +47,12 @@ function createDoll() {
|
||||||
y: 0,
|
y: 0,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
collisionsWillMove: true
|
collisionsWillMove: true,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
grabbableKey: {
|
||||||
|
invertSolidWhileHeld: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
return doll;
|
return doll;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,14 +18,27 @@ var scriptURL = Script.resolvePath('flashlight.js');
|
||||||
|
|
||||||
var modelURL = "https://hifi-public.s3.amazonaws.com/models/props/flashlight.fbx";
|
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({
|
var flashlight = Entities.addEntity({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: modelURL,
|
modelURL: modelURL,
|
||||||
position: center,
|
position: center,
|
||||||
dimensions: { x: 0.08, y: 0.30, z: 0.08},
|
dimensions: {
|
||||||
|
x: 0.08,
|
||||||
|
y: 0.30,
|
||||||
|
z: 0.08
|
||||||
|
},
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
shapeType: 'box',
|
shapeType: 'box',
|
||||||
script: scriptURL
|
script: scriptURL,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
grabbableKey: {
|
||||||
|
invertSolidWhileHeld: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
|
@ -35,7 +35,12 @@ var pingPongGun = Entities.addEntity({
|
||||||
z: 0.47
|
z: 0.47
|
||||||
},
|
},
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
collisionSoundURL: COLLISION_SOUND_URL
|
collisionSoundURL: COLLISION_SOUND_URL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
grabbableKey: {
|
||||||
|
invertSolidWhileHeld: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
function cleanUp() {
|
function cleanUp() {
|
||||||
|
|
Loading…
Reference in a new issue