浏览代码

static targets include local scale

/main
Lasse Jon Fuglsang Pedersen 4 年前
当前提交
340e047c
共有 2 个文件被更改,包括 16 次插入4 次删除
  1. 10
      Runtime/SkinAttachment.cs
  2. 10
      Runtime/SkinAttachmentTarget.cs

10
Runtime/SkinAttachment.cs


SkinAttachmentDataBuilder.BuildDataAttachSubjectReadOnly(ref debugData, target.transform, target.GetCachedMeshInfo(), this, dryRun: false, ref dryRunPoseCount, ref dryRunItemCount);
Matrix4x4 targetToWorld = Matrix4x4.TRS(target.transform.position, target.transform.rotation, Vector3.one);
// NOTE: targetToWorld specifically excludes scale, since source data (BakeMesh) is already scaled
Matrix4x4 targetToWorld;
{
// NOTE: for skinned targets, targetToWorld specifically excludes scale, since source data (BakeMesh) is already scaled
if (target.meshBakedSmr != null)
targetToWorld = Matrix4x4.TRS(target.transform.position, target.transform.rotation, Vector3.one);
else
targetToWorld = target.transform.localToWorldMatrix;
}
Matrix4x4 targetToSubject;
{

10
Runtime/SkinAttachmentTarget.cs


stagingPins[stagingPinsSourceDataOffset + 1] = GCHandle.Alloc(meshBuffers.vertexTangents, GCHandleType.Pinned);
stagingPins[stagingPinsSourceDataOffset + 2] = GCHandle.Alloc(meshBuffers.vertexNormals, GCHandleType.Pinned);
var targetToWorld = Matrix4x4.TRS(this.transform.position, this.transform.rotation, Vector3.one);
// NOTE: targetToWorld specifically excludes scale, since source data (BakeMesh) is already scaled
// NOTE: for skinned targets, targetToWorld specifically excludes scale, since source data (BakeMesh) is already scaled
Matrix4x4 targetToWorld;
{
if (this.meshBakedSmr != null)
targetToWorld = Matrix4x4.TRS(this.transform.position, this.transform.rotation, Vector3.one);
else
targetToWorld = this.transform.localToWorldMatrix;
}
var targetMeshWorldBounds = meshBakedOrAsset.bounds;
var targetMeshWorldBoundsCenter = targetMeshWorldBounds.center;

正在加载...
取消
保存