Merge pull request #4681 from ZappoMan/DomainZoneExample

Domain zone example & bug fix for default zone shape
This commit is contained in:
Clément Brisset 2015-04-23 23:07:34 +02:00
commit 6669f21a4d
2 changed files with 26 additions and 2 deletions

View file

@ -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
});

View file

@ -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;
}
}