mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-26 12:55:18 -05:00
GetAsSkinJointsArray と GetAsVector4Array を使う
This commit is contained in:
@@ -234,10 +234,10 @@ namespace UniVRM10
|
||||
var normals = mesh.VertexBuffer.Normals.Bytes.Reinterpret<Vector3>(1);
|
||||
var texCoords = mesh.VertexBuffer.TexCoords.Bytes.Reinterpret<Vector2>(1);
|
||||
var weights = meshGroup.Skin != null
|
||||
? mesh.VertexBuffer.Weights.Bytes.Reinterpret<Vector4>(1)
|
||||
? mesh.VertexBuffer.Weights.GetAsVector4Array()
|
||||
: default;
|
||||
var joints = meshGroup.Skin != null
|
||||
? mesh.VertexBuffer.Joints.Bytes.Reinterpret<SkinJoints>(1)
|
||||
? mesh.VertexBuffer.Joints.GetAsSkinJointsArray()
|
||||
: default;
|
||||
|
||||
interleaveVertexJob = new InterleaveMeshVerticesJob(
|
||||
|
||||
@@ -96,13 +96,13 @@ namespace VrmLib
|
||||
{
|
||||
var jointsBuffer = vertexBuffer.Joints;
|
||||
var joints = (jointsBuffer != null || jointsBuffer.Count == 0)
|
||||
? jointsBuffer.Bytes.Reinterpret<SkinJoints>(1)
|
||||
? jointsBuffer.GetAsSkinJointsArray()
|
||||
: arrayManager.CreateNativeArray<SkinJoints>(vertexBuffer.Count) // when MorphTarget only
|
||||
;
|
||||
|
||||
var weightsBuffer = vertexBuffer.Weights;
|
||||
var weights = (weightsBuffer != null || weightsBuffer.Count == 0)
|
||||
? weightsBuffer.Bytes.Reinterpret<Vector4>(1)
|
||||
? weightsBuffer.GetAsVector4Array()
|
||||
: arrayManager.CreateNativeArray<Vector4>(vertexBuffer.Count) // when MorphTarget only
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user