mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 20:58:28 +02:00
Use OUTOFBODY_HACK as searchable token
This commit is contained in:
parent
28d1faa1c0
commit
5e0c2286ec
3 changed files with 9 additions and 10 deletions
|
@ -82,7 +82,7 @@ const float MyAvatar::ZOOM_MIN = 0.5f;
|
||||||
const float MyAvatar::ZOOM_MAX = 25.0f;
|
const float MyAvatar::ZOOM_MAX = 25.0f;
|
||||||
const float MyAvatar::ZOOM_DEFAULT = 1.5f;
|
const float MyAvatar::ZOOM_DEFAULT = 1.5f;
|
||||||
|
|
||||||
extern bool HACKY_GLOBAL_ENABLE_DEBUG_DRAW_IK_TARGETS;
|
extern bool OUTOFBODY_HACK_ENABLE_DEBUG_DRAW_IK_TARGETS;
|
||||||
|
|
||||||
MyAvatar::MyAvatar(RigPointer rig) :
|
MyAvatar::MyAvatar(RigPointer rig) :
|
||||||
Avatar(rig),
|
Avatar(rig),
|
||||||
|
@ -839,7 +839,7 @@ void MyAvatar::setEnableDebugDrawSensorToWorldMatrix(bool isEnabled) {
|
||||||
void MyAvatar::setEnableDebugDrawIKTargets(bool isEnabled) {
|
void MyAvatar::setEnableDebugDrawIKTargets(bool isEnabled) {
|
||||||
_enableDebugDrawIKTargets = isEnabled;
|
_enableDebugDrawIKTargets = isEnabled;
|
||||||
|
|
||||||
HACKY_GLOBAL_ENABLE_DEBUG_DRAW_IK_TARGETS = isEnabled;
|
OUTOFBODY_HACK_ENABLE_DEBUG_DRAW_IK_TARGETS = isEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
#include "SwingTwistConstraint.h"
|
#include "SwingTwistConstraint.h"
|
||||||
#include "AnimationLogging.h"
|
#include "AnimationLogging.h"
|
||||||
|
|
||||||
bool HACKY_GLOBAL_ENABLE_DEBUG_DRAW_IK_TARGETS = false;
|
bool OUTOFBODY_HACK_ENABLE_DEBUG_DRAW_IK_TARGETS = false;
|
||||||
Rig* HACKY_GLOBAL_RIG_POINTER = nullptr;
|
Rig* OUTOFBODY_HACK_RIG_POINTER = nullptr;
|
||||||
|
|
||||||
AnimInverseKinematics::AnimInverseKinematics(const QString& id) : AnimNode(AnimNode::Type::InverseKinematics, id) {
|
AnimInverseKinematics::AnimInverseKinematics(const QString& id) : AnimNode(AnimNode::Type::InverseKinematics, id) {
|
||||||
}
|
}
|
||||||
|
@ -442,10 +442,9 @@ const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars
|
||||||
computeTargets(animVars, targets, underPoses);
|
computeTargets(animVars, targets, underPoses);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AJT: HACK
|
if (OUTOFBODY_HACK_ENABLE_DEBUG_DRAW_IK_TARGETS && OUTOFBODY_HACK_RIG_POINTER) {
|
||||||
if (HACKY_GLOBAL_ENABLE_DEBUG_DRAW_IK_TARGETS && HACKY_GLOBAL_RIG_POINTER) {
|
|
||||||
const vec4 WHITE(1.0f);
|
const vec4 WHITE(1.0f);
|
||||||
glm::mat4 geomToRigMat = HACKY_GLOBAL_RIG_POINTER->getGeometryToRigTransform();
|
glm::mat4 geomToRigMat = OUTOFBODY_HACK_RIG_POINTER->getGeometryToRigTransform();
|
||||||
glm::mat4 rigToAvatarMat = createMatFromQuatAndPos(Quaternions::Y_180, glm::vec3());
|
glm::mat4 rigToAvatarMat = createMatFromQuatAndPos(Quaternions::Y_180, glm::vec3());
|
||||||
|
|
||||||
for (auto& target : targets) {
|
for (auto& target : targets) {
|
||||||
|
|
|
@ -51,7 +51,7 @@ const glm::vec3 TRUNCATE_IK_CAPSULE_POSITION(0.0f, 0.0f, 0.0f);
|
||||||
float TRUNCATE_IK_CAPSULE_LENGTH = 1000.0;
|
float TRUNCATE_IK_CAPSULE_LENGTH = 1000.0;
|
||||||
float TRUNCATE_IK_CAPSULE_RADIUS = 0.5;
|
float TRUNCATE_IK_CAPSULE_RADIUS = 0.5;
|
||||||
|
|
||||||
extern Rig* HACKY_GLOBAL_RIG_POINTER;
|
extern Rig* OUTOFBODY_HACK_RIG_POINTER;
|
||||||
|
|
||||||
void Rig::overrideAnimation(const QString& url, float fps, bool loop, float firstFrame, float lastFrame) {
|
void Rig::overrideAnimation(const QString& url, float fps, bool loop, float firstFrame, float lastFrame) {
|
||||||
|
|
||||||
|
@ -881,7 +881,7 @@ void Rig::updateAnimations(float deltaTime, glm::mat4 rootTransform) {
|
||||||
_animVars.setRigToGeometryTransform(_rigToGeometryTransform);
|
_animVars.setRigToGeometryTransform(_rigToGeometryTransform);
|
||||||
|
|
||||||
// evaluate the animation
|
// evaluate the animation
|
||||||
HACKY_GLOBAL_RIG_POINTER = this;
|
OUTOFBODY_HACK_RIG_POINTER = this;
|
||||||
AnimNode::Triggers triggersOut;
|
AnimNode::Triggers triggersOut;
|
||||||
_internalPoseSet._relativePoses = _animNode->evaluate(_animVars, deltaTime, triggersOut);
|
_internalPoseSet._relativePoses = _animNode->evaluate(_animVars, deltaTime, triggersOut);
|
||||||
if ((int)_internalPoseSet._relativePoses.size() != _animSkeleton->getNumJoints()) {
|
if ((int)_internalPoseSet._relativePoses.size() != _animSkeleton->getNumJoints()) {
|
||||||
|
@ -892,7 +892,7 @@ void Rig::updateAnimations(float deltaTime, glm::mat4 rootTransform) {
|
||||||
for (auto& trigger : triggersOut) {
|
for (auto& trigger : triggersOut) {
|
||||||
_animVars.setTrigger(trigger);
|
_animVars.setTrigger(trigger);
|
||||||
}
|
}
|
||||||
HACKY_GLOBAL_RIG_POINTER = nullptr;
|
OUTOFBODY_HACK_RIG_POINTER = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
applyOverridePoses();
|
applyOverridePoses();
|
||||||
|
|
Loading…
Reference in a new issue