mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
fixed rotation plant
This commit is contained in:
parent
c4f36dc02e
commit
7bbb8167d0
2 changed files with 14 additions and 8 deletions
|
@ -12,14 +12,13 @@
|
|||
var PLANT_SCRIPT_URL = Script.resolvePath("growingPlantEntityScript.js?v1" + Math.random().toFixed(2));
|
||||
var WATER_CAN_SCRIPT_URL = Script.resolvePath("waterCanEntityScript.js?v2" + Math.random().toFixed());
|
||||
Plant = function(spawnPosition, spawnRotation) {
|
||||
var orientation = Camera.getOrientation();
|
||||
orientation = Quat.safeEulerAngles(orientation);
|
||||
orientation.x = 0;
|
||||
orientation = Quat.fromVec3Degrees(orientation);
|
||||
var orientation;
|
||||
if (spawnRotation !== undefined) {
|
||||
orientation = spawnRotation;
|
||||
orientation = Quat.fromPitchYawRollDegrees(spawnRotation.x, spawnRotation.y, spawnRotation.z);
|
||||
} else {
|
||||
orientation = Camera.getOrientation();
|
||||
}
|
||||
|
||||
print("EBL ORIENTATION " + JSON.stringify(orientation));
|
||||
var bowlPosition = spawnPosition;
|
||||
var BOWL_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Flowers--Bowl.fbx";
|
||||
var bowlDimensions = {
|
||||
|
@ -128,6 +127,13 @@ Plant = function(spawnPosition, spawnRotation) {
|
|||
|
||||
var waterSpoutPosition = Vec3.sum(waterCanPosition, Vec3.multiply(0.2, Quat.getFront(orientation)))
|
||||
var waterSpoutRotation = Quat.multiply(waterCanRotation, Quat.fromPitchYawRollDegrees(10, 0, 0));
|
||||
// var waterSpoutRotation = {
|
||||
// x: waterSpoutRotation.x,
|
||||
// y: waterSpoutRotation.y,
|
||||
// z: waterSpoutRotation.z,
|
||||
// w: waterSpoutRotation.w
|
||||
// };
|
||||
print("EBL SET ROTATION")
|
||||
var waterSpout = Entities.addEntity({
|
||||
type: "Box",
|
||||
name: "hifi-water-spout",
|
||||
|
@ -144,7 +150,7 @@ Plant = function(spawnPosition, spawnRotation) {
|
|||
position: waterSpoutPosition,
|
||||
rotation: waterSpoutRotation,
|
||||
parentID: waterCan,
|
||||
visible: false,
|
||||
// visible: false,
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
'reset': true
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
_this.showTidyingButton();
|
||||
_this.playTidyingSound();
|
||||
|
||||
// _this.findAndDeleteHomeEntities();
|
||||
_this.findAndDeleteHomeEntities();
|
||||
Script.setTimeout(function() {
|
||||
_this.showTidyButton();
|
||||
_this.tidying = false;
|
||||
|
|
Loading…
Reference in a new issue