mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 01:00:47 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into meta
This commit is contained in:
commit
0b9b5d595c
5 changed files with 35 additions and 18 deletions
|
@ -780,12 +780,12 @@ void DomainServerSettingsManager::processNodeKickRequestPacket(QSharedPointer<Re
|
||||||
|
|
||||||
// This function processes the "Get Username from ID" request.
|
// This function processes the "Get Username from ID" request.
|
||||||
void DomainServerSettingsManager::processUsernameFromIDRequestPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode) {
|
void DomainServerSettingsManager::processUsernameFromIDRequestPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode) {
|
||||||
// Before we do any processing on this packet, make sure it comes from a node that is allowed to kick (is an admin)
|
// From the packet, pull the UUID we're identifying
|
||||||
if (sendingNode->getCanKick()) {
|
QUuid nodeUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
||||||
// From the packet, pull the UUID we're identifying
|
if (!nodeUUID.isNull()) {
|
||||||
QUuid nodeUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
// Before we do any processing on this packet, make sure it comes from a node that is allowed to kick (is an admin)
|
||||||
|
// OR from a node whose UUID matches the one in the packet
|
||||||
if (!nodeUUID.isNull()) {
|
if (sendingNode->getCanKick() || nodeUUID == sendingNode->getUUID()) {
|
||||||
// First, make sure we actually have a node with this UUID
|
// First, make sure we actually have a node with this UUID
|
||||||
auto limitedNodeList = DependencyManager::get<LimitedNodeList>();
|
auto limitedNodeList = DependencyManager::get<LimitedNodeList>();
|
||||||
auto matchingNode = limitedNodeList->nodeWithUUID(nodeUUID);
|
auto matchingNode = limitedNodeList->nodeWithUUID(nodeUUID);
|
||||||
|
@ -813,12 +813,12 @@ void DomainServerSettingsManager::processUsernameFromIDRequestPacket(QSharedPoin
|
||||||
qWarning() << "Node username request received for unknown node. Refusing to process.";
|
qWarning() << "Node username request received for unknown node. Refusing to process.";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "Node username request received for invalid node ID. Refusing to process.";
|
qWarning() << "Refusing to process a username request packet from node" << uuidStringWithoutCurlyBraces(sendingNode->getUUID())
|
||||||
|
<< ". Either node doesn't have kick permissions or is requesting a username not from their UUID.";
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "Refusing to process a username request packet from node" << uuidStringWithoutCurlyBraces(sendingNode->getUUID())
|
qWarning() << "Node username request received for invalid node ID. Refusing to process.";
|
||||||
<< "that does not have kick permissions.";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -359,8 +359,11 @@ void ModelMeshPartPayload::notifyLocationChanged() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelMeshPartPayload::updateTransformForSkinnedMesh(const Transform& transform, const QVector<glm::mat4>& clusterMatrices) {
|
void ModelMeshPartPayload::updateTransformForSkinnedMesh(const Transform& transform,
|
||||||
|
const QVector<glm::mat4>& clusterMatrices,
|
||||||
|
const QVector<glm::mat4>& cauterizedClusterMatrices) {
|
||||||
_transform = transform;
|
_transform = transform;
|
||||||
|
_cauterizedTransform = transform;
|
||||||
|
|
||||||
if (clusterMatrices.size() > 0) {
|
if (clusterMatrices.size() > 0) {
|
||||||
_worldBound = AABox();
|
_worldBound = AABox();
|
||||||
|
@ -373,6 +376,11 @@ void ModelMeshPartPayload::updateTransformForSkinnedMesh(const Transform& transf
|
||||||
_worldBound.transform(transform);
|
_worldBound.transform(transform);
|
||||||
if (clusterMatrices.size() == 1) {
|
if (clusterMatrices.size() == 1) {
|
||||||
_transform = _transform.worldTransform(Transform(clusterMatrices[0]));
|
_transform = _transform.worldTransform(Transform(clusterMatrices[0]));
|
||||||
|
if (cauterizedClusterMatrices.size() != 0) {
|
||||||
|
_cauterizedTransform = _cauterizedTransform.worldTransform(Transform(cauterizedClusterMatrices[0]));
|
||||||
|
} else {
|
||||||
|
_cauterizedTransform = _transform;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -527,9 +535,14 @@ void ModelMeshPartPayload::bindTransform(gpu::Batch& batch, const ShapePipeline:
|
||||||
} else {
|
} else {
|
||||||
batch.setUniformBuffer(ShapePipeline::Slot::BUFFER::SKINNING, state.clusterBuffer);
|
batch.setUniformBuffer(ShapePipeline::Slot::BUFFER::SKINNING, state.clusterBuffer);
|
||||||
}
|
}
|
||||||
|
batch.setModelTransform(_transform);
|
||||||
|
} else {
|
||||||
|
if (canCauterize && _model->getCauterizeBones()) {
|
||||||
|
batch.setModelTransform(_cauterizedTransform);
|
||||||
|
} else {
|
||||||
|
batch.setModelTransform(_transform);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
batch.setModelTransform(_transform);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelMeshPartPayload::startFade() {
|
void ModelMeshPartPayload::startFade() {
|
||||||
|
|
|
@ -85,7 +85,9 @@ public:
|
||||||
typedef Payload::DataPointer Pointer;
|
typedef Payload::DataPointer Pointer;
|
||||||
|
|
||||||
void notifyLocationChanged() override;
|
void notifyLocationChanged() override;
|
||||||
void updateTransformForSkinnedMesh(const Transform& transform, const QVector<glm::mat4>& clusterMatrices);
|
void updateTransformForSkinnedMesh(const Transform& transform,
|
||||||
|
const QVector<glm::mat4>& clusterMatrices,
|
||||||
|
const QVector<glm::mat4>& cauterizedClusterMatrices);
|
||||||
|
|
||||||
// Entity fade in
|
// Entity fade in
|
||||||
void startFade();
|
void startFade();
|
||||||
|
@ -106,6 +108,7 @@ public:
|
||||||
|
|
||||||
Model* _model;
|
Model* _model;
|
||||||
|
|
||||||
|
Transform _cauterizedTransform;
|
||||||
int _meshIndex;
|
int _meshIndex;
|
||||||
int _shapeID;
|
int _shapeID;
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ void Model::updateRenderItems() {
|
||||||
|
|
||||||
// update the model transform and bounding box for this render item.
|
// update the model transform and bounding box for this render item.
|
||||||
const Model::MeshState& state = data._model->_meshStates.at(data._meshIndex);
|
const Model::MeshState& state = data._model->_meshStates.at(data._meshIndex);
|
||||||
data.updateTransformForSkinnedMesh(modelTransform, state.clusterMatrices);
|
data.updateTransformForSkinnedMesh(modelTransform, state.clusterMatrices, state.cauterizedClusterMatrices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -3082,7 +3082,7 @@ var handleHandMessages = function(channel, message, sender) {
|
||||||
|
|
||||||
Messages.messageReceived.connect(handleHandMessages);
|
Messages.messageReceived.connect(handleHandMessages);
|
||||||
|
|
||||||
var TARGET_UPDATE_HZ = 50; // 50hz good enough (no change in logic)
|
var TARGET_UPDATE_HZ = 60; // 50hz good enough, but we're using update
|
||||||
var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ;
|
var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ;
|
||||||
var lastInterval = Date.now();
|
var lastInterval = Date.now();
|
||||||
|
|
||||||
|
@ -3095,7 +3095,7 @@ var updateTotalWork = 0;
|
||||||
|
|
||||||
var UPDATE_PERFORMANCE_DEBUGGING = false;
|
var UPDATE_PERFORMANCE_DEBUGGING = false;
|
||||||
|
|
||||||
var updateIntervalTimer = Script.setInterval(function(){
|
function updateWrapper(){
|
||||||
|
|
||||||
intervalCount++;
|
intervalCount++;
|
||||||
var thisInterval = Date.now();
|
var thisInterval = Date.now();
|
||||||
|
@ -3141,11 +3141,12 @@ var updateIntervalTimer = Script.setInterval(function(){
|
||||||
updateTotalWork = 0;
|
updateTotalWork = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}, BASIC_TIMER_INTERVAL_MS);
|
}
|
||||||
|
|
||||||
|
Script.update.connect(updateWrapper);
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
Menu.removeMenuItem("Developer", "Show Grab Sphere");
|
Menu.removeMenuItem("Developer", "Show Grab Sphere");
|
||||||
Script.clearInterval(updateIntervalTimer);
|
Script.update.disconnect(updateWrapper);
|
||||||
rightController.cleanup();
|
rightController.cleanup();
|
||||||
leftController.cleanup();
|
leftController.cleanup();
|
||||||
Controller.disableMapping(MAPPING_NAME);
|
Controller.disableMapping(MAPPING_NAME);
|
||||||
|
|
Loading…
Reference in a new issue