mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into inline-entity-scripts
This commit is contained in:
commit
17e3f3b48d
7 changed files with 46 additions and 19 deletions
|
@ -1197,7 +1197,11 @@ PropertiesTool = function(opts) {
|
|||
|
||||
webView.eventBridge.webEventReceived.connect(function(data) {
|
||||
data = JSON.parse(data);
|
||||
if (data.type == "update") {
|
||||
if (data.type == "print") {
|
||||
if (data.message) {
|
||||
print(data.message);
|
||||
}
|
||||
} else if (data.type == "update") {
|
||||
selectionManager.saveProperties();
|
||||
if (selectionManager.selections.length > 1) {
|
||||
properties = {
|
||||
|
|
|
@ -27,6 +27,7 @@ var ANGULAR_DAMPING_RATE = 0.40;
|
|||
var SCREEN_TO_METERS = 0.001;
|
||||
var currentPosition, currentVelocity, cameraEntityDistance, currentRotation;
|
||||
var velocityTowardTarget, desiredVelocity, addedVelocity, newVelocity, dPosition, camYaw, distanceToTarget, targetPosition;
|
||||
var originalGravity;
|
||||
var shouldRotate = false;
|
||||
var dQ, theta, axisAngle, dT;
|
||||
var angularVelocity = {
|
||||
|
@ -65,6 +66,7 @@ function mousePressEvent(event) {
|
|||
grabbedEntity = intersection.entityID;
|
||||
var props = Entities.getEntityProperties(grabbedEntity)
|
||||
isGrabbing = true;
|
||||
originalGravity = props.gravity;
|
||||
targetPosition = props.position;
|
||||
currentPosition = props.position;
|
||||
currentVelocity = props.velocity;
|
||||
|
@ -96,6 +98,11 @@ function updateDropLine(position) {
|
|||
function mouseReleaseEvent() {
|
||||
if (isGrabbing) {
|
||||
isGrabbing = false;
|
||||
|
||||
Entities.editEntity(grabbedEntity, {
|
||||
gravity: originalGravity
|
||||
});
|
||||
|
||||
Overlays.editOverlay(dropLine, {
|
||||
visible: false
|
||||
});
|
||||
|
@ -194,7 +201,7 @@ function update(deltaTime) {
|
|||
newVelocity = Vec3.subtract(newVelocity, Vec3.multiply(newVelocity, DAMPING_RATE));
|
||||
// Update entity
|
||||
} else {
|
||||
newVelocity = entityProps.velocity;
|
||||
newVelocity = {x: 0, y: 0, z: 0};
|
||||
}
|
||||
if (shouldRotate) {
|
||||
angularVelocity = Vec3.subtract(angularVelocity, Vec3.multiply(angularVelocity, ANGULAR_DAMPING_RATE));
|
||||
|
@ -204,7 +211,8 @@ function update(deltaTime) {
|
|||
|
||||
Entities.editEntity(grabbedEntity, {
|
||||
velocity: newVelocity,
|
||||
angularVelocity: angularVelocity
|
||||
angularVelocity: angularVelocity,
|
||||
gravity: {x: 0, y: 0, z: 0}
|
||||
})
|
||||
updateDropLine(targetPosition);
|
||||
}
|
||||
|
@ -215,4 +223,4 @@ Controller.mousePressEvent.connect(mousePressEvent);
|
|||
Controller.mouseReleaseEvent.connect(mouseReleaseEvent);
|
||||
Controller.keyPressEvent.connect(keyPressEvent);
|
||||
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
||||
Script.update.connect(update);
|
||||
Script.update.connect(update);
|
||||
|
|
|
@ -18,6 +18,12 @@
|
|||
els[i].setAttribute('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
|
||||
function showElements(els, show) {
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
els[i].style.display = (show) ? 'block' : 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function createEmitCheckedPropertyUpdateFunction(propertyName) {
|
||||
return function() {
|
||||
|
@ -504,6 +510,8 @@
|
|||
elZoneAtmosphereScatteringWavelengthsZ.value = properties.atmosphere.scatteringWavelengths.z;
|
||||
elZoneAtmosphereHasStars.checked = properties.atmosphere.hasStars;
|
||||
|
||||
showElements(document.getElementsByClassName('skybox-section'), elZoneBackgroundMode.value == 'skybox');
|
||||
showElements(document.getElementsByClassName('atmosphere-section'), elZoneBackgroundMode.value == 'atmosphere');
|
||||
}
|
||||
|
||||
if (selected) {
|
||||
|
@ -1117,7 +1125,7 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-section property">
|
||||
<div class="zone-section skybox-section property">
|
||||
<div class="label">Skybox Color</div>
|
||||
<div class="value">
|
||||
<div class="input-area">R <input class="coord" type='number' id="property-zone-skybox-color-red"></input></div>
|
||||
|
@ -1125,13 +1133,13 @@
|
|||
<div class="input-area">B <input class="coord" type='number' id="property-zone-skybox-color-blue"></input></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-section property">
|
||||
<div class="zone-section skybox-section property">
|
||||
<div class="label">Skybox URL</div>
|
||||
<div class="value">
|
||||
<input type="text" id="property-zone-skybox-url" class="url"></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-section property">
|
||||
<div class="zone-section atmosphere-section property">
|
||||
<div class="label">Atmosphere Center</div>
|
||||
<div class="value">
|
||||
<div class="input-area">X <br><input class="coord" type='number' id="property-zone-atmosphere-center-x"></input></div>
|
||||
|
@ -1139,31 +1147,31 @@
|
|||
<div class="input-area">Z <br><input class="coord" type='number' id="property-zone-atmosphere-center-z"></input></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-section property">
|
||||
<div class="zone-section atmosphere-section property">
|
||||
<div class="label">Atmosphere Inner Radius</div>
|
||||
<div class="value">
|
||||
<input class="coord" type='number' id="property-zone-atmosphere-inner-radius" step="1"></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-section property">
|
||||
<div class="zone-section atmosphere-section property">
|
||||
<div class="label">Atmosphere Outer Radius</div>
|
||||
<div class="value">
|
||||
<input class="coord" type='number' id="property-zone-atmosphere-outer-radius" step="1"></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-section property">
|
||||
<div class="zone-section atmosphere-section property">
|
||||
<div class="label">Atmosphere Mie Scattering</div>
|
||||
<div class="value">
|
||||
<input class="coord no-spin" type='number' id="property-zone-atmosphere-mie-scattering" min="0" max="0.5" step="any"></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-section property">
|
||||
<div class="zone-section atmosphere-section property">
|
||||
<div class="label">Atmosphere Rayleigh Scattering</div>
|
||||
<div class="value">
|
||||
<input class="coord no-spin" type='number' id="property-zone-atmosphere-rayleigh-scattering" min="0" max="0.5" step="any"></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-section property">
|
||||
<div class="zone-section atmosphere-section property">
|
||||
<div class="label">Atmosphere Scattering Wavelenghts</div>
|
||||
<div class="value">
|
||||
<div class="input-area">X <br><input class="coord no-spin" type='number' id="property-zone-atmosphere-scattering-wavelengths-x" min="0" max="1" step="any"></input></div>
|
||||
|
@ -1171,7 +1179,7 @@
|
|||
<div class="input-area">Z <br><input class="coord no-spin" type='number' id="property-zone-atmosphere-scattering-wavelengths-z" min="0" max="1" step="any"></input></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-section property">
|
||||
<div class="zone-section atmosphere-section property" style="display:none">
|
||||
<span class="label">Atmosphere Has Stars</span>
|
||||
<span class="value">
|
||||
<input type='checkbox' id="property-zone-atmosphere-has-stars">
|
||||
|
|
|
@ -56,12 +56,12 @@ public:
|
|||
glm::vec4 _borderColor{ 1.0f };
|
||||
uint32 _maxAnisotropy = 16;
|
||||
|
||||
uint8 _filter = FILTER_MIN_MAG_POINT;
|
||||
uint8 _comparisonFunc = ALWAYS;
|
||||
|
||||
uint8 _wrapModeU = WRAP_REPEAT;
|
||||
uint8 _wrapModeV = WRAP_REPEAT;
|
||||
uint8 _wrapModeW = WRAP_REPEAT;
|
||||
|
||||
uint8 _filter = FILTER_MIN_MAG_POINT;
|
||||
uint8 _comparisonFunc = ALWAYS;
|
||||
|
||||
uint8 _mipOffset = 0;
|
||||
uint8 _minMip = 0;
|
||||
|
|
|
@ -241,7 +241,7 @@ float Resource::getLoadPriority() {
|
|||
}
|
||||
|
||||
void Resource::refresh() {
|
||||
if (_reply == nullptr && !(_loaded || _failedToLoad)) {
|
||||
if (_reply && !(_loaded || _failedToLoad)) {
|
||||
return;
|
||||
}
|
||||
if (_reply) {
|
||||
|
@ -351,6 +351,7 @@ void Resource::maybeRefresh() {
|
|||
QDateTime lastModifiedOld = metaData.lastModified();
|
||||
if (lastModified.isValid() && lastModifiedOld.isValid() &&
|
||||
lastModifiedOld == lastModified) {
|
||||
qCDebug(networking) << "Using cached version of" << _url.fileName();
|
||||
// We don't need to update, return
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "OctreeConstants.h"
|
||||
#include "OctreeQuery.h"
|
||||
|
||||
Setting::Handle<int> maxOctreePacketsPerSecond("maxOctreePPSSpin", DEFAULT_MAX_OCTREE_PPS);
|
||||
Setting::Handle<int> maxOctreePacketsPerSecond("maxOctreePPS", DEFAULT_MAX_OCTREE_PPS);
|
||||
|
||||
OctreeQuery::OctreeQuery() {
|
||||
_maxOctreePPS = maxOctreePacketsPerSecond.get();
|
||||
|
|
|
@ -2068,6 +2068,12 @@ void Model::segregateMeshGroups() {
|
|||
bool hasSpecular = mesh.hasSpecularTexture();
|
||||
bool hasLightmap = mesh.hasEmissiveTexture();
|
||||
bool isSkinned = state.clusterMatrices.size() > 1;
|
||||
bool wireframe = isWireframe();
|
||||
|
||||
if (wireframe) {
|
||||
translucentMesh = hasTangents = hasSpecular = hasLightmap = isSkinned = false;
|
||||
}
|
||||
|
||||
QString materialID;
|
||||
|
||||
// create a material name from all the parts. If there's one part, this will be a single material and its
|
||||
|
@ -2085,7 +2091,7 @@ void Model::segregateMeshGroups() {
|
|||
qCDebug(renderutils) << "materialID:" << materialID << "parts:" << mesh.parts.size();
|
||||
}
|
||||
|
||||
RenderKey key(translucentMesh, hasLightmap, hasTangents, hasSpecular, isSkinned, isWireframe());
|
||||
RenderKey key(translucentMesh, hasLightmap, hasTangents, hasSpecular, isSkinned, wireframe);
|
||||
|
||||
// reuse or create the bucket corresponding to that key and insert the mesh as unsorted
|
||||
_renderBuckets[key.getRaw()]._unsortedMeshes.insertMulti(materialID, i);
|
||||
|
|
Loading…
Reference in a new issue