mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 15:45:42 +08:00
Improved animations game replication and performance
This commit is contained in:
@@ -2233,19 +2233,27 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
public void UpdateAnimTransform()
|
||||
{
|
||||
//AnimTransform = Matrix.AffineTransformation(1.0f, AnimRotation, AnimTranslation);//(local transform)
|
||||
var pos = AnimTranslation;
|
||||
var ori = AnimRotation;
|
||||
var sca = AnimScale;
|
||||
var pbone = Parent;
|
||||
while (pbone != null)
|
||||
AnimTransform = Matrix.AffineTransformation(1.0f, AnimRotation, AnimTranslation);
|
||||
AnimTransform.ScaleVector *= AnimScale;
|
||||
if (Parent != null)
|
||||
{
|
||||
pos = pbone.AnimRotation.Multiply(pos /** pbone.AnimScale*/) + pbone.AnimTranslation;
|
||||
ori = pbone.AnimRotation * ori;
|
||||
pbone = pbone.Parent;
|
||||
AnimTransform = AnimTransform * Parent.AnimTransform;
|
||||
}
|
||||
AnimTransform = Matrix.AffineTransformation(1.0f, ori, pos);//(global transform)
|
||||
AnimTransform.ScaleVector *= sca;
|
||||
|
||||
////AnimTransform = Matrix.AffineTransformation(1.0f, AnimRotation, AnimTranslation);//(local transform)
|
||||
|
||||
//var pos = AnimTranslation;
|
||||
//var ori = AnimRotation;
|
||||
//var sca = AnimScale;
|
||||
//var pbone = Parent;
|
||||
//while (pbone != null)
|
||||
//{
|
||||
// pos = pbone.AnimRotation.Multiply(pos /** pbone.AnimScale*/) + pbone.AnimTranslation;
|
||||
// ori = pbone.AnimRotation * ori;
|
||||
// pbone = pbone.Parent;
|
||||
//}
|
||||
//AnimTransform = Matrix.AffineTransformation(1.0f, ori, pos);//(global transform)
|
||||
//AnimTransform.ScaleVector *= sca;
|
||||
}
|
||||
public void UpdateSkinTransform()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user