Skip to content

Commit

Permalink
Fixed flow assignment operators
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuprynowicz committed Aug 27, 2023
1 parent 0c2fe4c commit 38d44d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions libraries/animation/src/Flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ void FlowThread::setScale(float scale, bool initScale) {
}

FlowThread& FlowThread::operator=(const FlowThread& otherFlowThread) {
_rigScale = otherFlowThread._rigScale;
for (int jointIndex: otherFlowThread._joints) {
auto& joint = otherFlowThread._jointsPointer->at(jointIndex);
auto& myJoint = _jointsPointer->at(jointIndex);
Expand Down Expand Up @@ -798,6 +799,7 @@ Flow& Flow::operator=(const Flow& otherFlow) {
_active = otherFlow.getActive();
_scale = otherFlow.getScale();
_isScaleSet = true;
_rig = otherFlow._rig;
auto &threads = otherFlow.getThreads();
if (threads.size() == _jointThreads.size()) {
for (size_t i = 0; i < _jointThreads.size(); i++) {
Expand Down
3 changes: 1 addition & 2 deletions libraries/animation/src/Flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ class FlowThread {
std::vector<glm::vec3> _positions;
float _radius{ 0.0f };
float _length{ 0.0f };
// 100.0f was default rig scale when it was hardcoded but it caused issues with most avatars
float _rigScale { 100.0f };
std::map<int, FlowJoint>* _jointsPointer;
std::vector<glm::vec3> _rootFramePositions;
Expand Down Expand Up @@ -324,8 +325,6 @@ class Flow : public QObject{

float _scale { 1.0f };
float _lastScale{ 1.0f };
// 100.0f was default rig scale when it was hardcoded but it caused issues with most avatars
//float _rigScale{ 100.0f };
// Rig to which flow system belongs, it's used for getting rig scale
Rig *_rig { nullptr };
glm::vec3 _entityPosition;
Expand Down

0 comments on commit 38d44d0

Please sign in to comment.