From 721b94044164fe446c325a6d0687857af8f91d0c Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Fri, 25 Mar 2016 12:52:53 -0700 Subject: [PATCH] untip cow --- examples/cows/cowEntityScript.js | 17 +++++++++++++++-- examples/cows/cowSpawner.js | 13 +++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/examples/cows/cowEntityScript.js b/examples/cows/cowEntityScript.js index 2f91aa1ac0..5f93c2e56d 100644 --- a/examples/cows/cowEntityScript.js +++ b/examples/cows/cowEntityScript.js @@ -1,3 +1,18 @@ + // +// cowEntityScript.js +// examples/cows +// +// Created by Eric Levin on 3/25/16 +// Copyright 2016 High Fidelity, Inc. +// +// This entity script handles the logic for untipping a cow after it collides with something +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + + (function() { Script.include("../libraries/utils.js"); @@ -15,7 +30,6 @@ } this.collisionWithEntity = function(myID, otherID, collisionInfo) { - print("EBL COLLISION WITH ENTITY!"); if(_this.shouldUntipCow) { Script.setTimeout(function() { _this.untipCow(); @@ -28,7 +42,6 @@ } this.untipCow = function() { - print("EBL UNTIP COW"); // keep yaw but reset pitch and roll var cowProps = Entities.getEntityProperties(_this.entityID, ["rotation", "position"]); var eulerRotation = Quat.safeEulerAngles(cowProps.rotation); diff --git a/examples/cows/cowSpawner.js b/examples/cows/cowSpawner.js index 6a23a6b5e8..294b8b66a5 100644 --- a/examples/cows/cowSpawner.js +++ b/examples/cows/cowSpawner.js @@ -1,3 +1,16 @@ + // +// cowSpawner.js +// examples/cows +// +// Created by Eric Levin on 3/25/16 +// Copyright 2016 High Fidelity, Inc. +// +// This spawns a cow which will untip itself +// +// 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 = MyAvatar.orientation; orientation = Quat.safeEulerAngles(orientation); orientation.x = 0;