mirror of
https://github.com/overte-org/overte.git
synced 2025-05-30 13:11:33 +02:00
updated model
This commit is contained in:
parent
f256b1804c
commit
eac91e71e8
1 changed files with 15 additions and 2 deletions
|
@ -1,18 +1,31 @@
|
|||
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation())));
|
||||
var scriptURL = Script.resolvePath("pistolScriptSpawner.js");
|
||||
|
||||
var modelURL = "http://s3.amazonaws.com/hifi-public/cozza13/gun/m1911-handgun+1.fbx";
|
||||
var pistolSpawnerEntity = Entities.addEntity({
|
||||
type: 'Box',
|
||||
position: center,
|
||||
dimensions: {x: 1, y: 1, z: 1},
|
||||
dimensions: {x: 0.38, y: 1.9, z: 3.02},
|
||||
script: scriptURL,
|
||||
visible: false,
|
||||
ignoreForCollisions: true
|
||||
});
|
||||
|
||||
var pistol = Entities.addEntity({
|
||||
type: 'Model',
|
||||
modelURL: modelURL,
|
||||
position: center,
|
||||
dimensions: {x: 0.38, y: 1.9, z: 3.02},
|
||||
script: scriptURL,
|
||||
color: {red: 200, green: 0, blue: 20},
|
||||
ignoreForCollisions: true
|
||||
});
|
||||
|
||||
|
||||
|
||||
function cleanup() {
|
||||
Entities.deleteEntity(pistolSpawnerEntity);
|
||||
Entities.deleteEntity(pistol);
|
||||
}
|
||||
|
||||
// Script.update.connect(update);
|
||||
Script.scriptEnding.connect(cleanup);
|
Loading…
Reference in a new issue