mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:58:27 +02:00
spawning model
This commit is contained in:
parent
784dc2b538
commit
bfc619497e
1 changed files with 32 additions and 0 deletions
32
examples/homeContent/whiteboardV2/whiteboardSpawner.js
Normal file
32
examples/homeContent/whiteboardV2/whiteboardSpawner.js
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
//
|
||||||
|
// whiteboardSpawner.js
|
||||||
|
// examples/homeContent/whiteboardV2
|
||||||
|
//
|
||||||
|
// Created by Eric Levina on 2/17/16
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Run this script to spawn a whiteboard and associated acoutrements that one can paint on usignmarkers
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
|
||||||
|
|
||||||
|
var orientation = Camera.getOrientation();
|
||||||
|
orientation = Quat.safeEulerAngles(orientation);
|
||||||
|
orientation.x = 0;
|
||||||
|
orientation = Quat.fromVec3Degrees(orientation);
|
||||||
|
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getFront(orientation)));
|
||||||
|
|
||||||
|
var WHITEBOARD_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Whiteboard-3.fbx";
|
||||||
|
var whiteboard = Entities.addEntity({
|
||||||
|
type: "Model",
|
||||||
|
modelURL: WHITEBOARD_MODEL_URL,
|
||||||
|
position: center
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function cleanup() {
|
||||||
|
Entities.deleteEntity(whiteboard);
|
||||||
|
}
|
||||||
|
|
||||||
|
Script.scriptEnding.connect(cleanup);
|
Loading…
Reference in a new issue