mirror of
https://github.com/overte-org/overte.git
synced 2025-05-08 08:48:56 +02:00
Style Physics options sliders
This commit is contained in:
parent
33765e14fa
commit
e18e11a07b
6 changed files with 112 additions and 41 deletions
12
scripts/vr-edit/assets/tools/physics/bounce-label.svg
Normal file
12
scripts/vr-edit/assets/tools/physics/bounce-label.svg
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="233px" height="48px" viewBox="0 0 233 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 45.2 (43514) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>BOUNCE</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Physics-Tool" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Physics---Default" transform="translate(-1272.000000, -2154.000000)" fill="#FFFFFF">
|
||||
<path d="M1295.564,2176.576 C1300.556,2177.536 1305.612,2179.904 1305.612,2187.136 C1305.612,2197.056 1297.612,2200 1286.732,2200 L1272.908,2200 L1272.908,2155.712 L1285.004,2155.712 C1296.588,2155.712 1303.692,2158.848 1303.692,2167.04 C1303.692,2172.608 1299.66,2175.616 1295.564,2176.576 Z M1282.316,2162.496 L1282.316,2173.696 L1286.924,2173.696 C1291.404,2173.696 1294.092,2171.84 1294.092,2167.872 C1294.092,2163.776 1291.34,2162.496 1285.9,2162.496 L1282.316,2162.496 Z M1286.796,2193.024 C1292.044,2193.024 1295.82,2192 1295.82,2186.752 C1295.82,2181.824 1292.364,2180.096 1287.628,2180.096 L1282.316,2180.096 L1282.316,2193.024 L1286.796,2193.024 Z M1329.74,2154.688 C1341.9,2154.688 1349.388,2163.008 1349.388,2177.856 C1349.388,2192.384 1341.9,2201.024 1329.74,2201.024 C1317.58,2201.024 1310.028,2192.64 1310.028,2177.856 C1310.028,2163.392 1317.58,2154.688 1329.74,2154.688 Z M1329.74,2161.728 C1323.468,2161.728 1319.948,2166.272 1319.948,2177.856 C1319.948,2189.44 1323.596,2193.984 1329.74,2193.984 C1336.076,2193.984 1339.468,2189.44 1339.468,2177.856 C1339.468,2166.272 1336.076,2161.728 1329.74,2161.728 Z M1389.58,2185.408 L1389.58,2155.712 L1380.172,2155.712 L1380.172,2184.96 C1380.172,2190.912 1377.868,2193.856 1372.684,2193.856 C1367.564,2193.856 1365.26,2190.912 1365.26,2184.96 L1365.26,2155.712 L1355.852,2155.712 L1355.852,2185.408 C1355.852,2194.624 1361.484,2201.024 1372.684,2201.024 C1383.884,2201.024 1389.58,2194.304 1389.58,2185.408 Z M1431.756,2200 L1431.756,2155.712 L1423.244,2155.712 L1423.244,2175.168 C1423.244,2181.76 1424.076,2187.904 1424.524,2190.912 L1410.188,2155.712 L1398.348,2155.712 L1398.348,2200 L1406.86,2200 L1406.86,2182.784 C1406.86,2174.592 1406.092,2168.832 1405.58,2164.864 L1419.66,2200 L1431.756,2200 Z M1458.444,2154.688 C1447.372,2154.688 1438.86,2162.88 1438.86,2177.792 C1438.86,2192.896 1446.924,2201.024 1458.7,2201.024 C1464.844,2201.024 1469.516,2198.336 1472.332,2195.456 L1467.98,2189.888 C1465.42,2191.872 1462.86,2193.6 1459.148,2193.6 C1453.068,2193.6 1448.78,2188.928 1448.78,2177.792 C1448.78,2166.272 1453.132,2161.792 1459.02,2161.792 C1462.092,2161.792 1464.652,2162.88 1467.084,2164.992 L1471.82,2159.488 C1468.172,2156.416 1464.332,2154.688 1458.444,2154.688 Z M1503.052,2162.56 L1504.076,2155.712 L1477.644,2155.712 L1477.644,2200 L1504.204,2200 L1504.204,2193.088 L1487.052,2193.088 L1487.052,2180.864 L1501.004,2180.864 L1501.004,2174.08 L1487.052,2174.08 L1487.052,2162.56 L1503.052,2162.56 Z" id="BOUNCE"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3 KiB |
12
scripts/vr-edit/assets/tools/physics/density-label.svg
Normal file
12
scripts/vr-edit/assets/tools/physics/density-label.svg
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="241px" height="48px" viewBox="0 0 241 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 45.2 (43514) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>DENSITY</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Physics-Tool" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Physics---Default" transform="translate(-2016.000000, -2154.000000)" fill="#FFFFFF">
|
||||
<path d="M2028.452,2155.712 C2040.164,2155.712 2051.3,2159.36 2051.3,2177.664 C2051.3,2195.52 2040.42,2200 2029.54,2200 L2016.868,2200 L2016.868,2155.712 L2028.452,2155.712 Z M2026.276,2162.624 L2026.276,2193.088 L2030.116,2193.088 C2036.58,2193.088 2041.508,2190.08 2041.508,2177.664 C2041.508,2164.992 2036.324,2162.624 2029.924,2162.624 L2026.276,2162.624 Z M2083.876,2162.56 L2084.9,2155.712 L2058.468,2155.712 L2058.468,2200 L2085.028,2200 L2085.028,2193.088 L2067.876,2193.088 L2067.876,2180.864 L2081.828,2180.864 L2081.828,2174.08 L2067.876,2174.08 L2067.876,2162.56 L2083.876,2162.56 Z M2125.668,2200 L2125.668,2155.712 L2117.156,2155.712 L2117.156,2175.168 C2117.156,2181.76 2117.988,2187.904 2118.436,2190.912 L2104.1,2155.712 L2092.26,2155.712 L2092.26,2200 L2100.772,2200 L2100.772,2182.784 C2100.772,2174.592 2100.004,2168.832 2099.492,2164.864 L2113.572,2200 L2125.668,2200 Z M2148.516,2154.688 C2139.556,2154.688 2133.028,2159.616 2133.028,2167.168 C2133.028,2173.888 2136.868,2177.728 2146.468,2180.736 C2153.188,2182.784 2154.916,2184.32 2154.916,2187.84 C2154.916,2191.744 2151.844,2193.92 2147.3,2193.92 C2142.756,2193.92 2139.172,2192.256 2136.1,2189.44 L2131.172,2194.816 C2134.82,2198.4 2140.196,2201.024 2147.556,2201.024 C2158.308,2201.024 2164.708,2195.328 2164.708,2187.2 C2164.708,2179.008 2159.588,2175.68 2151.588,2173.12 C2144.356,2170.88 2142.692,2169.6 2142.692,2166.528 C2142.692,2163.392 2145.316,2161.728 2149.156,2161.728 C2152.74,2161.728 2155.812,2162.88 2158.884,2165.504 L2163.428,2160.256 C2159.588,2156.672 2155.108,2154.688 2148.516,2154.688 Z M2180.644,2200 L2180.644,2155.712 L2171.172,2155.712 L2171.172,2200 L2180.644,2200 Z M2218.34,2163.072 L2207.14,2163.072 L2207.14,2200 L2197.732,2200 L2197.732,2163.072 L2185.956,2163.072 L2185.956,2155.712 L2219.364,2155.712 L2218.34,2163.072 Z M2242.852,2183.296 L2242.852,2200 L2233.444,2200 L2233.444,2183.36 L2219.236,2155.712 L2229.54,2155.712 L2238.372,2175.808 L2247.14,2155.712 L2257.06,2155.712 L2242.852,2183.296 Z" id="DENSITY"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
12
scripts/vr-edit/assets/tools/physics/friction-label.svg
Normal file
12
scripts/vr-edit/assets/tools/physics/friction-label.svg
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="258px" height="48px" viewBox="0 0 258 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 45.2 (43514) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>FRICTION</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Physics-Tool" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Physics---Default" transform="translate(-1632.000000, -2154.000000)" fill="#FFFFFF">
|
||||
<path d="M1657.448,2162.56 L1658.472,2155.712 L1632.744,2155.712 L1632.744,2200 L1642.152,2200 L1642.152,2181.952 L1655.464,2181.952 L1655.464,2175.104 L1642.152,2175.104 L1642.152,2162.56 L1657.448,2162.56 Z M1678.184,2182.656 L1673.384,2182.656 L1673.384,2200 L1663.976,2200 L1663.976,2155.712 L1677.8,2155.712 C1689.64,2155.712 1695.656,2160 1695.656,2168.96 C1695.656,2174.848 1692.776,2178.368 1686.888,2180.928 L1698.344,2200 L1687.656,2200 L1678.184,2182.656 Z M1673.384,2176 L1678.312,2176 C1683.24,2176 1685.928,2173.952 1685.928,2168.96 C1685.928,2164.416 1683.304,2162.432 1677.608,2162.432 L1673.384,2162.432 L1673.384,2176 Z M1712.744,2200 L1712.744,2155.712 L1703.272,2155.712 L1703.272,2200 L1712.744,2200 Z M1739.432,2154.688 C1728.36,2154.688 1719.848,2162.88 1719.848,2177.792 C1719.848,2192.896 1727.912,2201.024 1739.688,2201.024 C1745.832,2201.024 1750.504,2198.336 1753.32,2195.456 L1748.968,2189.888 C1746.408,2191.872 1743.848,2193.6 1740.136,2193.6 C1734.056,2193.6 1729.768,2188.928 1729.768,2177.792 C1729.768,2166.272 1734.12,2161.792 1740.008,2161.792 C1743.08,2161.792 1745.64,2162.88 1748.072,2164.992 L1752.808,2159.488 C1749.16,2156.416 1745.32,2154.688 1739.432,2154.688 Z M1786.984,2163.072 L1788.008,2155.712 L1754.6,2155.712 L1754.6,2163.072 L1766.376,2163.072 L1766.376,2200 L1775.784,2200 L1775.784,2163.072 L1786.984,2163.072 Z M1802.28,2200 L1802.28,2155.712 L1792.808,2155.712 L1792.808,2200 L1802.28,2200 Z M1829.096,2154.688 C1841.256,2154.688 1848.744,2163.008 1848.744,2177.856 C1848.744,2192.384 1841.256,2201.024 1829.096,2201.024 C1816.936,2201.024 1809.384,2192.64 1809.384,2177.856 C1809.384,2163.392 1816.936,2154.688 1829.096,2154.688 Z M1829.096,2161.728 C1822.824,2161.728 1819.304,2166.272 1819.304,2177.856 C1819.304,2189.44 1822.952,2193.984 1829.096,2193.984 C1835.432,2193.984 1838.824,2189.44 1838.824,2177.856 C1838.824,2166.272 1835.432,2161.728 1829.096,2161.728 Z M1889.256,2200 L1889.256,2155.712 L1880.744,2155.712 L1880.744,2175.168 C1880.744,2181.76 1881.576,2187.904 1882.024,2190.912 L1867.688,2155.712 L1855.848,2155.712 L1855.848,2200 L1864.36,2200 L1864.36,2182.784 C1864.36,2174.592 1863.592,2168.832 1863.08,2164.864 L1877.16,2200 L1889.256,2200 Z" id="FRICTION"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.8 KiB |
12
scripts/vr-edit/assets/tools/physics/gravity-label.svg
Normal file
12
scripts/vr-edit/assets/tools/physics/gravity-label.svg
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="240px" height="48px" viewBox="0 0 240 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 45.2 (43514) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>GRAVITY</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Physics-Tool" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Physics---Default" transform="translate(-894.000000, -2154.000000)" fill="#FFFFFF">
|
||||
<path d="M915.336,2154.688 C904.008,2154.688 894.664,2162.816 894.664,2177.792 C894.664,2193.024 901.512,2201.024 914.312,2201.024 C920.264,2201.024 925.704,2199.296 930.12,2196.544 L930.12,2174.72 L913.8,2174.72 L914.76,2181.568 L920.968,2181.568 L920.968,2192.384 C918.984,2193.472 916.744,2193.984 914.376,2193.984 C907.848,2193.984 904.52,2189.696 904.52,2177.856 C904.52,2166.336 909.512,2161.664 915.784,2161.664 C919.432,2161.664 921.928,2162.816 924.808,2165.184 L929.864,2160 C926.152,2156.8 921.672,2154.688 915.336,2154.688 Z M952.136,2182.656 L947.336,2182.656 L947.336,2200 L937.928,2200 L937.928,2155.712 L951.752,2155.712 C963.592,2155.712 969.608,2160 969.608,2168.96 C969.608,2174.848 966.728,2178.368 960.84,2180.928 L972.296,2200 L961.608,2200 L952.136,2182.656 Z M947.336,2176 L952.264,2176 C957.192,2176 959.88,2173.952 959.88,2168.96 C959.88,2164.416 957.256,2162.432 951.56,2162.432 L947.336,2162.432 L947.336,2176 Z M998.152,2190.08 L984.264,2190.08 L981.768,2200 L971.976,2200 L985.608,2155.712 L997.064,2155.712 L1010.632,2200 L1000.648,2200 L998.152,2190.08 Z M996.36,2183.104 L991.176,2162.688 L986.056,2183.104 L996.36,2183.104 Z M1031.24,2200 L1019.784,2200 L1006.6,2155.712 L1016.648,2155.712 L1025.672,2192.192 L1034.376,2155.712 L1043.976,2155.712 L1031.24,2200 Z M1057.608,2200 L1057.608,2155.712 L1048.136,2155.712 L1048.136,2200 L1057.608,2200 Z M1095.304,2163.072 L1084.104,2163.072 L1084.104,2200 L1074.696,2200 L1074.696,2163.072 L1062.92,2163.072 L1062.92,2155.712 L1096.328,2155.712 L1095.304,2163.072 Z M1119.816,2183.296 L1119.816,2200 L1110.408,2200 L1110.408,2183.36 L1096.2,2155.712 L1106.504,2155.712 L1115.336,2175.808 L1124.104,2155.712 L1134.024,2155.712 L1119.816,2183.296 Z" id="GRAVITY"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
|
@ -436,11 +436,14 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
properties: {
|
||||
dimensions: { x: 0.02, y: 0.1, z: 0.01 },
|
||||
localRotation: Quat.ZERO,
|
||||
color: { red: 128, green: 128, blue: 128 },
|
||||
alpha: 0.0,
|
||||
alpha: 0.0, // Invisible.
|
||||
solid: true,
|
||||
ignoreRayIntersection: false,
|
||||
visible: true
|
||||
visible: true // Catch laser intersections.
|
||||
},
|
||||
newLabel: { // TODO: Rename to "label".
|
||||
// Relative to barSlider.
|
||||
color: UIT.colors.white
|
||||
}
|
||||
},
|
||||
"barSliderValue": {
|
||||
|
@ -449,7 +452,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
dimensions: { x: 0.02, y: 0.03, z: 0.01 },
|
||||
localPosition: { x: 0, y: 0.035, z: 0 },
|
||||
localRotation: Quat.ZERO,
|
||||
color: UI_HIGHLIGHT_COLOR,
|
||||
color: UIT.colors.greenHighlight,
|
||||
alpha: 1.0,
|
||||
solid: true,
|
||||
ignoreRayIntersection: true,
|
||||
|
@ -462,7 +465,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
dimensions: { x: 0.02, y: 0.07, z: 0.01 },
|
||||
localPosition: { x: 0, y: -0.015, z: 0 },
|
||||
localRotation: Quat.ZERO,
|
||||
color: UI_BASE_COLOR,
|
||||
color: UIT.colors.baseGrayShadow,
|
||||
alpha: 1.0,
|
||||
solid: true,
|
||||
ignoreRayIntersection: true,
|
||||
|
@ -566,17 +569,17 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
|
||||
PHYSICS_SLIDER_PRESETS = {
|
||||
// Slider values in the range 0.0 to 1.0.
|
||||
// Note: Damping values give the desired linear and angular damping values but friction values are a somewhat out,
|
||||
// Note: Friction values give the desired linear and angular damping values but friction values are a somewhat out,
|
||||
// especially for the balloon.
|
||||
presetDefault: { gravity: 0.5, bounce: 0.5, damping: 0.5, density: 0.5 },
|
||||
presetLead: { gravity: 0.5, bounce: 0.0, damping: 0.5, density: 1.0 },
|
||||
presetWood: { gravity: 0.5, bounce: 0.4, damping: 0.5, density: 0.5 },
|
||||
presetIce: { gravity: 0.5, bounce: 0.99, damping: 0.151004, density: 0.349485 },
|
||||
presetRubber: { gravity: 0.5, bounce: 0.99, damping: 0.5, density: 0.5 },
|
||||
presetCotton: { gravity: 0.587303, bounce: 0.0, damping: 0.931878, density: 0.0 },
|
||||
presetTumbleweed: { gravity: 0.595893, bounce: 0.7, damping: 0.5, density: 0.0 },
|
||||
presetZeroG: { gravity: 0.596844, bounce: 0.5, damping: 0.5, density: 0.5 },
|
||||
presetBalloon: { gravity: 0.606313, bounce: 0.99, damping: 0.151004, density: 0.0 }
|
||||
presetDefault: { gravity: 0.5, bounce: 0.5, friction: 0.5, density: 0.5 },
|
||||
presetLead: { gravity: 0.5, bounce: 0.0, friction: 0.5, density: 1.0 },
|
||||
presetWood: { gravity: 0.5, bounce: 0.4, friction: 0.5, density: 0.5 },
|
||||
presetIce: { gravity: 0.5, bounce: 0.99, friction: 0.151004, density: 0.349485 },
|
||||
presetRubber: { gravity: 0.5, bounce: 0.99, friction: 0.5, density: 0.5 },
|
||||
presetCotton: { gravity: 0.587303, bounce: 0.0, friction: 0.931878, density: 0.0 },
|
||||
presetTumbleweed: { gravity: 0.595893, bounce: 0.7, friction: 0.5, density: 0.0 },
|
||||
presetZeroG: { gravity: 0.596844, bounce: 0.5, friction: 0.5, density: 0.5 },
|
||||
presetBalloon: { gravity: 0.606313, bounce: 0.99, friction: 0.151004, density: 0.0 }
|
||||
},
|
||||
|
||||
OPTONS_PANELS = {
|
||||
|
@ -1039,7 +1042,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
type: "toggleButton",
|
||||
properties: {
|
||||
dimensions: { x: 0.0668, y: 0.0280, z: UIT.dimensions.buttonDimensions.z },
|
||||
localPosition: { x: -0.0748, y: 0.0480, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 },
|
||||
localPosition: { x: -0.0748, y: 0.0480, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
|
||||
},
|
||||
label: "GRAVITY",
|
||||
setting: {
|
||||
|
@ -1056,7 +1059,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
type: "toggleButton",
|
||||
properties: {
|
||||
dimensions: { x: 0.0668, y: 0.0280, z: UIT.dimensions.buttonDimensions.z },
|
||||
localPosition: { x: -0.0748, y: 0.0120, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 },
|
||||
localPosition: { x: -0.0748, y: 0.0120, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
|
||||
},
|
||||
label: " GRAB",
|
||||
setting: {
|
||||
|
@ -1073,7 +1076,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
type: "toggleButton",
|
||||
properties: {
|
||||
dimensions: { x: 0.0668, y: 0.0280, z: UIT.dimensions.buttonDimensions.z },
|
||||
localPosition: { x: -0.0748, y: -0.0240, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 },
|
||||
localPosition: { x: -0.0748, y: -0.0240, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
|
||||
},
|
||||
label: "COLLIDE",
|
||||
setting: {
|
||||
|
@ -1204,6 +1207,11 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
dimensions: { x: 0.0294, y: 0.1000, z: UIT.dimensions.buttonDimensions.z },
|
||||
localPosition: { x: -0.0187, y: -0.0240, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
|
||||
},
|
||||
newLabel: {
|
||||
localPosition: { x: 0, y: -0.04375, z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset },
|
||||
url: "../assets/tools/physics/gravity-label.svg",
|
||||
scale: 0.0240
|
||||
},
|
||||
setting: {
|
||||
key: "VREdit.physicsTool.gravity",
|
||||
defaultValue: 0.5,
|
||||
|
@ -1219,7 +1227,12 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
properties: {
|
||||
dimensions: { x: 0.0294, y: 0.1000, z: UIT.dimensions.buttonDimensions.z },
|
||||
localPosition: { x: 0.0187, y: -0.0240, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
|
||||
},
|
||||
},
|
||||
newLabel: {
|
||||
localPosition: { x: 0, y: -0.04375, z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset },
|
||||
url: "../assets/tools/physics/bounce-label.svg",
|
||||
scale: 0.0233
|
||||
},
|
||||
setting: {
|
||||
key: "VREdit.physicsTool.bounce",
|
||||
defaultValue: 0.5,
|
||||
|
@ -1230,19 +1243,24 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
}
|
||||
},
|
||||
{
|
||||
id: "dampingSlider",
|
||||
id: "frictionSlider",
|
||||
type: "barSlider",
|
||||
properties: {
|
||||
dimensions: { x: 0.0294, y: 0.1000, z: UIT.dimensions.buttonDimensions.z },
|
||||
localPosition: { x: 0.0561, y: -0.0240, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
|
||||
},
|
||||
newLabel: {
|
||||
localPosition: { x: 0, y: -0.04375, z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset },
|
||||
url: "../assets/tools/physics/friction-label.svg",
|
||||
scale: 0.0258
|
||||
},
|
||||
setting: {
|
||||
key: "VREdit.physicsTool.damping",
|
||||
key: "VREdit.physicsTool.friction",
|
||||
defaultValue: 0.5,
|
||||
callback: "setDamping"
|
||||
callback: "setFriction"
|
||||
},
|
||||
command: {
|
||||
method: "setDamping"
|
||||
method: "setFriction"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1252,6 +1270,11 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
dimensions: { x: 0.0294, y: 0.1000, z: UIT.dimensions.buttonDimensions.z },
|
||||
localPosition: { x: 0.0935, y: -0.0240, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
|
||||
},
|
||||
newLabel: {
|
||||
localPosition: { x: 0, y: -0.04375, z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset },
|
||||
url: "../assets/tools/physics/density-label.svg",
|
||||
scale: 0.0241
|
||||
},
|
||||
setting: {
|
||||
key: "VREdit.physicsTool.density",
|
||||
defaultValue: 0.5,
|
||||
|
@ -1835,20 +1858,20 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
optionsOverlays.push(Overlays.addOverlay(UI_ELEMENTS[optionsItems[i].type].overlay, properties));
|
||||
optionsOverlaysIDs.push(optionsItems[i].id);
|
||||
if (optionsItems[i].label) {
|
||||
properties = Object.clone(UI_ELEMENTS.label.properties);
|
||||
properties.text = optionsItems[i].label;
|
||||
properties.parentID = optionsOverlays[optionsOverlays.length - 1];
|
||||
properties.visible = optionsItems[i].type !== "picklistItem";
|
||||
id = Overlays.addOverlay(UI_ELEMENTS.label.overlay, properties);
|
||||
childProperties = Object.clone(UI_ELEMENTS.label.properties);
|
||||
childProperties.text = optionsItems[i].label;
|
||||
childProperties.parentID = optionsOverlays[optionsOverlays.length - 1];
|
||||
childProperties.visible = optionsItems[i].type !== "picklistItem";
|
||||
id = Overlays.addOverlay(UI_ELEMENTS.label.overlay, childProperties);
|
||||
optionsOverlaysLabels[i] = id;
|
||||
}
|
||||
if (optionsItems[i].newLabel) {
|
||||
properties = Object.clone(UI_ELEMENTS.image.properties);
|
||||
properties = Object.merge(properties, UI_ELEMENTS[optionsItems[i].type].newLabel);
|
||||
properties = Object.merge(properties, optionsItems[i].newLabel);
|
||||
properties.url = Script.resolvePath(properties.url);
|
||||
properties.parentID = optionsOverlays[optionsOverlays.length - 1];
|
||||
id = Overlays.addOverlay(UI_ELEMENTS.image.overlay, properties);
|
||||
childProperties = Object.clone(UI_ELEMENTS.image.properties);
|
||||
childProperties = Object.merge(childProperties, UI_ELEMENTS[optionsItems[i].type].newLabel);
|
||||
childProperties = Object.merge(childProperties, optionsItems[i].newLabel);
|
||||
childProperties.url = Script.resolvePath(childProperties.url);
|
||||
childProperties.parentID = optionsOverlays[optionsOverlays.length - 1];
|
||||
id = Overlays.addOverlay(UI_ELEMENTS.image.overlay, childProperties);
|
||||
optionsOverlaysLabels[i] = id;
|
||||
}
|
||||
|
||||
|
@ -2355,9 +2378,9 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
setBarSliderValue(optionsOverlaysIDs.indexOf("bounceSlider"), values.bounce);
|
||||
Settings.setValue(optionsSettings.bounceSlider.key, values.bounce);
|
||||
uiCommandCallback("setBounce", values.bounce);
|
||||
setBarSliderValue(optionsOverlaysIDs.indexOf("dampingSlider"), values.damping);
|
||||
Settings.setValue(optionsSettings.dampingSlider.key, values.damping);
|
||||
uiCommandCallback("setDamping", values.damping);
|
||||
setBarSliderValue(optionsOverlaysIDs.indexOf("frictionSlider"), values.friction);
|
||||
Settings.setValue(optionsSettings.frictionSlider.key, values.friction);
|
||||
uiCommandCallback("setFriction", values.friction);
|
||||
setBarSliderValue(optionsOverlaysIDs.indexOf("densitySlider"), values.density);
|
||||
Settings.setValue(optionsSettings.densitySlider.key, values.density);
|
||||
uiCommandCallback("setDensity", values.density);
|
||||
|
@ -2374,10 +2397,10 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
Settings.setValue(optionsSettings.bounceSlider.key, parameter);
|
||||
uiCommandCallback("setBounce", parameter);
|
||||
break;
|
||||
case "setDamping":
|
||||
case "setFriction":
|
||||
setPresetsLabelToCustom();
|
||||
Settings.setValue(optionsSettings.dampingSlider.key, parameter);
|
||||
uiCommandCallback("setDamping", parameter);
|
||||
Settings.setValue(optionsSettings.frictionSlider.key, parameter);
|
||||
uiCommandCallback("setFriction", parameter);
|
||||
break;
|
||||
case "setDensity":
|
||||
setPresetsLabelToCustom();
|
||||
|
|
|
@ -1433,7 +1433,7 @@
|
|||
physicsToolPhysics.restitution = parameter;
|
||||
}
|
||||
break;
|
||||
case "setDamping":
|
||||
case "setFriction":
|
||||
if (parameter !== undefined) {
|
||||
// Power range 0.0, 0.5, 1.0 maps to 0, 0.39, 1.0.
|
||||
physicsToolPhysics.damping = 0.69136364 * Math.pow(2.446416831, parameter) - 0.691364;
|
||||
|
|
Loading…
Reference in a new issue