content/hifi-content/elisalj/hack_week/makeKibbleForZebra.js
2022-02-13 23:16:46 +01:00

46 lines
No EOL
1.3 KiB
JavaScript

//
// makeKibbleForZebra.js
// A script to create the kibble to feed the zebras
//
// Author: Elisa Lupin-Jimenez
// Copyright High Fidelity 2017
//
// Licensed under the Apache 2.0 License
// See accompanying license file or http://apache.org/
//
// All assets are under CC Attribution Non-Commerical
// http://creativecommons.org/licenses/
//
(function() {
var zebraFood;
var props;
this.preload = function(entityID) {
print("loading kibble generation script");
props = Entities.getEntityProperties(entityID, ["position"]);
this.position = props.position;
zebraFood = {
name: "kibble",
position: this.position,
dimensions: {x: 0.1024, y: 0.1024, z: 0.1024},
dynamic: true,
gravity: {x: 0, y: -9.8, z: 0},
lifetime: 100,
modelURL: "atp:/4tOmpD9-xsV_7JMb19juw66_obj/Apple_01.obj",
shapeType: "sphere",
script: "https://hifi-content.s3.amazonaws.com/elisalj/hack_week/feedZebraFull.js?09",
type: "Model"
};
};
this.mousePressOnEntity = function(entityID, mouseEvent) {
print("creating kibble");
Entities.addEntity(zebraFood);
};
});