init
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Animations;
|
||||
using UnityEngine.Animations.Rigging;
|
||||
|
||||
namespace VOID.Generic.Objects.Unit.Animations.Helpers
|
||||
{
|
||||
public struct ExtractTransformConstraintJob : IWeightedAnimationJob
|
||||
{
|
||||
public ReadWriteTransformHandle bone;
|
||||
|
||||
public FloatProperty jobWeight { get; set; }
|
||||
|
||||
public Vector3Property position;
|
||||
public Vector4Property rotation;
|
||||
|
||||
public void ProcessRootMotion(AnimationStream stream)
|
||||
{ }
|
||||
|
||||
public void ProcessAnimation(AnimationStream stream)
|
||||
{
|
||||
AnimationRuntimeUtils.PassThrough(stream, this.bone);
|
||||
|
||||
var pos = this.bone.GetPosition(stream);
|
||||
var rot = this.bone.GetRotation(stream);
|
||||
|
||||
this.position.Set(stream, pos);
|
||||
this.rotation.Set(stream, new Vector4(rot.x, rot.y, rot.z, rot.w));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user