mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 23:24:01 +08:00
Fix for bones on peds drawables with existing skeletons. Also included code to use geometry-specific bone matrices where boneIds array is used, but commented out since it never seems necessary (leaving in for reference)
This commit is contained in:
@@ -384,6 +384,41 @@ namespace CodeWalker.Rendering
|
||||
bt.Row3 = b.Column3;
|
||||
BoneTransforms[i] = bt;
|
||||
}
|
||||
|
||||
//var drawbl = Key;
|
||||
//if (AllModels == null) return;
|
||||
//for (int i = 0; i < AllModels.Length; i++)
|
||||
//{
|
||||
// var model = AllModels[i];
|
||||
// if (model?.Geometries == null) continue;
|
||||
// for (int g = 0; g < model.Geometries.Length; g++)
|
||||
// {
|
||||
// var geom = model.Geometries[g];
|
||||
// var boneids = geom?.DrawableGeom?.BoneIds;
|
||||
// if (boneids == null) continue;
|
||||
// if (boneids.Length != Bones.Count)
|
||||
// {
|
||||
// var idc = boneids.Length;
|
||||
// if (geom.BoneTransforms == null)
|
||||
// {
|
||||
// geom.BoneTransforms = new Matrix3_s[idc];
|
||||
// }
|
||||
// for (int b = 0; b < idc; b++)
|
||||
// {
|
||||
// var id = boneids[b];
|
||||
// if (id < BoneTransforms.Length)
|
||||
// {
|
||||
// geom.BoneTransforms[b] = BoneTransforms[id];
|
||||
// if (id != b)
|
||||
// { }
|
||||
// }
|
||||
// else
|
||||
// { }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -756,6 +791,8 @@ namespace CodeWalker.Rendering
|
||||
public bool isHair = false;
|
||||
public bool disableRendering = false;
|
||||
|
||||
//public Matrix3_s[] BoneTransforms = null;
|
||||
|
||||
public static ShaderParamNames[] GetTextureSamplerList()
|
||||
{
|
||||
return new ShaderParamNames[]
|
||||
|
||||
@@ -796,6 +796,14 @@ namespace CodeWalker.Rendering
|
||||
{
|
||||
tintpal.SetVSResource(context, 0);
|
||||
}
|
||||
|
||||
|
||||
//if (geom.BoneTransforms != null)
|
||||
//{
|
||||
// SetBoneMatrices(context, geom.BoneTransforms);
|
||||
// defaultBoneMatricesBound = false;
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
public void SetBoneMatrices(DeviceContext context, Matrix3_s[] matrices)
|
||||
|
||||
@@ -356,6 +356,14 @@ namespace CodeWalker.Rendering
|
||||
{
|
||||
texture.SetPSResource(context, 0);
|
||||
}
|
||||
|
||||
|
||||
//if (geom.BoneTransforms != null)
|
||||
//{
|
||||
// SetBoneMatrices(context, geom.BoneTransforms);
|
||||
// defaultBoneMatricesBound = false;
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
public void SetBoneMatrices(DeviceContext context, Matrix3_s[] matrices)
|
||||
|
||||
Reference in New Issue
Block a user