mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 03:19:23 +00:00
Fixes for 24/06/2025 nightly build
This commit is contained in:
parent
0902edd560
commit
40b683d33c
18 changed files with 93 additions and 86 deletions
|
@ -1,4 +1,5 @@
|
|||
using ABI.CCK.Components;
|
||||
using ABI_RC.Core;
|
||||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Systems.IK;
|
||||
|
@ -81,7 +82,7 @@ namespace ml_ppu
|
|||
}
|
||||
|
||||
Vector3 l_armsMidPoint = (m_armLeft.position + m_armRight.position) * 0.5f;
|
||||
Quaternion l_avatarRot = PlayerSetup.Instance._avatar.transform.rotation;
|
||||
Quaternion l_avatarRot = PlayerSetup.Instance.AvatarTransform.rotation;
|
||||
|
||||
m_collider.transform.position = Vector3.zero;
|
||||
m_collider.transform.rotation = Quaternion.identity;
|
||||
|
@ -127,12 +128,12 @@ namespace ml_ppu
|
|||
|
||||
void OnAvatarSetup()
|
||||
{
|
||||
Animator l_animator = PlayerSetup.Instance._animator;
|
||||
Animator l_animator = PlayerSetup.Instance.Animator;
|
||||
if((l_animator != null) && l_animator.isHuman)
|
||||
{
|
||||
IKSystem.Instance.SetAvatarPose(IKSystem.AvatarPose.TPose);
|
||||
PlayerSetup.Instance._avatar.transform.localPosition = Vector3.zero;
|
||||
PlayerSetup.Instance._avatar.transform.localRotation = Quaternion.identity;
|
||||
PlayerSetup.Instance.AvatarTransform.localPosition = Vector3.zero;
|
||||
PlayerSetup.Instance.AvatarTransform.localRotation = Quaternion.identity;
|
||||
|
||||
m_hips = l_animator.GetBoneTransform(HumanBodyBones.Hips);
|
||||
m_armLeft = l_animator.GetBoneTransform(HumanBodyBones.LeftUpperArm);
|
||||
|
@ -140,11 +141,12 @@ namespace ml_ppu
|
|||
|
||||
if((m_hips != null) && (m_armLeft != null) && (m_armRight != null))
|
||||
{
|
||||
Matrix4x4 l_avatarMatInv = PlayerSetup.Instance._avatar.transform.GetMatrix().inverse;
|
||||
Matrix4x4 l_avatarMatInv = PlayerSetup.Instance.AvatarTransform.GetMatrix().inverse;
|
||||
Vector3 l_hipsPos = (l_avatarMatInv * m_hips.GetMatrix()).GetPosition();
|
||||
Vector3 l_armPos = (l_avatarMatInv * m_armLeft.GetMatrix()).GetPosition();
|
||||
|
||||
m_collider = new GameObject("[Collider]").AddComponent<CapsuleCollider>();
|
||||
m_collider.gameObject.layer = CVRLayers.PlayerClone;
|
||||
m_collider.transform.parent = this.transform;
|
||||
m_collider.isTrigger = true;
|
||||
m_collider.height = Vector3.Distance(l_hipsPos, new Vector3(0f, l_armPos.y, l_armPos.z));
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using ABI_RC.Core;
|
||||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core.Savior;
|
||||
using ABI_RC.Systems.Movement;
|
||||
using ABI_RC.Systems.Safety.AdvancedSafety;
|
||||
using UnityEngine;
|
||||
|
@ -8,6 +9,8 @@ namespace ml_ppu
|
|||
{
|
||||
static class Utils
|
||||
{
|
||||
public static bool IsInVR() => ((MetaPort.Instance != null) && MetaPort.Instance.isUsingVr);
|
||||
|
||||
public static Matrix4x4 GetMatrix(this Transform p_transform, bool p_pos = true, bool p_rot = true, bool p_scl = false)
|
||||
{
|
||||
return Matrix4x4.TRS(p_pos ? p_transform.position : Vector3.zero, p_rot ? p_transform.rotation : Quaternion.identity, p_scl ? p_transform.lossyScale : Vector3.one);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<Platforms>x64</Platforms>
|
||||
<AssemblyName>PlayerPickUp</AssemblyName>
|
||||
<Authors>SDraw</Authors>
|
||||
<Version>1.0.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue