public static TransformSceneHandle BindSceneTransform(this Animator animator, Transform transform)
        {
            TransformSceneHandle transformSceneHandle = new TransformSceneHandle();

            InternalBindSceneTransform(animator, transform, out transformSceneHandle);
            return(transformSceneHandle);
        }
        private Quaternion GetLocalRotationInternal(ref AnimationStream stream)
        {
            Quaternion result;

            TransformSceneHandle.GetLocalRotationInternal_Injected(ref this, ref stream, out result);
            return(result);
        }
        private Vector3 GetLocalScaleInternal(ref AnimationStream stream)
        {
            Vector3 result;

            TransformSceneHandle.GetLocalScaleInternal_Injected(ref this, ref stream, out result);
            return(result);
        }
 static public int constructor(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.Animations.TransformSceneHandle o;
         o = new UnityEngine.Animations.TransformSceneHandle();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
        public static TransformSceneHandle BindSceneTransform(this Animator animator, Transform transform)
        {
            TransformSceneHandle result = default(TransformSceneHandle);

            AnimatorJobExtensions.InternalBindSceneTransform(animator, transform, out result);
            return(result);
        }
Example #6
0
        public void Setup(Animator animator, Transform[] bones, Transform target)
        {
            this.bones       = new NativeArray <UnityEngine.Animations.TransformStreamHandle>(bones.Length, Allocator.Persistent);
            this.boneWeights = new NativeArray <UnityEngine.Animations.PropertySceneHandle>(bones.Length - 1, Allocator.Persistent);
            this.boneSqrMags = new NativeArray <float>(bones.Length - 1, Allocator.Persistent);

            for (int i = 0; i < this.bones.Length; i++)
            {
                this.bones[i] = animator.BindStreamTransform(bones[i]);
            }

            for (int i = 0; i < this.bones.Length - 1; i++)
            {
                var boneParams = bones[i].gameObject.GetComponent <IKJBoneParams>();
                if (boneParams == null)
                {
                    boneParams = bones[i].gameObject.AddComponent <IKJBoneParams>();
                }

                this.boneWeights[i] = animator.BindSceneProperty(bones[i].transform, typeof(IKJBoneParams), "weight");
            }

            // Rotation Limits
            SetUpRotationLimits(animator, bones);

            _target           = animator.BindSceneTransform(target);
            _IKPositionWeight = animator.BindSceneProperty(animator.transform, typeof(CCDIKJ), "weight");
            _maxIterations    = animator.BindSceneProperty(animator.transform, typeof(CCDIKJ), "maxIterations");
            _tolerance        = animator.BindSceneProperty(animator.transform, typeof(CCDIKJ), "tolerance");
            _XY = animator.BindSceneProperty(animator.transform, typeof(CCDIKJ), "XY");
            _useRotationLimits = animator.BindSceneProperty(animator.transform, typeof(CCDIKJ), "useRotationLimits");
        }
        public void Setup(Animator animator, Transform[] bones, Transform target, Transform poleTarget, Transform aimTransform)
        {
            this.bones       = new NativeArray <UnityEngine.Animations.TransformStreamHandle>(bones.Length, Allocator.Persistent);
            this.boneWeights = new NativeArray <UnityEngine.Animations.PropertySceneHandle>(bones.Length, Allocator.Persistent);

            for (int i = 0; i < this.bones.Length; i++)
            {
                this.bones[i] = animator.BindStreamTransform(bones[i]);
            }


            for (int i = 0; i < this.bones.Length; i++)
            {
                var boneParams = bones[i].gameObject.GetComponent <IKJBoneParams>();
                if (boneParams == null)
                {
                    boneParams = bones[i].gameObject.AddComponent <IKJBoneParams>();
                }

                this.boneWeights[i] = animator.BindSceneProperty(bones[i].transform, typeof(IKJBoneParams), "weight");
            }

            // Rotation Limits
            SetUpRotationLimits(animator, bones);

            _target           = animator.BindSceneTransform(target);
            _poleTarget       = animator.BindSceneTransform(poleTarget);
            _transform        = animator.BindStreamTransform(aimTransform);
            _IKPositionWeight = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "weight");
            _poleWeight       = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "poleWeight");
            _axisX            = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "axisX");
            _axisY            = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "axisY");
            _axisZ            = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "axisZ");
            _poleAxisX        = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "poleAxisX");
            _poleAxisY        = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "poleAxisY");
            _poleAxisZ        = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "poleAxisZ");
            _clampWeight      = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "clampWeight");
            _clampSmoothing   = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "clampSmoothing");
            _maxIterations    = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "maxIterations");
            _tolerance        = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "tolerance");
            _XY = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "XY");
            _useRotationLimits = animator.BindSceneProperty(animator.transform, typeof(AimIKJ), "useRotationLimits");

            step = 1f / (float)bones.Length;
        }
 extern private static void InternalBindSceneTransform([NotNull] Animator animator, [NotNull] Transform transform, out TransformSceneHandle transformSceneHandle);
 private static extern void GetGlobalTRInternal_Injected(ref TransformSceneHandle _unity_self, ref AnimationStream stream, out Vector3 position, out Quaternion rotation);
 private static extern void GetLocalScaleInternal_Injected(ref TransformSceneHandle _unity_self, ref AnimationStream stream, out Vector3 ret);
 private static extern void GetLocalRotationInternal_Injected(ref TransformSceneHandle _unity_self, ref AnimationStream stream, out Quaternion ret);
 private static extern bool HasValidTransform_Injected(ref TransformSceneHandle _unity_self, ref AnimationStream stream);
 private void GetGlobalTRInternal(ref AnimationStream stream, out Vector3 position, out Quaternion rotation)
 {
     TransformSceneHandle.GetGlobalTRInternal_Injected(ref this, ref stream, out position, out rotation);
 }
 private bool HasValidTransform(ref AnimationStream stream)
 {
     return(TransformSceneHandle.HasValidTransform_Injected(ref this, ref stream));
 }
 private static extern void InternalBindSceneTransform([NotNull("ArgumentNullException")] Animator animator, [NotNull("ArgumentNullException")] Transform transform, out TransformSceneHandle transformSceneHandle);