mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 01:53:10 +02:00
fix particle properties and keylight direction, remove columns, fix orderings, fix sliders
This commit is contained in:
parent
9df8ea35bb
commit
2b9dcd0875
3 changed files with 186 additions and 135 deletions
|
@ -2182,10 +2182,14 @@ var PropertiesTool = function (opts) {
|
||||||
if (entity.properties.rotation !== undefined) {
|
if (entity.properties.rotation !== undefined) {
|
||||||
entity.properties.rotation = Quat.safeEulerAngles(entity.properties.rotation);
|
entity.properties.rotation = Quat.safeEulerAngles(entity.properties.rotation);
|
||||||
}
|
}
|
||||||
|
if (entity.properties.emitOrientation !== undefined) {
|
||||||
|
entity.properties.emitOrientation = Quat.safeEulerAngles(entity.properties.emitOrientation);
|
||||||
|
}
|
||||||
if (entity.properties.keyLight !== undefined && entity.properties.keyLight.direction !== undefined) {
|
if (entity.properties.keyLight !== undefined && entity.properties.keyLight.direction !== undefined) {
|
||||||
entity.properties.keyLight.direction = Vec3.multiply(RADIANS_TO_DEGREES,
|
print("DBACK TEST entity.properties.keyLight.direction pre " + entity.properties.keyLight.direction.x + " " + entity.properties.keyLight.direction.y + " " + entity.properties.keyLight.direction.z);
|
||||||
Vec3.toPolar(entity.properties.keyLight.direction));
|
entity.properties.keyLight.direction = Vec3.toPolar(entity.properties.keyLight.direction);
|
||||||
entity.properties.keyLight.direction.z = 0.0;
|
entity.properties.keyLight.direction.z = 0.0;
|
||||||
|
print("DBACK TEST entity.properties.keyLight.direction post " + entity.properties.keyLight.direction.x + " " + entity.properties.keyLight.direction.y + " " + entity.properties.keyLight.direction.z);
|
||||||
}
|
}
|
||||||
selections.push(entity);
|
selections.push(entity);
|
||||||
}
|
}
|
||||||
|
@ -2220,18 +2224,27 @@ var PropertiesTool = function (opts) {
|
||||||
data.properties.angularVelocity = Vec3.ZERO;
|
data.properties.angularVelocity = Vec3.ZERO;
|
||||||
}
|
}
|
||||||
if (data.properties.rotation !== undefined) {
|
if (data.properties.rotation !== undefined) {
|
||||||
var rotation = data.properties.rotation;
|
data.properties.rotation = Quat.fromVec3Degrees(data.properties.rotation);
|
||||||
data.properties.rotation = Quat.fromPitchYawRollDegrees(rotation.x, rotation.y, rotation.z);
|
}
|
||||||
|
if (data.properties.emitOrientation !== undefined) {
|
||||||
|
data.properties.emitOrientation = Quat.fromVec3Degrees(data.properties.emitOrientation);
|
||||||
}
|
}
|
||||||
if (data.properties.keyLight !== undefined && data.properties.keyLight.direction !== undefined) {
|
if (data.properties.keyLight !== undefined && data.properties.keyLight.direction !== undefined) {
|
||||||
data.properties.keyLight.direction = Vec3.fromPolar(
|
var currentKeyLightDirection = Vec3.toPolar(Entities.getEntityProperties(selectionManager.selections[0], ['keyLight.direction']).keyLight.direction);
|
||||||
data.properties.keyLight.direction.x * DEGREES_TO_RADIANS,
|
print("DBACK TEST data.properties.keyLight.direction pre pre " + data.properties.keyLight.direction.x + " " + data.properties.keyLight.direction.y + " " + data.properties.keyLight.direction.z + " currentKeyLightDirection " + currentKeyLightDirection.x + " " + currentKeyLightDirection.y + " " + currentKeyLightDirection.z);
|
||||||
data.properties.keyLight.direction.y * DEGREES_TO_RADIANS
|
if (data.properties.keyLight.direction.x === undefined) {
|
||||||
);
|
data.properties.keyLight.direction.x = currentKeyLightDirection.x;
|
||||||
|
}
|
||||||
|
if (data.properties.keyLight.direction.y === undefined) {
|
||||||
|
data.properties.keyLight.direction.y = currentKeyLightDirection.y;
|
||||||
|
}
|
||||||
|
print("DBACK TEST data.properties.keyLight.direction pre " + data.properties.keyLight.direction.x + " " + data.properties.keyLight.direction.y + " " + data.properties.keyLight.direction.z);
|
||||||
|
data.properties.keyLight.direction = Vec3.fromPolar(data.properties.keyLight.direction.x, data.properties.keyLight.direction.y);
|
||||||
|
print("DBACK TEST data.properties.keyLight.direction post " + data.properties.keyLight.direction.x + " " + data.properties.keyLight.direction.y + " " + data.properties.keyLight.direction.z);
|
||||||
}
|
}
|
||||||
Entities.editEntity(selectionManager.selections[0], data.properties);
|
Entities.editEntity(selectionManager.selections[0], data.properties);
|
||||||
if (data.properties.name !== undefined || data.properties.modelURL !== undefined || data.properties.materialURL !== undefined ||
|
if (data.properties.name !== undefined || data.properties.modelURL !== undefined || data.properties.materialURL !== undefined ||
|
||||||
data.properties.visible !== undefined || data.properties.locked !== undefined) {
|
data.properties.visible !== undefined || data.properties.locked !== undefined) {
|
||||||
entityListTool.sendUpdate();
|
entityListTool.sendUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -470,6 +470,11 @@ input[type=checkbox]:checked + label:hover {
|
||||||
border: 1.5pt solid black;
|
border: 1.5pt solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#properties-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
#properties-list fieldset {
|
#properties-list fieldset {
|
||||||
position: relative;
|
position: relative;
|
||||||
/* 0.1px on the top is to prevent margin collapsing between this and it's first child */
|
/* 0.1px on the top is to prevent margin collapsing between this and it's first child */
|
||||||
|
@ -551,6 +556,16 @@ div.section-header:first-child {
|
||||||
margin-bottom: -21px;
|
margin-bottom: -21px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#properties-list .sub-section-header {
|
||||||
|
border-top: none;
|
||||||
|
box-shadow: none;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-section-header + .property {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
border: none;
|
border: none;
|
||||||
padding-top: 2px;
|
padding-top: 2px;
|
||||||
|
@ -634,7 +649,7 @@ hr {
|
||||||
height: 1.8rem;
|
height: 1.8rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text label, .url label, .number label, .textarea label, .xy label, .wh label, .rgb label, .xyz label,.pyr label, .dropdown label, .gen label {
|
.text label, .url label, .number label, .textarea label, .xy label, .wh label, .rgb label, .xyz label, .pyr label, .dropdown label, .gen label {
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: 1px;
|
margin-left: 1px;
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
|
@ -648,6 +663,10 @@ hr {
|
||||||
margin-top: -2px;
|
margin-top: -2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.xy > div, .wh > div, .xyz > div, .pyr > div, .gen > div {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
.number > input {
|
.number > input {
|
||||||
clear: both;
|
clear: both;
|
||||||
float: left;
|
float: left;
|
||||||
|
@ -656,9 +675,6 @@ hr {
|
||||||
clear: both;
|
clear: both;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
.xy > div, .wh > div, .xyz > div, .pyr > div, .gen > div {
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown {
|
.dropdown {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -1018,6 +1034,10 @@ textarea:enabled[scrolling="true"]::-webkit-resizer {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
body#entity-list-body {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
#entity-list-header {
|
#entity-list-header {
|
||||||
margin-bottom: 36px;
|
margin-bottom: 36px;
|
||||||
}
|
}
|
||||||
|
@ -1054,16 +1074,6 @@ textarea:enabled[scrolling="true"]::-webkit-resizer {
|
||||||
position: relative; /* New positioning context. */
|
position: relative; /* New positioning context. */
|
||||||
}
|
}
|
||||||
|
|
||||||
#footer-text {
|
|
||||||
float: right;
|
|
||||||
padding-top: 12px;
|
|
||||||
padding-right: 22px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#entity-list-footer {
|
|
||||||
padding-top: 9px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#search-area {
|
#search-area {
|
||||||
padding-right: 168px;
|
padding-right: 168px;
|
||||||
padding-bottom: 24px;
|
padding-bottom: 24px;
|
||||||
|
@ -1091,6 +1101,32 @@ textarea:enabled[scrolling="true"]::-webkit-resizer {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#entity-list-footer {
|
||||||
|
padding-top: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#footer-text {
|
||||||
|
float: right;
|
||||||
|
padding-top: 12px;
|
||||||
|
padding-right: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=button]#export {
|
||||||
|
height: 38px;
|
||||||
|
width: 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#no-entities {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 80px;
|
||||||
|
padding: 12px;
|
||||||
|
font-family: FiraSans-SemiBold;
|
||||||
|
font-size: 15px;
|
||||||
|
font-style: italic;
|
||||||
|
color: #afafaf;
|
||||||
|
}
|
||||||
|
|
||||||
#entity-table-scroll {
|
#entity-table-scroll {
|
||||||
/* Height is set by JavaScript. */
|
/* Height is set by JavaScript. */
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -1418,33 +1454,6 @@ input#property-scale-button-reset {
|
||||||
right: -20px;
|
right: -20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#properties-list #collision-info > fieldset:first-of-type {
|
#div-property-collisionSoundURL[style*="display: none"] + .property {
|
||||||
border-top: none !important;
|
|
||||||
box-shadow: none;
|
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#properties-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
#no-entities {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
top: 80px;
|
|
||||||
padding: 12px;
|
|
||||||
font-family: FiraSans-SemiBold;
|
|
||||||
font-size: 15px;
|
|
||||||
font-style: italic;
|
|
||||||
color: #afafaf;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type=button]#export {
|
|
||||||
height: 38px;
|
|
||||||
width: 180px;
|
|
||||||
}
|
|
||||||
|
|
||||||
body#entity-list-body {
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
|
@ -181,6 +181,7 @@ const GROUPS = [
|
||||||
{
|
{
|
||||||
label: "Light Horizontal Angle",
|
label: "Light Horizontal Angle",
|
||||||
type: "number",
|
type: "number",
|
||||||
|
multiplier: DEGREES_TO_RADIANS,
|
||||||
decimals: 2,
|
decimals: 2,
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "keyLight.direction.x",
|
propertyID: "keyLight.direction.x",
|
||||||
|
@ -189,6 +190,7 @@ const GROUPS = [
|
||||||
{
|
{
|
||||||
label: "Light Vertical Angle",
|
label: "Light Vertical Angle",
|
||||||
type: "number",
|
type: "number",
|
||||||
|
multiplier: DEGREES_TO_RADIANS,
|
||||||
decimals: 2,
|
decimals: 2,
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "keyLight.direction.y",
|
propertyID: "keyLight.direction.y",
|
||||||
|
@ -301,8 +303,8 @@ const GROUPS = [
|
||||||
{
|
{
|
||||||
label: "Background Blend",
|
label: "Background Blend",
|
||||||
type: "slider",
|
type: "slider",
|
||||||
min: 0.0,
|
min: 0,
|
||||||
max: 1.0,
|
max: 1,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
decimals: 2,
|
decimals: 2,
|
||||||
propertyID: "haze.hazeBackgroundBlend",
|
propertyID: "haze.hazeBackgroundBlend",
|
||||||
|
@ -610,6 +612,7 @@ const GROUPS = [
|
||||||
min: 0.01,
|
min: 0.01,
|
||||||
max: 10,
|
max: 10,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "lifespan",
|
propertyID: "lifespan",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -646,6 +649,7 @@ const GROUPS = [
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 5,
|
max: 5,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "emitSpeed",
|
propertyID: "emitSpeed",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -654,6 +658,7 @@ const GROUPS = [
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 5,
|
max: 5,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "speedSpread",
|
propertyID: "speedSpread",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -662,6 +667,7 @@ const GROUPS = [
|
||||||
vec3Type: "xyz",
|
vec3Type: "xyz",
|
||||||
min: 0,
|
min: 0,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
round: 100,
|
||||||
subLabels: [ "x", "y", "z" ],
|
subLabels: [ "x", "y", "z" ],
|
||||||
propertyID: "emitDimensions",
|
propertyID: "emitDimensions",
|
||||||
},
|
},
|
||||||
|
@ -669,8 +675,8 @@ const GROUPS = [
|
||||||
label: "Emit Orientation",
|
label: "Emit Orientation",
|
||||||
type: "vec3",
|
type: "vec3",
|
||||||
vec3Type: "pyr",
|
vec3Type: "pyr",
|
||||||
min: 0,
|
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
round: 100,
|
||||||
subLabels: [ "pitch", "yaw", "roll" ],
|
subLabels: [ "pitch", "yaw", "roll" ],
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "emitOrientation",
|
propertyID: "emitOrientation",
|
||||||
|
@ -689,30 +695,38 @@ const GROUPS = [
|
||||||
{
|
{
|
||||||
label: "Size",
|
label: "Size",
|
||||||
type: "slider",
|
type: "slider",
|
||||||
|
min: 0,
|
||||||
max: 4,
|
max: 4,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "particleRadius",
|
propertyID: "particleRadius",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Size Spread",
|
label: "Size Spread",
|
||||||
type: "slider",
|
type: "slider",
|
||||||
|
min: 0,
|
||||||
max: 4,
|
max: 4,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "radiusSpread",
|
propertyID: "radiusSpread",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Size Start",
|
label: "Size Start",
|
||||||
type: "slider",
|
type: "slider",
|
||||||
|
min: 0,
|
||||||
max: 4,
|
max: 4,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "radiusStart",
|
propertyID: "radiusStart",
|
||||||
fallbackProperty: "particleRadius",
|
fallbackProperty: "particleRadius",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Size Finish",
|
label: "Size Finish",
|
||||||
type: "slider",
|
type: "slider",
|
||||||
|
min: 0,
|
||||||
max: 4,
|
max: 4,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "radiusFinish",
|
propertyID: "radiusFinish",
|
||||||
fallbackProperty: "particleRadius",
|
fallbackProperty: "particleRadius",
|
||||||
},
|
},
|
||||||
|
@ -757,6 +771,7 @@ const GROUPS = [
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 1,
|
max: 1,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "alpha",
|
propertyID: "alpha",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -765,6 +780,7 @@ const GROUPS = [
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 1,
|
max: 1,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "alphaSpread",
|
propertyID: "alphaSpread",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -773,6 +789,7 @@ const GROUPS = [
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 1,
|
max: 1,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "alphaStart",
|
propertyID: "alphaStart",
|
||||||
fallbackProperty: "alpha",
|
fallbackProperty: "alpha",
|
||||||
},
|
},
|
||||||
|
@ -782,6 +799,7 @@ const GROUPS = [
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 1,
|
max: 1,
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
decimals: 2,
|
||||||
propertyID: "alphaFinish",
|
propertyID: "alphaFinish",
|
||||||
fallbackProperty: "alpha",
|
fallbackProperty: "alpha",
|
||||||
},
|
},
|
||||||
|
@ -796,6 +814,7 @@ const GROUPS = [
|
||||||
type: "vec3",
|
type: "vec3",
|
||||||
vec3Type: "xyz",
|
vec3Type: "xyz",
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
round: 100,
|
||||||
subLabels: [ "x", "y", "z" ],
|
subLabels: [ "x", "y", "z" ],
|
||||||
propertyID: "emitAcceleration",
|
propertyID: "emitAcceleration",
|
||||||
},
|
},
|
||||||
|
@ -804,6 +823,7 @@ const GROUPS = [
|
||||||
type: "vec3",
|
type: "vec3",
|
||||||
vec3Type: "xyz",
|
vec3Type: "xyz",
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
|
round: 100,
|
||||||
subLabels: [ "x", "y", "z" ],
|
subLabels: [ "x", "y", "z" ],
|
||||||
propertyID: "accelerationSpread",
|
propertyID: "accelerationSpread",
|
||||||
},
|
},
|
||||||
|
@ -819,6 +839,7 @@ const GROUPS = [
|
||||||
min: -360,
|
min: -360,
|
||||||
max: 360,
|
max: 360,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
decimals: 0,
|
||||||
multiplier: DEGREES_TO_RADIANS,
|
multiplier: DEGREES_TO_RADIANS,
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "particleSpin",
|
propertyID: "particleSpin",
|
||||||
|
@ -829,6 +850,7 @@ const GROUPS = [
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 360,
|
max: 360,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
decimals: 0,
|
||||||
multiplier: DEGREES_TO_RADIANS,
|
multiplier: DEGREES_TO_RADIANS,
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "spinSpread",
|
propertyID: "spinSpread",
|
||||||
|
@ -839,6 +861,7 @@ const GROUPS = [
|
||||||
min: -360,
|
min: -360,
|
||||||
max: 360,
|
max: 360,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
decimals: 0,
|
||||||
multiplier: DEGREES_TO_RADIANS,
|
multiplier: DEGREES_TO_RADIANS,
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "spinStart",
|
propertyID: "spinStart",
|
||||||
|
@ -850,6 +873,7 @@ const GROUPS = [
|
||||||
min: -360,
|
min: -360,
|
||||||
max: 360,
|
max: 360,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
decimals: 0,
|
||||||
multiplier: DEGREES_TO_RADIANS,
|
multiplier: DEGREES_TO_RADIANS,
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "spinFinish",
|
propertyID: "spinFinish",
|
||||||
|
@ -869,9 +893,10 @@ const GROUPS = [
|
||||||
{
|
{
|
||||||
label: "Horizontal Angle Start",
|
label: "Horizontal Angle Start",
|
||||||
type: "slider",
|
type: "slider",
|
||||||
min: 0,
|
min: -180,
|
||||||
max: 180,
|
max: 0,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
decimals: 0,
|
||||||
multiplier: DEGREES_TO_RADIANS,
|
multiplier: DEGREES_TO_RADIANS,
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "azimuthStart",
|
propertyID: "azimuthStart",
|
||||||
|
@ -879,9 +904,10 @@ const GROUPS = [
|
||||||
{
|
{
|
||||||
label: "Horizontal Angle Finish",
|
label: "Horizontal Angle Finish",
|
||||||
type: "slider",
|
type: "slider",
|
||||||
min: -180,
|
min: 0,
|
||||||
max: 0,
|
max: 180,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
decimals: 0,
|
||||||
multiplier: DEGREES_TO_RADIANS,
|
multiplier: DEGREES_TO_RADIANS,
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "azimuthFinish",
|
propertyID: "azimuthFinish",
|
||||||
|
@ -892,6 +918,7 @@ const GROUPS = [
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 180,
|
max: 180,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
decimals: 0,
|
||||||
multiplier: DEGREES_TO_RADIANS,
|
multiplier: DEGREES_TO_RADIANS,
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "polarStart",
|
propertyID: "polarStart",
|
||||||
|
@ -902,6 +929,7 @@ const GROUPS = [
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 180,
|
max: 180,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
decimals: 0,
|
||||||
multiplier: DEGREES_TO_RADIANS,
|
multiplier: DEGREES_TO_RADIANS,
|
||||||
unit: "deg",
|
unit: "deg",
|
||||||
propertyID: "polarFinish",
|
propertyID: "polarFinish",
|
||||||
|
@ -935,6 +963,7 @@ const GROUPS = [
|
||||||
label: "Dimension",
|
label: "Dimension",
|
||||||
type: "vec3",
|
type: "vec3",
|
||||||
vec3Type: "xyz",
|
vec3Type: "xyz",
|
||||||
|
min: 0,
|
||||||
step: 0.1,
|
step: 0.1,
|
||||||
decimals: 4,
|
decimals: 4,
|
||||||
subLabels: [ "x", "y", "z" ],
|
subLabels: [ "x", "y", "z" ],
|
||||||
|
@ -972,31 +1001,16 @@ const GROUPS = [
|
||||||
{
|
{
|
||||||
id: "behavior",
|
id: "behavior",
|
||||||
label: "BEHAVIOR",
|
label: "BEHAVIOR",
|
||||||
twoColumn: true,
|
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Grabbable",
|
label: "Grabbable",
|
||||||
type: "bool",
|
type: "bool",
|
||||||
propertyID: "grab.grabbable",
|
propertyID: "grab.grabbable",
|
||||||
column: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Triggerable",
|
|
||||||
type: "bool",
|
|
||||||
propertyID: "grab.triggerable",
|
|
||||||
column: 2,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Cloneable",
|
label: "Cloneable",
|
||||||
type: "bool",
|
type: "bool",
|
||||||
propertyID: "cloneable",
|
propertyID: "cloneable",
|
||||||
column: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Follow Controller",
|
|
||||||
type: "bool",
|
|
||||||
propertyID: "grab.grabFollowsController",
|
|
||||||
column: 2,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Clone Lifetime",
|
label: "Clone Lifetime",
|
||||||
|
@ -1004,30 +1018,36 @@ const GROUPS = [
|
||||||
unit: "s",
|
unit: "s",
|
||||||
propertyID: "cloneLifetime",
|
propertyID: "cloneLifetime",
|
||||||
showPropertyRule: { "cloneable": "true" },
|
showPropertyRule: { "cloneable": "true" },
|
||||||
column: 1,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Clone Limit",
|
label: "Clone Limit",
|
||||||
type: "number",
|
type: "number",
|
||||||
propertyID: "cloneLimit",
|
propertyID: "cloneLimit",
|
||||||
showPropertyRule: { "cloneable": "true" },
|
showPropertyRule: { "cloneable": "true" },
|
||||||
column: 1,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Clone Dynamic",
|
label: "Clone Dynamic",
|
||||||
type: "bool",
|
type: "bool",
|
||||||
propertyID: "cloneDynamic",
|
propertyID: "cloneDynamic",
|
||||||
showPropertyRule: { "cloneable": "true" },
|
showPropertyRule: { "cloneable": "true" },
|
||||||
column: 1,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Clone Avatar Entity",
|
label: "Clone Avatar Entity",
|
||||||
type: "bool",
|
type: "bool",
|
||||||
propertyID: "cloneAvatarEntity",
|
propertyID: "cloneAvatarEntity",
|
||||||
showPropertyRule: { "cloneable": "true" },
|
showPropertyRule: { "cloneable": "true" },
|
||||||
column: 1,
|
|
||||||
},
|
},
|
||||||
{ // below properties having no column number means place them after two columns div
|
{
|
||||||
|
label: "Triggerable",
|
||||||
|
type: "bool",
|
||||||
|
propertyID: "grab.triggerable",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Follow Controller",
|
||||||
|
type: "bool",
|
||||||
|
propertyID: "grab.grabFollowsController",
|
||||||
|
},
|
||||||
|
{
|
||||||
label: "Cast shadows",
|
label: "Cast shadows",
|
||||||
type: "bool",
|
type: "bool",
|
||||||
propertyID: "canCastShadow",
|
propertyID: "canCastShadow",
|
||||||
|
@ -1068,34 +1088,18 @@ const GROUPS = [
|
||||||
{
|
{
|
||||||
id: "collision",
|
id: "collision",
|
||||||
label: "COLLISION",
|
label: "COLLISION",
|
||||||
twoColumn: true,
|
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
label: "Collides",
|
label: "Collides",
|
||||||
type: "bool",
|
type: "bool",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
propertyID: "collisionless",
|
propertyID: "collisionless",
|
||||||
column: -1, // before two columns div
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Dynamic",
|
|
||||||
type: "bool",
|
|
||||||
propertyID: "dynamic",
|
|
||||||
column: -1, // before two columns div
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Collides With",
|
label: "Collides With",
|
||||||
type: "sub-header",
|
type: "sub-header",
|
||||||
propertyID: "collidesWithHeader", // not actually a property but used for naming/storing this element
|
propertyID: "collidesWithHeader", // not actually a property but used for naming/storing this element
|
||||||
showPropertyRule: { "collisionless": "false" },
|
showPropertyRule: { "collisionless": "false" },
|
||||||
column: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "",
|
|
||||||
type: "sub-header",
|
|
||||||
propertyID: "collidesWithHeaderHelper", // not actually a property but used for naming/storing this element
|
|
||||||
showPropertyRule: { "collisionless": "false" },
|
|
||||||
column: 2,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Static Entities",
|
label: "Static Entities",
|
||||||
|
@ -1104,16 +1108,6 @@ const GROUPS = [
|
||||||
propertyName: "static", // actual subProperty name
|
propertyName: "static", // actual subProperty name
|
||||||
subPropertyOf: "collidesWith",
|
subPropertyOf: "collidesWith",
|
||||||
showPropertyRule: { "collisionless": "false" },
|
showPropertyRule: { "collisionless": "false" },
|
||||||
column: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Dynamic Entities",
|
|
||||||
type: "bool",
|
|
||||||
propertyID: "collidesWithDynamic",
|
|
||||||
propertyName: "dynamic", // actual subProperty name
|
|
||||||
subPropertyOf: "collidesWith",
|
|
||||||
showPropertyRule: { "collisionless": "false" },
|
|
||||||
column: 2,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Kinematic Entities",
|
label: "Kinematic Entities",
|
||||||
|
@ -1122,7 +1116,14 @@ const GROUPS = [
|
||||||
propertyName: "kinematic", // actual subProperty name
|
propertyName: "kinematic", // actual subProperty name
|
||||||
subPropertyOf: "collidesWith",
|
subPropertyOf: "collidesWith",
|
||||||
showPropertyRule: { "collisionless": "false" },
|
showPropertyRule: { "collisionless": "false" },
|
||||||
column: 1,
|
},
|
||||||
|
{
|
||||||
|
label: "Dynamic Entities",
|
||||||
|
type: "bool",
|
||||||
|
propertyID: "collidesWithDynamic",
|
||||||
|
propertyName: "dynamic", // actual subProperty name
|
||||||
|
subPropertyOf: "collidesWith",
|
||||||
|
showPropertyRule: { "collisionless": "false" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "My Avatar",
|
label: "My Avatar",
|
||||||
|
@ -1131,7 +1132,6 @@ const GROUPS = [
|
||||||
propertyName: "myAvatar", // actual subProperty name
|
propertyName: "myAvatar", // actual subProperty name
|
||||||
subPropertyOf: "collidesWith",
|
subPropertyOf: "collidesWith",
|
||||||
showPropertyRule: { "collisionless": "false" },
|
showPropertyRule: { "collisionless": "false" },
|
||||||
column: 2,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Other Avatars",
|
label: "Other Avatars",
|
||||||
|
@ -1140,14 +1140,17 @@ const GROUPS = [
|
||||||
propertyName: "otherAvatar", // actual subProperty name
|
propertyName: "otherAvatar", // actual subProperty name
|
||||||
subPropertyOf: "collidesWith",
|
subPropertyOf: "collidesWith",
|
||||||
showPropertyRule: { "collisionless": "false" },
|
showPropertyRule: { "collisionless": "false" },
|
||||||
column: 1,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Collision sound URL",
|
label: "Collision sound URL",
|
||||||
type: "string",
|
type: "string",
|
||||||
propertyID: "collisionSoundURL",
|
propertyID: "collisionSoundURL",
|
||||||
showPropertyRule: { "collisionless": "false" },
|
showPropertyRule: { "collisionless": "false" },
|
||||||
// having no column number means place this after two columns div
|
},
|
||||||
|
{
|
||||||
|
label: "Dynamic",
|
||||||
|
type: "bool",
|
||||||
|
propertyID: "dynamic",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1555,15 +1558,12 @@ function createEmitCheckedPropertyUpdateFunction(propertyName, inverse) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function createEmitNumberPropertyUpdateFunction(propertyName, multiplier, decimals) {
|
function createEmitNumberPropertyUpdateFunction(propertyName, multiplier) {
|
||||||
return function() {
|
return function() {
|
||||||
let value = parseFloat(this.value);
|
if (multiplier === undefined) {
|
||||||
if (multiplier !== undefined) {
|
multiplier = 1;
|
||||||
value *= multiplier;
|
|
||||||
}
|
|
||||||
if (decimals !== undefined) {
|
|
||||||
value = value.toFixed(decimals);
|
|
||||||
}
|
}
|
||||||
|
let value = parseFloat(this.value) * multiplier;
|
||||||
updateProperty(propertyName, value);
|
updateProperty(propertyName, value);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1720,7 +1720,7 @@ function createNumberProperty(property, elProperty, elLabel) {
|
||||||
elInput.value = defaultValue;
|
elInput.value = defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
elInput.addEventListener('change', createEmitNumberPropertyUpdateFunction(propertyName, propertyData.muliplier, propertyData.decimals));
|
elInput.addEventListener('change', createEmitNumberPropertyUpdateFunction(propertyName, propertyData.multiplier, propertyData.decimals));
|
||||||
|
|
||||||
elProperty.appendChild(elLabel);
|
elProperty.appendChild(elLabel);
|
||||||
elProperty.appendChild(elInput);
|
elProperty.appendChild(elInput);
|
||||||
|
@ -1760,24 +1760,31 @@ function createSliderProperty(property, elProperty, elLabel) {
|
||||||
elSlider.setAttribute("step", propertyData.step);
|
elSlider.setAttribute("step", propertyData.step);
|
||||||
}
|
}
|
||||||
|
|
||||||
elInput.oninput = function (event) {
|
elInput.onchange = function (event) {
|
||||||
let value = event.target.value;
|
let inputValue = event.target.value;
|
||||||
elSlider.value = value;
|
elSlider.value = inputValue;
|
||||||
if (propertyData.multiplier !== undefined) {
|
if (propertyData.multiplier !== undefined) {
|
||||||
value *= propertyData.multiplier;
|
inputValue *= propertyData.multiplier;
|
||||||
}
|
}
|
||||||
updateProperty(property.name, value);
|
updateProperty(property.name, inputValue);
|
||||||
};
|
};
|
||||||
elInput.onchange = elInput.oninput;
|
|
||||||
elSlider.oninput = function (event) {
|
elSlider.oninput = function (event) {
|
||||||
let value = event.target.value;
|
let sliderValue = event.target.value;
|
||||||
elInput.value = value;
|
if (propertyData.step === 1) {
|
||||||
if (propertyData.multiplier !== undefined) {
|
if (sliderValue > 0) {
|
||||||
value *= propertyData.multiplier;
|
elInput.value = Math.floor(sliderValue);
|
||||||
|
} else {
|
||||||
|
elInput.value = Math.ceil(sliderValue);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
elInput.value = sliderValue;
|
||||||
}
|
}
|
||||||
updateProperty(property.name, value);
|
if (propertyData.multiplier !== undefined) {
|
||||||
|
sliderValue *= propertyData.multiplier;
|
||||||
|
}
|
||||||
|
updateProperty(property.name, sliderValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
elDiv.appendChild(elLabel);
|
elDiv.appendChild(elLabel);
|
||||||
elDiv.appendChild(elSlider);
|
elDiv.appendChild(elSlider);
|
||||||
elDiv.appendChild(elInput);
|
elDiv.appendChild(elInput);
|
||||||
|
@ -2952,8 +2959,15 @@ function loaded() {
|
||||||
case 'number':
|
case 'number':
|
||||||
case 'slider': {
|
case 'slider': {
|
||||||
let multiplier = propertyData.multiplier !== undefined ? propertyData.multiplier : 1;
|
let multiplier = propertyData.multiplier !== undefined ? propertyData.multiplier : 1;
|
||||||
let decimals = propertyData.decimals !== undefined ? propertyData.decimals : 0;
|
let value = propertyValue / multiplier;
|
||||||
property.elInput.value = (propertyValue / multiplier).toFixed(decimals);
|
if (propertyData.round !== undefined) {
|
||||||
|
value = Math.round(value.round) / propertyData.round;
|
||||||
|
}
|
||||||
|
if (propertyData.decimals !== undefined) {
|
||||||
|
property.elInput.value = value.toFixed(propertyData.decimals);
|
||||||
|
} else {
|
||||||
|
property.elInput.value = value;
|
||||||
|
}
|
||||||
if (property.elSlider !== undefined) {
|
if (property.elSlider !== undefined) {
|
||||||
property.elSlider.value = property.elInput.value;
|
property.elSlider.value = property.elInput.value;
|
||||||
}
|
}
|
||||||
|
@ -2962,11 +2976,26 @@ function loaded() {
|
||||||
case 'vec3':
|
case 'vec3':
|
||||||
case 'vec2': {
|
case 'vec2': {
|
||||||
let multiplier = propertyData.multiplier !== undefined ? propertyData.multiplier : 1;
|
let multiplier = propertyData.multiplier !== undefined ? propertyData.multiplier : 1;
|
||||||
let decimals = propertyData.decimals !== undefined ? propertyData.decimals : 0;
|
let valueX = propertyValue.x / multiplier;
|
||||||
property.elInputX.value = (propertyValue.x / multiplier).toFixed(decimals);
|
let valueY = propertyValue.y / multiplier;
|
||||||
property.elInputY.value = (propertyValue.y / multiplier).toFixed(decimals);
|
let valueZ = propertyValue.z / multiplier;
|
||||||
if (property.elInputZ !== undefined) {
|
if (propertyData.round !== undefined) {
|
||||||
property.elInputZ.value = (propertyValue.z / multiplier).toFixed(decimals);
|
valueX = Math.round(valueX * propertyData.round) / propertyData.round;
|
||||||
|
valueY = Math.round(valueY * propertyData.round) / propertyData.round;
|
||||||
|
valueZ = Math.round(valueZ * propertyData.round) / propertyData.round;
|
||||||
|
}
|
||||||
|
if (propertyData.decimals !== undefined) {
|
||||||
|
property.elInputX.value = valueX.toFixed(propertyData.decimals);
|
||||||
|
property.elInputY.value = valueY.toFixed(propertyData.decimals);
|
||||||
|
if (property.elInputZ !== undefined) {
|
||||||
|
property.elInputZ.value = valueZ.toFixed(propertyData.decimals);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
property.elInputX.value = valueX;
|
||||||
|
property.elInputY.value = valueY;
|
||||||
|
if (property.elInputZ !== undefined) {
|
||||||
|
property.elInputZ.value = valueZ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue