From a642af23b79b5deaf229a9baedde36e28435947a Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 27 Nov 2018 08:44:40 -0800 Subject: [PATCH] enable shapeType=ellipsoid and expose zone shapeType to UI --- .../entities/src/EntityItemProperties.cpp | 1 + libraries/entities/src/ZoneEntityItem.cpp | 1 - libraries/shared/src/ShapeInfo.cpp | 3 ++- scripts/system/edit.js | 1 + scripts/system/html/js/entityProperties.js | 20 ++++++++++++++++++- 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index 1745658cf1..282e86c4d4 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -117,6 +117,7 @@ void buildStringToShapeTypeLookup() { addShapeType(SHAPE_TYPE_SIMPLE_HULL); addShapeType(SHAPE_TYPE_SIMPLE_COMPOUND); addShapeType(SHAPE_TYPE_STATIC_MESH); + addShapeType(SHAPE_TYPE_ELLIPSOID); } QHash stringToMaterialMappingModeLookup; diff --git a/libraries/entities/src/ZoneEntityItem.cpp b/libraries/entities/src/ZoneEntityItem.cpp index 4c379f7290..61f07808f6 100644 --- a/libraries/entities/src/ZoneEntityItem.cpp +++ b/libraries/entities/src/ZoneEntityItem.cpp @@ -278,7 +278,6 @@ void ZoneEntityItem::debugDump() const { } void ZoneEntityItem::setShapeType(ShapeType type) { - //ShapeType typeArgument = type; ShapeType oldShapeType = _shapeType; switch(type) { case SHAPE_TYPE_NONE: diff --git a/libraries/shared/src/ShapeInfo.cpp b/libraries/shared/src/ShapeInfo.cpp index 3118fce891..3426a79782 100644 --- a/libraries/shared/src/ShapeInfo.cpp +++ b/libraries/shared/src/ShapeInfo.cpp @@ -58,7 +58,8 @@ const char* shapeTypeNames[] = { "compound", "simple-hull", "simple-compound", - "static-mesh" + "static-mesh", + "ellipsoid" }; static const size_t SHAPETYPE_NAME_COUNT = (sizeof(shapeTypeNames) / sizeof((shapeTypeNames)[0])); diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 36f9af0ea7..28309ee98d 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -372,6 +372,7 @@ const DEFAULT_ENTITY_PROPERTIES = { blue: 179 }, }, + shapeType: "box", bloomMode: "inherit" }, Model: { diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index 78ef8ac313..3554b7e5bf 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -1288,6 +1288,24 @@ const GROUPS = [ }, ] }, + { + id: "zone_shape", + label: "ZONE SHAPE", + properties: [ + { + label: "Shape Type", + type: "dropdown", + options: { "box": "Box", "sphere": "Sphere", "ellipsoid": "Ellipsoid", + "cylinder-y": "Cylinder", "compound": "Use Compound Shape URL" }, + propertyID: "shapeType", + }, + { + label: "Compound Shape URL", + type: "string", + propertyID: "compoundShapeURL", + }, + ] + }, { id: "physics", label: "PHYSICS", @@ -1384,7 +1402,7 @@ const GROUPS_PER_TYPE = { None: [ 'base', 'spatial', 'behavior', 'collision', 'physics' ], Shape: [ 'base', 'shape', 'spatial', 'behavior', 'collision', 'physics' ], Text: [ 'base', 'text', 'spatial', 'behavior', 'collision', 'physics' ], - Zone: [ 'base', 'zone', 'spatial', 'behavior', 'collision', 'physics' ], + Zone: [ 'base', 'zone', 'spatial', 'behavior', 'zone_shape', 'physics' ], Model: [ 'base', 'model', 'spatial', 'behavior', 'collision', 'physics' ], Image: [ 'base', 'image', 'spatial', 'behavior', 'collision', 'physics' ], Web: [ 'base', 'web', 'spatial', 'behavior', 'collision', 'physics' ],