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

46 lines
No EOL
1.3 KiB
JavaScript

///
/// makeKibble.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;
this.preload = function(entityID) {
print("loading kibble generation script");
props = Entities.getEntityProperties(entityID, ["position"]);
this.position = props.position;
zebraFood = {
name: "kibble",
position: this.position,
//color: {red: 186, green: 121, blue: 17},
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/feedZebra.js?12",
type: "Model"
};
};
this.mousePressOnEntity = function(entityID, mouseEvent) {
print("creating kibble");
Entities.addEntity(zebraFood);
};
})