mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:08:54 +02:00
RigTests build again
This commit is contained in:
parent
e2f031e77f
commit
0b410ecd92
1 changed files with 12 additions and 15 deletions
|
@ -47,21 +47,24 @@
|
||||||
#include <Rig.h>
|
#include <Rig.h>
|
||||||
#include "RigTests.h"
|
#include "RigTests.h"
|
||||||
|
|
||||||
static void reportJoint(int index, JointState joint) { // Handy for debugging
|
static void reportJoint(RigPointer rig, int index) { // Handy for debugging
|
||||||
std::cout << "\n";
|
std::cout << "\n";
|
||||||
std::cout << index << " " << joint.getName().toUtf8().data() << "\n";
|
std::cout << index << " " << rig->getAnimSkeleton()->getJointName(index).toUtf8().data() << "\n";
|
||||||
std::cout << " pos:" << joint.getPosition() << "/" << joint.getPositionInParentFrame() << " from " << joint.getParentIndex() << "\n";
|
glm::vec3 pos;
|
||||||
std::cout << " rot:" << safeEulerAngles(joint.getRotation()) << "/" << safeEulerAngles(joint.getRotationInParentFrame()) << "/" << safeEulerAngles(joint.getRotationInBindFrame()) << "\n";
|
rig->getJointPosition(index, pos);
|
||||||
|
glm::quat rot;
|
||||||
|
rig->getJointRotation(index, rot);
|
||||||
|
std::cout << " pos:" << pos << "\n";
|
||||||
|
std::cout << " rot:" << safeEulerAngles(rot) << "\n";
|
||||||
std::cout << "\n";
|
std::cout << "\n";
|
||||||
}
|
}
|
||||||
static void reportByName(RigPointer rig, const QString& name) {
|
static void reportByName(RigPointer rig, const QString& name) {
|
||||||
int jointIndex = rig->indexOfJoint(name);
|
int jointIndex = rig->indexOfJoint(name);
|
||||||
reportJoint(jointIndex, rig->getJointState(jointIndex));
|
reportJoint(rig, jointIndex);
|
||||||
}
|
}
|
||||||
static void reportAll(RigPointer rig) {
|
static void reportAll(RigPointer rig) {
|
||||||
for (int i = 0; i < rig->getJointStateCount(); i++) {
|
for (int i = 0; i < rig->getJointStateCount(); i++) {
|
||||||
JointState joint = rig->getJointState(i);
|
reportJoint(rig, i);
|
||||||
reportJoint(i, joint);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void reportSome(RigPointer rig) {
|
static void reportSome(RigPointer rig) {
|
||||||
|
@ -88,17 +91,11 @@ void RigTests::initTestCase() {
|
||||||
#endif
|
#endif
|
||||||
QVERIFY((bool)geometry);
|
QVERIFY((bool)geometry);
|
||||||
|
|
||||||
QVector<JointState> jointStates;
|
|
||||||
for (int i = 0; i < geometry->joints.size(); ++i) {
|
|
||||||
JointState state(geometry->joints[i]);
|
|
||||||
jointStates.append(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
_rig = std::make_shared<Rig>();
|
_rig = std::make_shared<Rig>();
|
||||||
_rig->initJointStates(jointStates, glm::mat4(), 0, 41, 40, 39, 17, 16, 15); // FIXME? get by name? do we really want to exclude the shoulder blades?
|
_rig->initJointStates(*geometry, glm::mat4());
|
||||||
std::cout << "Rig is ready " << geometry->joints.count() << " joints " << std::endl;
|
std::cout << "Rig is ready " << geometry->joints.count() << " joints " << std::endl;
|
||||||
reportAll(_rig);
|
reportAll(_rig);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RigTests::initialPoseArmsDown() {
|
void RigTests::initialPoseArmsDown() {
|
||||||
reportSome(_rig);
|
reportSome(_rig);
|
||||||
|
|
Loading…
Reference in a new issue