mirror of
https://github.com/lubosz/overte.git
synced 2025-08-28 08:56:26 +02:00
new example script
This commit is contained in:
parent
3e1401014d
commit
31716697c0
1 changed files with 25 additions and 0 deletions
25
examples/twoFallingEntities.js
Normal file
25
examples/twoFallingEntities.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// Testing.js
|
||||
//
|
||||
// Creates a red 0.2 meter diameter ball right in front of your avatar that lives for 60 seconds
|
||||
//
|
||||
|
||||
var radius = 0.1;
|
||||
var position = Vec3.sum(MyAvatar.position, Quat.getFront(MyAvatar.orientation));
|
||||
var properties = {
|
||||
type: "Sphere",
|
||||
position: position,
|
||||
velocity: { x: 0, y: 0, z: 0},
|
||||
gravity: { x: 0, y: -0.05, z: 0},
|
||||
radius: radius,
|
||||
damping: 0.999,
|
||||
color: { red: 200, green: 0, blue: 0 },
|
||||
lifetime: 60
|
||||
};
|
||||
|
||||
var newEntity = Entities.addEntity(properties);
|
||||
position.x -= radius * 1.0;
|
||||
properties.position = position;
|
||||
var newEntityTwo = Entities.addEntity(properties);
|
||||
|
||||
Script.stop(); // no need to run anymore
|
Loading…
Reference in a new issue