mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge branch 'master' of https://github.com/highfidelity/hifi into sysTray
This commit is contained in:
commit
6f4c376d9f
9 changed files with 100 additions and 40 deletions
|
@ -48,35 +48,11 @@ Item {
|
|||
spacing: 4; x: 4; y: 4;
|
||||
|
||||
StatText {
|
||||
text: "State Machines:---------------------------------------------------------------------------"
|
||||
text: root.positionText
|
||||
}
|
||||
ListView {
|
||||
width: firstCol.width
|
||||
height: root.animStateMachines.length * 15
|
||||
visible: root.animStateMchines.length > 0;
|
||||
model: root.animStateMachines
|
||||
delegate: StatText {
|
||||
text: {
|
||||
return modelData;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: secondCol.width + 8
|
||||
height: secondCol.height + 8
|
||||
color: root.bgColor;
|
||||
|
||||
Column {
|
||||
id: secondCol
|
||||
spacing: 4; x: 4; y: 4;
|
||||
|
||||
StatText {
|
||||
text: "Anim Vars:--------------------------------------------------------------------------------"
|
||||
}
|
||||
|
||||
ListView {
|
||||
width: secondCol.width
|
||||
height: root.animVars.length * 15
|
||||
|
@ -104,6 +80,36 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: secondCol.width + 8
|
||||
height: secondCol.height + 8
|
||||
color: root.bgColor;
|
||||
|
||||
Column {
|
||||
id: secondCol
|
||||
spacing: 4; x: 4; y: 4;
|
||||
|
||||
StatText {
|
||||
text: root.rotationText
|
||||
}
|
||||
StatText {
|
||||
text: "State Machines:---------------------------------------------------------------------------"
|
||||
}
|
||||
ListView {
|
||||
width: firstCol.width
|
||||
height: root.animStateMachines.length * 15
|
||||
visible: root.animStateMachines.length > 0;
|
||||
model: root.animStateMachines
|
||||
delegate: StatText {
|
||||
text: {
|
||||
return modelData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: thirdCol.width + 8
|
||||
height: thirdCol.height + 8
|
||||
|
@ -113,10 +119,12 @@ Item {
|
|||
id: thirdCol
|
||||
spacing: 4; x: 4; y: 4;
|
||||
|
||||
StatText {
|
||||
text: root.velocityText
|
||||
}
|
||||
StatText {
|
||||
text: "Alpha Values:--------------------------------------------------------------------------"
|
||||
}
|
||||
|
||||
ListView {
|
||||
width: thirdCol.width
|
||||
height: root.animAlphaValues.length * 15
|
||||
|
|
|
@ -42,6 +42,29 @@ void AnimStats::updateStats(bool force) {
|
|||
auto myAvatar = avatarManager->getMyAvatar();
|
||||
auto debugAlphaMap = myAvatar->getSkeletonModel()->getRig().getDebugAlphaMap();
|
||||
|
||||
glm::vec3 position = myAvatar->getWorldPosition();
|
||||
glm::quat rotation = myAvatar->getWorldOrientation();
|
||||
glm::vec3 velocity = myAvatar->getWorldVelocity();
|
||||
|
||||
_positionText = QString("Position: (%1, %2, %3)").
|
||||
arg(QString::number(position.x, 'f', 2)).
|
||||
arg(QString::number(position.y, 'f', 2)).
|
||||
arg(QString::number(position.z, 'f', 2));
|
||||
emit positionTextChanged();
|
||||
|
||||
glm::vec3 eulerRotation = safeEulerAngles(rotation);
|
||||
_rotationText = QString("Heading: %1").
|
||||
arg(QString::number(glm::degrees(eulerRotation.y), 'f', 2));
|
||||
emit rotationTextChanged();
|
||||
|
||||
// transform velocity into rig coordinate frame. z forward.
|
||||
glm::vec3 localVelocity = Quaternions::Y_180 * glm::inverse(rotation) * velocity;
|
||||
_velocityText = QString("Local Vel: (%1, %2, %3)").
|
||||
arg(QString::number(localVelocity.x, 'f', 2)).
|
||||
arg(QString::number(localVelocity.y, 'f', 2)).
|
||||
arg(QString::number(localVelocity.z, 'f', 2));
|
||||
emit velocityTextChanged();
|
||||
|
||||
// update animation debug alpha values
|
||||
QStringList newAnimAlphaValues;
|
||||
qint64 now = usecTimestampNow();
|
||||
|
|
|
@ -19,6 +19,9 @@ class AnimStats : public QQuickItem {
|
|||
Q_PROPERTY(QStringList animAlphaValues READ animAlphaValues NOTIFY animAlphaValuesChanged)
|
||||
Q_PROPERTY(QStringList animVars READ animVars NOTIFY animVarsChanged)
|
||||
Q_PROPERTY(QStringList animStateMachines READ animStateMachines NOTIFY animStateMachinesChanged)
|
||||
Q_PROPERTY(QString positionText READ positionText NOTIFY positionTextChanged)
|
||||
Q_PROPERTY(QString rotationText READ rotationText NOTIFY rotationTextChanged)
|
||||
Q_PROPERTY(QString velocityText READ velocityText NOTIFY velocityTextChanged)
|
||||
|
||||
public:
|
||||
static AnimStats* getInstance();
|
||||
|
@ -27,9 +30,13 @@ public:
|
|||
|
||||
void updateStats(bool force = false);
|
||||
|
||||
QStringList animAlphaValues() { return _animAlphaValues; }
|
||||
QStringList animVars() { return _animVarsList; }
|
||||
QStringList animStateMachines() { return _animStateMachines; }
|
||||
QStringList animAlphaValues() const { return _animAlphaValues; }
|
||||
QStringList animVars() const { return _animVarsList; }
|
||||
QStringList animStateMachines() const { return _animStateMachines; }
|
||||
|
||||
QString positionText() const { return _positionText; }
|
||||
QString rotationText() const { return _rotationText; }
|
||||
QString velocityText() const { return _velocityText; }
|
||||
|
||||
public slots:
|
||||
void forceUpdateStats() { updateStats(true); }
|
||||
|
@ -39,6 +46,9 @@ signals:
|
|||
void animAlphaValuesChanged();
|
||||
void animVarsChanged();
|
||||
void animStateMachinesChanged();
|
||||
void positionTextChanged();
|
||||
void rotationTextChanged();
|
||||
void velocityTextChanged();
|
||||
|
||||
private:
|
||||
QStringList _animAlphaValues;
|
||||
|
@ -50,6 +60,10 @@ private:
|
|||
std::map<QString, qint64> _animVarChangedTimers; // last time animVar value has changed.
|
||||
|
||||
QStringList _animStateMachines;
|
||||
|
||||
QString _positionText;
|
||||
QString _rotationText;
|
||||
QString _velocityText;
|
||||
};
|
||||
|
||||
#endif // hifi_AnimStats_h
|
||||
|
|
|
@ -88,6 +88,10 @@ const AnimPoseVec& AnimStateMachine::evaluate(const AnimVariantMap& animVars, co
|
|||
processOutputJoints(triggersOut);
|
||||
|
||||
context.addStateMachineInfo(_id, _currentState->getID(), _previousState->getID(), _duringInterp, _alpha);
|
||||
if (_duringInterp) {
|
||||
// hack: add previoius state to debug alpha map, with parens around it's name.
|
||||
context.setDebugAlpha(QString("(%1)").arg(_previousState->getID()), 1.0f - _alpha, AnimNodeType::Clip);
|
||||
}
|
||||
|
||||
return _poses;
|
||||
}
|
||||
|
|
|
@ -140,14 +140,19 @@ std::map<QString, QString> AnimVariantMap::toDebugMap() const {
|
|||
result[pair.first] = QString::number(pair.second.getFloat(), 'f', 3);
|
||||
break;
|
||||
case AnimVariant::Type::Vec3: {
|
||||
// To prevent filling up debug stats, don't show vec3 values
|
||||
/*
|
||||
glm::vec3 value = pair.second.getVec3();
|
||||
result[pair.first] = QString("(%1, %2, %3)").
|
||||
arg(QString::number(value.x, 'f', 3)).
|
||||
arg(QString::number(value.y, 'f', 3)).
|
||||
arg(QString::number(value.z, 'f', 3));
|
||||
*/
|
||||
break;
|
||||
}
|
||||
case AnimVariant::Type::Quat: {
|
||||
// To prevent filling up the anim stats, don't show quat values
|
||||
/*
|
||||
glm::quat value = pair.second.getQuat();
|
||||
result[pair.first] = QString("(%1, %2, %3, %4)").
|
||||
arg(QString::number(value.x, 'f', 3)).
|
||||
|
@ -155,10 +160,14 @@ std::map<QString, QString> AnimVariantMap::toDebugMap() const {
|
|||
arg(QString::number(value.z, 'f', 3)).
|
||||
arg(QString::number(value.w, 'f', 3));
|
||||
break;
|
||||
*/
|
||||
}
|
||||
case AnimVariant::Type::String:
|
||||
// To prevent filling up anim stats, don't show string values
|
||||
/*
|
||||
result[pair.first] = pair.second.getString();
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
assert(("invalid AnimVariant::Type", false));
|
||||
}
|
||||
|
|
|
@ -1553,14 +1553,13 @@ void Model::setBlendedVertices(int blendNumber, const QVector<glm::vec3>& vertic
|
|||
for (int i = 0; i < fbxGeometry.meshes.size(); i++) {
|
||||
const FBXMesh& mesh = fbxGeometry.meshes.at(i);
|
||||
auto meshNormalsAndTangents = _normalsAndTangents.find(i);
|
||||
if (mesh.blendshapes.isEmpty() || meshNormalsAndTangents == _normalsAndTangents.end()) {
|
||||
const auto& buffer = _blendedVertexBuffers.find(i);
|
||||
if (mesh.blendshapes.isEmpty() || meshNormalsAndTangents == _normalsAndTangents.end() || buffer == _blendedVertexBuffers.end()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto vertexCount = mesh.vertices.size();
|
||||
const auto verticesSize = vertexCount * sizeof(glm::vec3);
|
||||
const auto& buffer = _blendedVertexBuffers.find(i);
|
||||
assert(buffer != _blendedVertexBuffers.end());
|
||||
buffer->second->resize(mesh.vertices.size() * sizeof(glm::vec3) + meshNormalsAndTangents->second.size() * sizeof(NormalType));
|
||||
buffer->second->setSubData(0, verticesSize, (gpu::Byte*) vertices.constData() + index * sizeof(glm::vec3));
|
||||
buffer->second->setSubData(verticesSize, meshNormalsAndTangents->second.size() * sizeof(NormalType), (const gpu::Byte*) normalsAndTangents.data() + normalAndTangentIndex * sizeof(NormalType));
|
||||
|
|
|
@ -2134,9 +2134,7 @@ var PropertiesTool = function (opts) {
|
|||
var onWebEventReceived = function(data) {
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
catch(e) {
|
||||
print('Edit.js received web event that was not valid json.');
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
var i, properties, dY, diff, newPosition;
|
||||
|
|
|
@ -164,7 +164,10 @@ function loaded() {
|
|||
|
||||
selectedEntities.forEach(function(entityID) {
|
||||
if (selection.indexOf(entityID) === -1) {
|
||||
entitiesByID[entityID].el.className = '';
|
||||
let entity = entitiesByID[entityID];
|
||||
if (entity !== undefined) {
|
||||
entity.el.className = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -388,15 +391,18 @@ function loaded() {
|
|||
let notFound = false;
|
||||
|
||||
selectedEntities.forEach(function(id) {
|
||||
entitiesByID[id].el.className = '';
|
||||
let entity = entitiesByID[id];
|
||||
if (entity !== undefined) {
|
||||
entity.el.className = '';
|
||||
}
|
||||
});
|
||||
|
||||
selectedEntities = [];
|
||||
for (let i = 0; i < selectedIDs.length; i++) {
|
||||
let id = selectedIDs[i];
|
||||
selectedEntities.push(id);
|
||||
if (id in entitiesByID) {
|
||||
let entity = entitiesByID[id];
|
||||
let entity = entitiesByID[id];
|
||||
if (entity !== undefined) {
|
||||
entity.el.className = 'selected';
|
||||
} else {
|
||||
notFound = true;
|
||||
|
|
|
@ -267,7 +267,6 @@ GridTool = function(opts) {
|
|||
try {
|
||||
data = JSON.parse(data);
|
||||
} catch (e) {
|
||||
print("gridTool.js: Error parsing JSON: " + e.name + " data " + data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue