mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
push what i have
This commit is contained in:
parent
dc2916e8e6
commit
d77afcc009
16 changed files with 496 additions and 91 deletions
|
@ -109,52 +109,42 @@ internal abstract class IKHandler
|
|||
protected virtual void Update_HeadWeight()
|
||||
{
|
||||
float targetWeight = GetTargetWeight(BodyControl.TrackingHead, true);
|
||||
BodyControl.SetHeadWeight(_solver.spine, targetWeight);
|
||||
BodyControl.SetLookAtWeight(IKManager.lookAtIk, targetWeight);
|
||||
}
|
||||
|
||||
protected virtual void Update_LeftArmWeight()
|
||||
{
|
||||
float leftArmWeight = GetTargetWeight(BodyControl.TrackingLeftArm, _solver.leftArm.target != null);
|
||||
BodyControl.SetArmWeight(_solver.leftArm, leftArmWeight);
|
||||
}
|
||||
|
||||
protected virtual void Update_RightArmWeight()
|
||||
{
|
||||
float rightArmWeight = GetTargetWeight(BodyControl.TrackingRightArm, _solver.rightArm.target != null);
|
||||
BodyControl.SetArmWeight(_solver.rightArm, rightArmWeight);
|
||||
}
|
||||
|
||||
protected virtual void Update_LeftLegWeight()
|
||||
{
|
||||
float leftLegWeight = GetTargetWeight(BodyControl.TrackingLeftLeg, _solver.leftLeg.target != null);
|
||||
BodyControl.SetLegWeight(_solver.leftLeg, leftLegWeight);
|
||||
}
|
||||
|
||||
protected virtual void Update_RightLegWeight()
|
||||
{
|
||||
float rightLegWeight = GetTargetWeight(BodyControl.TrackingRightLeg, _solver.rightLeg.target != null);
|
||||
BodyControl.SetLegWeight(_solver.rightLeg, rightLegWeight);
|
||||
}
|
||||
|
||||
protected virtual void Update_PelvisWeight()
|
||||
{
|
||||
float pelvisWeight = GetTargetWeight(BodyControl.TrackingPelvis, _solver.spine.pelvisTarget != null);
|
||||
BodyControl.SetPelvisWeight(_solver.spine, pelvisWeight);
|
||||
}
|
||||
|
||||
protected virtual void Update_LocomotionWeight()
|
||||
{
|
||||
_locomotionWeight = Mathf.Lerp(_locomotionWeight, BodyControl.TrackingLocomotion ? 1f : 0f,
|
||||
Time.deltaTime * ModSettings.EntryIKLerpSpeed.Value * 2f);
|
||||
BodyControl.SetLocomotionWeight(_solver.locomotion, _locomotionWeight);
|
||||
}
|
||||
|
||||
protected virtual void Update_IKPositionWeight()
|
||||
{
|
||||
float ikPositionWeight = BodyControl.TrackingAll ? BodyControl.TrackingIKPositionWeight : 0f;
|
||||
BodyControl.SetIKPositionWeight(_solver, ikPositionWeight);
|
||||
BodyControl.SetIKPositionWeight(IKManager.lookAtIk, ikPositionWeight);
|
||||
}
|
||||
|
||||
protected virtual float GetTargetWeight(bool isTracking, bool hasTarget)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using RootMotion.FinalIK;
|
||||
using NAK.AlternateIKSystem.IK.WeightManipulators;
|
||||
using RootMotion.FinalIK;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.AlternateIKSystem.IK.IKHandlers;
|
||||
|
@ -16,13 +17,13 @@ internal class IKHandlerDesktop : IKHandler
|
|||
public override void OnInitializeIk()
|
||||
{
|
||||
// Default tracking for Desktop
|
||||
shouldTrackHead = true;
|
||||
shouldTrackLeftArm = false;
|
||||
shouldTrackRightArm = false;
|
||||
shouldTrackLeftLeg = false;
|
||||
shouldTrackRightLeg = false;
|
||||
shouldTrackPelvis = false;
|
||||
shouldTrackLocomotion = true;
|
||||
DeviceControlManipulator.shouldTrackHead = true;
|
||||
DeviceControlManipulator.shouldTrackLeftArm = false;
|
||||
DeviceControlManipulator.shouldTrackRightArm = false;
|
||||
DeviceControlManipulator.shouldTrackLeftLeg = false;
|
||||
DeviceControlManipulator.shouldTrackRightLeg = false;
|
||||
DeviceControlManipulator.shouldTrackPelvis = false;
|
||||
DeviceControlManipulator.shouldTrackLocomotion = true;
|
||||
|
||||
_vrik.onPreSolverUpdate.AddListener(OnPreSolverUpdateDesktop);
|
||||
}
|
||||
|
@ -36,11 +37,6 @@ internal class IKHandlerDesktop : IKHandler
|
|||
// Reset avatar local position
|
||||
_vrik.transform.localPosition = Vector3.zero;
|
||||
_vrik.transform.localRotation = Quaternion.identity;
|
||||
|
||||
base.UpdateWeights();
|
||||
|
||||
// Desktop should never have head position weight
|
||||
_solver.spine.positionWeight = 0f;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using RootMotion.FinalIK;
|
||||
using NAK.AlternateIKSystem.IK.WeightManipulators;
|
||||
using RootMotion.FinalIK;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.AlternateIKSystem.IK.IKHandlers;
|
||||
|
@ -16,13 +17,13 @@ internal class IKHandlerHalfBody : IKHandler
|
|||
public override void OnInitializeIk()
|
||||
{
|
||||
// Default tracking for HalfBody
|
||||
shouldTrackHead = true;
|
||||
shouldTrackLeftArm = true;
|
||||
shouldTrackRightArm = true;
|
||||
shouldTrackLeftLeg = false;
|
||||
shouldTrackRightLeg = false;
|
||||
shouldTrackPelvis = false;
|
||||
shouldTrackLocomotion = true;
|
||||
DeviceControlManipulator.shouldTrackHead = true;
|
||||
DeviceControlManipulator.shouldTrackLeftArm = true;
|
||||
DeviceControlManipulator.shouldTrackRightArm = true;
|
||||
DeviceControlManipulator.shouldTrackLeftLeg = false;
|
||||
DeviceControlManipulator.shouldTrackRightLeg = false;
|
||||
DeviceControlManipulator.shouldTrackPelvis = false;
|
||||
DeviceControlManipulator.shouldTrackLocomotion = true;
|
||||
|
||||
_vrik.onPreSolverUpdate.AddListener(OnPreSolverUpdateHalfBody);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue