History

Pull packBlendshapeOffsets() into separate function

Ken Cooke committed 7 years ago

Commit cceff211 parent 87c68031 file · +10 −9Browse files

Showing the changes to libraries/render-utils/src/Model.cpp (1 of 1 file). Show all

Unified · Split

libraries/render-utils/src/Model.cpp+10−9
@@ -1691,10 +1691,7 @@ public: · 1690 unmodified lines
16911691 }
16921692 };
16931693
1694−
1695−using packBlendshapeOffsetTo = void(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked);
1696−
1697−void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked) {
1694+static void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked) {
16981695 float len = glm::compMax(glm::abs(unpacked.positionOffset));
16991696 glm::vec3 normalizedPos(unpacked.positionOffset);
17001697 if (len > 0.0f) {
@@ -1711,6 +1708,14 @@ void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& pac · 10 unmodified lines
17111708 );
17121709 }
17131710
1711+static void packBlendshapeOffsets(BlendshapeOffsetUnpacked* unpacked, BlendshapeOffsetPacked* packed, int size) {
1712+ for (int i = 0; i < size; ++i) {
1713+ packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10((*packed).packedPosNorTan, (*unpacked));
1714+ ++unpacked;
1715+ ++packed;
1716+ }
1717+}
1718+
17141719 class Blender : public QRunnable {
17151720 public:
17161721
@@ -1795,11 +1800,7 @@ void Blender::run() { · 78 unmodified lines
17951800 // convert unpackedBlendshapeOffsets into packedBlendshapeOffsets for the gpu.
17961801 auto unpacked = unpackedBlendshapeOffsets.data();
17971802 auto packed = packedBlendshapeOffsets.data() + offset;
1798− for (int i = 0; i < numVertsInMesh; ++i) {
1799− packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10((*packed).packedPosNorTan, (*unpacked));
1800− ++unpacked;
1801− ++packed;
1802− }
1803+ packBlendshapeOffsets(unpacked, packed, numVertsInMesh);
18031804
18041805 offset += numVertsInMesh;
18051806 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t