From 5dddca37ca2bf80888fcebaae18a8ef24e590f9c Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 23 Apr 2015 13:44:39 -0700 Subject: [PATCH 1/2] fix default shape of zones --- libraries/entities/src/ZoneEntityItem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/entities/src/ZoneEntityItem.cpp b/libraries/entities/src/ZoneEntityItem.cpp index b1d440e5e5..9ccb2697a0 100644 --- a/libraries/entities/src/ZoneEntityItem.cpp +++ b/libraries/entities/src/ZoneEntityItem.cpp @@ -200,10 +200,11 @@ void ZoneEntityItem::debugDump() const { } ShapeType ZoneEntityItem::getShapeType() const { + // Zones are not allowed to have a SHAPE_TYPE_NONE... they are always at least a SHAPE_TYPE_BOX if (_shapeType == SHAPE_TYPE_COMPOUND) { - return hasCompoundShapeURL() ? SHAPE_TYPE_COMPOUND : SHAPE_TYPE_NONE; + return hasCompoundShapeURL() ? SHAPE_TYPE_COMPOUND : SHAPE_TYPE_BOX; } else { - return _shapeType; + return _shapeType == SHAPE_TYPE_NONE ? SHAPE_TYPE_BOX : _shapeType; } } From aac5675579ec893fd92ee643ef7296d444511d2f Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 23 Apr 2015 13:45:00 -0700 Subject: [PATCH 2/2] add full domain example --- .../entities/fullDomainZoneEntityExample.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 examples/example/entities/fullDomainZoneEntityExample.js diff --git a/examples/example/entities/fullDomainZoneEntityExample.js b/examples/example/entities/fullDomainZoneEntityExample.js new file mode 100644 index 0000000000..e422cfd398 --- /dev/null +++ b/examples/example/entities/fullDomainZoneEntityExample.js @@ -0,0 +1,23 @@ +// +// fullDomainZoneEntityExample.js +// examples +// +// Created by Brad Hefta-Gaub on 4/16/15. +// Copyright 2015 High Fidelity, Inc. +// +// This is an example script that demonstrates creating a Zone which is as large as the entire domain +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +Entities.addEntity({ + type: "Zone", + position: { x: -10000, y: -10000, z: -10000 }, + dimensions: { x: 30000, y: 30000, z: 30000 }, + keyLightColor: { red: 255, green: 255, blue: 0 }, + keyLightDirection: { x: 0, y: -1.0, z: 0 }, + keyLightIntensity: 1.0, + keyLightAmbientIntensity: 0.5 +}); +