-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,157 additions
and
260 deletions.
There are no files selected for viewing
589 changes: 433 additions & 156 deletions
589
...rControllerV2/Animation/AvatarBase.prefab → ...ollerV2/Animation/AvatarBaseWithIK.prefab
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
369 changes: 365 additions & 4 deletions
369
...pts/MainScripts/DCL/Controllers/CharacterControllerV2/Animation/Avatar_FBX_Anim1.fbx.meta
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
...s/Scripts/MainScripts/DCL/Controllers/CharacterControllerV2/Animation/FootIKController.cs
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...pts/MainScripts/DCL/Controllers/CharacterControllerV2/Animation/IKRuntimeConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using UnityEngine; | ||
|
||
public class IKRuntimeConfiguration : MonoBehaviour | ||
{ | ||
[SerializeField] private Transform[] objectsToReparent; | ||
[SerializeField] private Transform parent; | ||
|
||
public void Start() | ||
{ | ||
foreach (Transform tr in objectsToReparent) | ||
{ | ||
//tr.SetParent(parent, true); | ||
} | ||
} | ||
} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/CharacterControllerV2/IK.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...cripts/MainScripts/DCL/Controllers/CharacterControllerV2/IK/ExtractTransformConstraint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using UnityEngine; | ||
using UnityEngine.Animations.Rigging; | ||
|
||
namespace MainScripts.DCL.Controllers.CharacterControllerV2.IK | ||
{ | ||
[DisallowMultipleComponent] | ||
[AddComponentMenu("Animation Rigging/Extract Transform Constraint")] | ||
public class ExtractTransformConstraint : RigConstraint< | ||
ExtractTransformConstraintJob, | ||
ExtractTransformConstraintData, | ||
ExtractTransformConstraintJobBinder> | ||
{ | ||
|
||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...s/MainScripts/DCL/Controllers/CharacterControllerV2/IK/ExtractTransformConstraint.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...ts/MainScripts/DCL/Controllers/CharacterControllerV2/IK/ExtractTransformConstraintData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using UnityEngine; | ||
using UnityEngine.Animations.Rigging; | ||
|
||
namespace MainScripts.DCL.Controllers.CharacterControllerV2.IK | ||
{ | ||
[Serializable] | ||
public struct ExtractTransformConstraintData : IAnimationJobData | ||
{ | ||
[SyncSceneToStream] public Transform bone; | ||
|
||
public Vector3 position; | ||
public Quaternion rotation; | ||
public Vector3 scale; | ||
|
||
public bool IsValid() => | ||
bone != null; | ||
|
||
public void SetDefaultValues() | ||
{ | ||
this.bone = null; | ||
|
||
this.position = Vector3.zero; | ||
this.rotation = Quaternion.identity; | ||
this.scale = Vector3.zero; | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...inScripts/DCL/Controllers/CharacterControllerV2/IK/ExtractTransformConstraintData.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
...pts/MainScripts/DCL/Controllers/CharacterControllerV2/IK/ExtractTransformConstraintJob.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using UnityEngine; | ||
using UnityEngine.Animations; | ||
using UnityEngine.Animations.Rigging; | ||
|
||
namespace MainScripts.DCL.Controllers.CharacterControllerV2.IK | ||
{ | ||
public struct ExtractTransformConstraintJob : IWeightedAnimationJob | ||
{ | ||
public ReadWriteTransformHandle bone; | ||
|
||
public FloatProperty jobWeight { get; set; } | ||
|
||
public Vector3Property position; | ||
public Vector4Property rotation; | ||
public Vector3Property scale; | ||
|
||
public void ProcessRootMotion(AnimationStream stream) { } | ||
|
||
public void ProcessAnimation(AnimationStream stream) | ||
{ | ||
AnimationRuntimeUtils.PassThrough(stream, this.bone); | ||
|
||
Vector3 pos = this.bone.GetLocalPosition(stream); | ||
Quaternion rot = this.bone.GetLocalRotation(stream); | ||
Vector3 sc = this.bone.GetLocalScale(stream); | ||
|
||
this.position.Set(stream, pos); | ||
this.scale.Set(stream, sc); | ||
this.rotation.Set(stream, new Vector4(rot.x, rot.y, rot.z, rot.w)); | ||
} | ||
} | ||
} |
Oops, something went wrong.