Skip to content

Commit

Permalink
fix: Corrected unsigned short joint weights import (fixes #419)
Browse files Browse the repository at this point in the history
  • Loading branch information
atteneder committed Jul 1, 2022
1 parent eada50d commit c611594
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Loading glTFs with nothing but accessors/bufferViews/buffers (#422)
- Loading glTFs with invalid embed buffers (#422)
- Corrected unsigned short joint weights import (#419)

## [4.8.2] - 2022-06-15
### Changed
Expand Down
4 changes: 2 additions & 2 deletions Runtime/Scripts/Jobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ public unsafe struct ConvertBoneWeightsUInt16ToFloatInterleavedJob :
#if UNITY_JOBS
public void Execute(int i, int count) {
var resultV = (float4*) ((byte*)result + i*outputByteStride);
var off = (ushort*) input + i*inputByteStride;
var off = (ushort*) (input + i*inputByteStride);

for (var x = 0; x < count; x++) {
*resultV = new float4(
Expand All @@ -1450,7 +1450,7 @@ public void Execute(int i, int count) {
#else
public void Execute(int i) {
var resultV = (float4*) (((byte*)result) + (i*outputByteStride));
var off = (ushort*) input + i*inputByteStride;
var off = (ushort*) (input + i*inputByteStride);
*resultV = new float4(
off[0] / (float) ushort.MaxValue,
off[1] / (float) ushort.MaxValue,
Expand Down

0 comments on commit c611594

Please sign in to comment.