NEW HVR 2.9.1f

This commit is contained in:
Kilosoft 2023-03-25 03:17:58 +03:00
parent f0bf64ed45
commit 91acc4d728
243 changed files with 16657 additions and 11137 deletions

View File

@ -1,3 +1,106 @@
2.9.1f
Added Pico device detection for controller offsets.
Fixed HVRStringSocketFilter / HVRStringSocketable filtering pair.
Fixed shoulder socket not working when moving forward.
2.9.1e
HVRGrabbable: new overridable function CanHandGrab for grab filtering.
HVRHandGrabFilter - abstract base class for modular hand grab filtering
HVRGrabHandFilter - new component for hvrgrabbable to limit which hand can grab
Example scene updated for grab hand filter
2.9.1
Fixed bug where the grab joint might end up on the wrong game object if the grabbable was a child of the rigidbody.
Fixed player controller to take into account the angle of the surface the player is standing on.
Fixed bug where child grabbables could be grabbed if their MasterGrabbable was socketed.
Added backpack rigs to hexabody integration.
Fix Oculus and WMR menu button bindings for OpenXR
Fix HVRCockingHandle to handle initial grab offset better
Hand Strength Updates:
JointSettings on the hand and grabbable components are now deprecated, they will continue to work but will be removed in a future update.
PDStrength scriptable object is the replacement containing only the fields that are pertinent to the PD Controlled hands.
Fields that reference an existing PDStrength asset will display the editor in place for quick editing.
The following fields are added to replace the old ones:
HVRJointHand.Strength
HVRHexaBodyHands.Strength|OneHandedClimbStrength|TwoHandedClimbStrength
HVRGrabbable.OneHandStrength|TwoHandStrength
Included rig and hand prefabs are updated.
Teleporter: Momentum is now maintained for the hands and held objects when teleporting.
Physics hands now account for teleporter jumping large distances.
HVRSocketLink:
Permanently links a grabbable to a socket with optional return time lerping.
Replaces the now deprecated grabbable fields StartingSocket/LinkStartingSocket.
Filter setup is not required as the socket will only accept the linked object.
Example scene updated with socket example. Backpack on rig prefab updated.
HVRSocket: all rb properties restored when RemoveRigidbody mode is used.
HVRPlayerInputs: ForceGrabber activated options updated with GripAndTrigger, Trigger, GripOrTrigger.
HVRHandImpactHaptics: MaxForce used in haptic amplitude calculation will default to the hand's max force value.
HVRGunBase: added hit collider, rigidbody, and distance to the arguments passed to the Hit event.
HVRStringSocketFilter and HVRStringSocketable updated to hash it's string value for performance.
HVRPlayerController:
- Added GroundedRadiusFactor which will multiply with the player capsules radius for the grounded sphere cast check.
- Horizontal ground movement will take into consideration the angle of the ground the player is on.
2.9
Fixed grab indicators showing up even if they were marked disabled on the HVRGrabbable.
Fixed issue where CockingHandle would not lock forward if the controller was too far forward of the grab point.
Added HVRPoseZone: Uses a provided HVRHandPoser to pose the hand when the hand enters the overlap zone.
Demo KeyPad updated with a pose zone example.
HVRSocket: New 'PoseTag' field which links with HVRSocketable Poses field for saving orientation when socketed.
HVRSocketable: New Poses field with inspector interface to help save orientations for different socket types.
HVRGunBase: Added Hit event which passes the gun, hitpoint, normal, and direction variables.
HVRHandAnimator: Added 'HandOverride' transform field, allows HVRPosableHand component to be on a different component. VRIK IK targets is one example.
Bow: Fixed hand collision being re-enabled to early with the arrow.
Hand Prefabs: Added trigger collider with HVRHandTrigger component for easy hand detection by other components (HVRPoseZone).
Example Shotgun: modified two hand hold strengths to prevent forehand from moving the shotgun backward to easily.
2.8.7-2.8.8
Fixed hands ignoring collision with each other on the tech demo rig.
Fixed knuckles controllers grip hand animation when using OpenXR.
Fixed physics door not checking if second handle exists.
Fixed socketable throwing null error if instantiated and socketed in the same frame.
Fixed Camera Rig ignoring debug setting for up/down arrow if only the new input system was enabled.
Removed RemainsKinematic from HVRGrabbable and snapshotting/restoring of IsKinematic during the grab procedure. Users should use
grabbed and released events for this from now on for full control of this field without framework interference.
Auto Posing in editor mode randomly has issues when colliders are attached to a rigidbody, the hand poser editor will warn users of this now.
2.8.6
Fixed wheel collider line of sight check and dynamic pose
Fixed bug where force pull would not re-enable collision with the hand if dropped before it reached the hand.
Fixed IsBeingForcedGrabbed not being set to false on a successfull force pull to the hand.
Fixed HVRPhysicsDoor joint anchor not being set to zero sometimes
Fixed null coroutine error on HVRGrabbable if object was disabled prior to being released.
Fixed obsolete api call in hand poser editor in 2021.2 and up.
HVRPhysicsDoor upgraded to allow two door handles. Example scene swinging door updated with two separate handles. Web Docs updated.
Custom Hand Setup Wizard completed with tutorial in the web docs.
Virtualized HVRUIPointer methods.
Hand Posing now only works in scene view, prefab mode has issues when posing, a warning will display to alert the user.
Added new demo scene showing how to use hand animation parameters - 'scene_hand_squeeze'
Added commentary and tooltips to several helper components that were missing them.
2.8.5
Fixed an issue where socketed objects would scale differently based on it's rotation prior to being socketed due to AABB sizing.
Fixed trigger colliders being deleted on the ClonedHandModel process.
CloneHandModel defaulted to false on included hand prefabs as ParentHandModel is defaulted to false on new grabbable objects.
2.8.4
Fixed an issue with the version update check logic that was refreshing the asset database after compiles.

View File

@ -0,0 +1,55 @@
using HurricaneVR.Framework.Core.ScriptableObjects;
using HurricaneVR.Framework.Core.Utils;
using UnityEditor;
using UnityEngine;
namespace HurricaneVR.Editor
{
public class CustomContexts
{
[MenuItem("Assets/HVR/Convert to Strength", false, 1)]
private static void StrengthConvert(MenuCommand command)
{
foreach (var o in Selection.objects)
{
var path = AssetDatabase.GetAssetPath(o);
var js = AssetDatabase.LoadAssetAtPath<HVRJointSettings>(path);
if (!js)
continue;
var fileName = path.Replace(".asset", "");
fileName += "_Strength.asset";
var s = AssetDatabase.LoadAssetAtPath<PDStrength>(fileName);
if (!s)
{
s = ScriptableObject.CreateInstance<PDStrength>();
}
s.Mode = js.ApplyMode;
s.Spring = js.XDrive.Spring;
s.Damper = js.XDrive.Damper;
s.MaxForce = js.XDrive.MaxForce;
s.TorqueSpring = js.SlerpDrive.Spring;
s.TorqueDamper = js.SlerpDrive.Damper;
s.MaxTorque = js.SlerpDrive.MaxForce;
AssetUtils.CreateOrReplaceAsset(s, fileName);
}
}
[MenuItem("Assets/HVR/Convert to Strength", true, 1)]
private static bool StrengthConvertValidation()
{
foreach (var o in Selection.objects)
{
var path = AssetDatabase.GetAssetPath(o);
var js = AssetDatabase.LoadAssetAtPath<HVRJointSettings>(path);
if (!js)
return false;
}
return Selection.objects.Length > 0;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e2d14f6a173045b08af8717e276df756
timeCreated: 1666239275

View File

@ -0,0 +1,49 @@
using HurricaneVR.Framework.Core.Utils;
using UnityEditor;
using UnityEngine;
namespace HurricaneVR.Editor
{
[CustomPropertyDrawer(typeof(EmbeddedAttribute), true)]
public class EmbeddedAssetDrawer : PropertyDrawer
{
private EmbeddeAssetEditor _editor;
public EmbeddeAssetEditor Editor
{
get
{
if (_editor == null)
_editor = new EmbeddeAssetEditor();
return _editor;
}
}
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var a = attribute as EmbeddedAttribute;
Editor.DrawEditorCombo(position, fieldInfo.FieldType, label, property, $"Save {property.displayName}.", $"{property.displayName.Replace(" ", "_")}", "asset", string.Empty);
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
if (!property.isExpanded || property.objectReferenceValue == null)
{
return EditorGUIUtility.singleLineHeight;
}
float height = base.GetPropertyHeight(property, label) + EditorGUIUtility.singleLineHeight;
var so = new SerializedObject(property.objectReferenceValue);
var prop = so.GetIterator();
prop.NextVisible(true);
while (prop.NextVisible(true))
{
if (prop.name == "m_Script")
continue;
height += EditorGUIUtility.singleLineHeight;
}
return height * 1.2f;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d3003c99effe439d9d06c4e9334443ba
timeCreated: 1666146629

View File

@ -0,0 +1,181 @@
using System;
using System.Linq;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEditor.VersionControl;
using UnityEngine;
using UnityEngine.UIElements;
namespace HurricaneVR.Editor
{
/// <summary>
/// Helper for drawing embedded asset editors
/// </summary>
public class EmbeddeAssetEditor
{
/// <summary>
/// Free the resources in OnDisable()
/// </summary>
public void OnDisable()
{
DestroyEditor();
}
private readonly GUIContent m_CreateButtonGUIContent = new GUIContent("Create Asset", "Create new asset.");
UnityEditor.Editor m_Editor = null;
const int kIndentOffset = 3;
private Type _type;
public void DrawEditorCombo(Rect position, Type type, GUIContent label, SerializedProperty property, string title, string defaultName, string extension, string message)
{
_type = type;
DrawEditorCombo(position, property, title, defaultName, extension, message, false);
}
/// <summary>
/// Call this from OnInspectorGUI. Will draw the asset reference field, and
/// the embedded editor, or a Create Asset button, if no asset is set.
/// </summary>
private void DrawEditorCombo(Rect position, SerializedProperty property,
string title, string defaultName, string extension, string message,
bool indent)
{
UpdateEditor(property);
if (!m_Editor)
{
AssetFieldWithCreateButton(position, property, title, defaultName, extension, message);
return;
}
var rect = position;
var propRect = rect;
propRect.height = EditorGUIUtility.singleLineHeight;
EditorGUI.BeginChangeCheck();
EditorGUI.PropertyField(propRect, property);
if (EditorGUI.EndChangeCheck())
{
property.serializedObject.ApplyModifiedProperties();
UpdateEditor(property);
}
if (m_Editor)
{
Rect foldoutRect = new Rect(rect.x - kIndentOffset, rect.y, rect.width + kIndentOffset, EditorGUIUtility.singleLineHeight);
property.isExpanded = EditorGUI.Foldout(foldoutRect, property.isExpanded, GUIContent.none, true);
bool canEditAsset = AssetDatabase.IsOpenForEdit(m_Editor.target, StatusQueryOptions.UseCachedIfPossible);
GUI.enabled = canEditAsset;
if (property.isExpanded)
{
position.y += EditorGUIUtility.singleLineHeight;
var box = position;
box.height *= .9f;
EditorGUI.HelpBox(box, "CTRL+S to persist asset changes.", MessageType.None);
position.y += EditorGUIUtility.singleLineHeight;
EditorGUI.BeginChangeCheck();
var so = new SerializedObject(property.objectReferenceValue);
var prop = so.GetIterator();
while (prop.NextVisible(true))
{
if (prop.name == "m_Script")
continue;
position.height = EditorGUIUtility.singleLineHeight;
EditorGUI.PropertyField(position, prop);
position.y += EditorGUIUtility.singleLineHeight;
}
if (EditorGUI.EndChangeCheck())
{
so.ApplyModifiedProperties();
}
}
GUI.enabled = true;
if (m_Editor.target != null)
{
if (!canEditAsset && GUILayout.Button("Check out"))
{
Task task = Provider.Checkout(AssetDatabase.GetAssetPath(m_Editor.target), CheckoutMode.Asset);
task.Wait();
}
}
}
}
void AssetFieldWithCreateButton(Rect position, SerializedProperty property,
string title, string defaultName, string extension, string message)
{
EditorGUI.BeginChangeCheck();
float hSpace = 5;
float buttonWidth = GUI.skin.button.CalcSize(m_CreateButtonGUIContent).x;
var r = position;
r.width -= buttonWidth + hSpace;
EditorGUI.PropertyField(r, property);
r.x += r.width + hSpace;
r.width = buttonWidth;
if (GUI.Button(r, m_CreateButtonGUIContent))
{
string newAssetPath = EditorUtility.SaveFilePanelInProject(
title, defaultName, extension, message);
if (!string.IsNullOrEmpty(newAssetPath))
{
var asset = CreateAt(_type, newAssetPath);
property.objectReferenceValue = asset;
property.serializedObject.ApplyModifiedProperties();
}
}
if (EditorGUI.EndChangeCheck())
{
property.serializedObject.ApplyModifiedProperties();
UpdateEditor(property);
}
}
void DestroyEditor()
{
if (m_Editor != null)
{
UnityEngine.Object.DestroyImmediate(m_Editor);
m_Editor = null;
}
}
void UpdateEditor(SerializedProperty property)
{
property.serializedObject.ApplyModifiedProperties();
var target = property.objectReferenceValue;
if (m_Editor && m_Editor.target != target)
{
DestroyEditor();
}
if (target != null)
{
if (!m_Editor)
{
m_Editor = UnityEditor.Editor.CreateEditor(target);
}
}
}
public static ScriptableObject CreateAt(Type assetType, string assetPath)
{
ScriptableObject asset = ScriptableObject.CreateInstance(assetType);
if (!asset)
{
Debug.LogError("Failed to create instance of " + assetType.Name + " at " + assetPath);
return null;
}
AssetDatabase.CreateAsset(asset, assetPath);
return asset;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 63f79aabdd614d20a214af69939cd772
timeCreated: 1666142031

View File

@ -43,6 +43,10 @@ namespace HurricaneVR.Editor
value = EditorGUILayout.ObjectField(label, value, typeof(HVRJointSettings), false) as HVRJointSettings;
}
public static void StrengthField(string label, ref PDStrength value)
{
value = EditorGUILayout.ObjectField(label, value, typeof(PDStrength), false) as PDStrength;
}
public static void Header(string label)
{

View File

@ -9,7 +9,7 @@ namespace HurricaneVR.Editor
public class HVREditorManager
{
private const string HurricaneVRUploader = "HurricaneVRUploader";
public const string Version = "2.8.4";
public const string Version = "2.9.1f";
[InitializeOnLoadMethod]
private static void Hook()

View File

@ -7,13 +7,14 @@ using HurricaneVR.Framework.Core.HandPoser;
using HurricaneVR.Framework.Core.ScriptableObjects;
using HurricaneVR.Framework.Core.Utils;
using HurricaneVR.Framework.Shared;
using HurricaneVR.Framework.Shared.Utilities;
using HurricaneVR.Framework.Weapons;
using HurricaneVR.Framework.Weapons.Guns;
using HurricaneVR.Framework.Weapons.Guns.PartFinders;
using UnityEditor;
using UnityEngine;
using HVRPistol = HurricaneVR.Framework.Weapons.Guns.HVRPistol;
using Object = UnityEngine.Object;
using Zero;
namespace HurricaneVR.Editor
{
@ -26,8 +27,8 @@ namespace HurricaneVR.Editor
//private const string TwoHandPistol = "HandSettings/HVR_Pistol_TwoHand";
//private const string TwoHandLarge = "HandSettings/HVR_LargeWeapon_TwoHanded";
private const string TwoHandLargeStabilizer = "HandSettings/HVR_Stabilizer_TwoHanded";
private const string TwoHandPistolStabilizer = "HandSettings/HVR_Pistol_Stabilizer_TwoHanded";
private const string TwoHandLargeStabilizer = "HandSettings/HVR_Stabilizer_TwoHanded_Strength";
private const string TwoHandPistolStabilizer = "HandSettings/HVR_Pistol_Stabilizer_TwoHanded_Strength";
//private const string OneHandPistol = "HandSettings/HVR_Pistol_OneHand";
//private const string OneHandDefault = "HandSettings/HVR_DefaultHandSettings";
@ -48,7 +49,7 @@ namespace HurricaneVR.Editor
private float _gunMass = 1.5f;
private float _bulletSpeed = 80f;
private int _rpm = 900;
private FireType _firingType;
private GunFireType _firingType;
private HVRHandPose _gripPose;
private HVRHandPose _stabilizerPose;
@ -67,9 +68,9 @@ namespace HurricaneVR.Editor
private bool _stabilizerRequiresGripGrabbed = true;
private bool _stabilizerDropsOnGripReleased = true;
private float _cycleTime = .05f;
private HVRJointSettings _gripOneHand;
private HVRJointSettings _gripTwoHand;
private HVRJointSettings _stabilizerTwoHand;
private PDStrength _gripOneHand;
private PDStrength _gripTwoHand;
private PDStrength _stabilizerTwoHand;
private bool _ejectedBulletPooled = true;
private HVRRecoilSettings _recoilSettings;
private Vector2 _scrollPosition;
@ -127,7 +128,7 @@ namespace HurricaneVR.Editor
HVREditorExtensions.IntField("Rounds Per Minute", ref _rpm);
HVREditorExtensions.FloatField("Bullet Speed", ref _bulletSpeed);
_firingType = (FireType)EditorGUILayout.EnumPopup("Firing Mode", _firingType);
_firingType = (GunFireType)EditorGUILayout.EnumPopup("Firing Mode", _firingType);
var currentType = _gunType;
_gunType = (HVRGunType)EditorGUILayout.EnumPopup("Type", _gunType);
_hitLayerMask = LayerMaskDrawer.LayerMaskField("Hit Layer Mask", _hitLayerMask);
@ -179,9 +180,9 @@ namespace HurricaneVR.Editor
// PopulateDefaultHandSettings();
//}
HVREditorExtensions.JointField("Grip One Handed", ref _gripOneHand);
HVREditorExtensions.JointField("Grip Two Handed", ref _gripTwoHand);
HVREditorExtensions.JointField("Stabilizer Two Handed", ref _stabilizerTwoHand);
HVREditorExtensions.StrengthField("Grip One Handed", ref _gripOneHand);
HVREditorExtensions.StrengthField("Grip Two Handed", ref _gripTwoHand);
HVREditorExtensions.StrengthField("Stabilizer Two Handed", ref _stabilizerTwoHand);
GUILayout.Space(20f);
HVREditorExtensions.Header("SFX");
@ -377,8 +378,8 @@ namespace HurricaneVR.Editor
Undo.RegisterCreatedObjectUndo(root, _gunPrefab.name);
gunGrabbable = AddGrabbable(root, out var poser, out var gp);
gunGrabbable.OneHandJointSettings = _gripOneHand;
gunGrabbable.TwoHandJointSettings = _gripTwoHand;
gunGrabbable.OneHandStrength = _gripOneHand;
gunGrabbable.TwoHandStrength = _gripTwoHand;
poser.PrimaryPose.Pose = _gripPose;
gunGrabbable.HoldType = HVRHoldType.Swap;
gunGrabbable.RequireOverlapClearance = true;
@ -398,19 +399,19 @@ namespace HurricaneVR.Editor
private GameObject CreatePistol()
{
var root = CreateGun<ExtGunBase>(out var gunGrabbable, out var model, out var gun);
var root = CreateGun<HVRPistol>(out var gunGrabbable, out var model, out var gun);
return root;
}
private GameObject CreateAutomatic()
{
var root = CreateGun<ExtGunBase>(out var gunGrabbable, out var model, out var gun);
var root = CreateGun<HVRAutomaticGun>(out var gunGrabbable, out var model, out var gun);
return root;
}
private GameObject CreatePumpShotgun()
{
var root = CreateGun<ExtGunShotgun>(out var gunGrabbable, out var model, out var gun);
var root = CreateGun<HVRShotgun>(out var gunGrabbable, out var model, out var gun);
var mag = root.AddComponent<HVRShotgunMagazine>();
gun.ChambersAfterFiring = false;
mag.MaxCount = 5;
@ -454,9 +455,8 @@ namespace HurricaneVR.Editor
//grabbable.TrackingType = HVRGrabTracking.None;
grabbable.HoldType = HVRHoldType.OneHand;
grabbable.DisableHandCollision = true;
grabbable.PoseImmediately = true;
grabbable.ForceGrabbable = false;
grabbable.TwoHandJointSettings = _stabilizerTwoHand;
grabbable.TwoHandStrength = _stabilizerTwoHand;
grabbable.ExtraIgnoreCollisionParents = new List<Transform>() { gunGrabbable.Rigidbody.transform };
if (_stabilizerRequiresGripGrabbed)
@ -500,6 +500,10 @@ namespace HurricaneVR.Editor
gun.RecoilComponent = gun.gameObject.AddComponent<HVRRecoil>();
gun.RecoilComponent.Settings = _recoilSettings;
gun.GunSounds = gun.gameObject.AddComponent<HVRGunSounds>();
gun.GunSounds.Fired = FiredSFX;
gun.GunSounds.OutOfAmmo = DryFireSFX;
gun.GunSounds.SlideBack = CockedBackSFX;
gun.GunSounds.SlideForward = CockedForwardSFX;
gun.Bolt = bolt;
var adjustTransforms = AddAdjustTransform(gun.gameObject);

View File

@ -14,6 +14,12 @@ using UnityEngine;
using UnityEngine.UIElements;
using Object = UnityEngine.Object;
#if UNITY_2021_2_OR_NEWER
using UnityEditor.SceneManagement;
#else
using UnityEditor.Experimental.SceneManagement;
#endif
namespace HurricaneVR.Editor
{
[CustomEditor(typeof(HVRHandPoser))]
@ -108,10 +114,7 @@ namespace HurricaneVR.Editor
private HVRHandPoseBlend PrimaryPose
{
get
{
return Poser.PrimaryPose;
}
get { return Poser.PrimaryPose; }
set
{
Poser.PrimaryPose = value;
@ -121,10 +124,7 @@ namespace HurricaneVR.Editor
public HVRHandPose SelectedPose
{
get
{
return SelectedBlendPose?.Pose;
}
get { return SelectedBlendPose?.Pose; }
set
{
if (SelectedBlendPose == null) return;
@ -184,7 +184,6 @@ namespace HurricaneVR.Editor
{
SceneView.duringSceneGui -= OnSceneGUI2;
SceneView.duringSceneGui += OnSceneGUI2;
}
@ -225,7 +224,6 @@ namespace HurricaneVR.Editor
}
foreach (var c in cleanup) _map.Remove(c);
}
private void GetHands(ref HVRPosableHand leftHand, ref HVRPosableHand rightHand)
@ -414,6 +412,7 @@ namespace HurricaneVR.Editor
{
selectedFinger = i;
}
selectedBone = bone.Transform;
}
}
@ -425,6 +424,9 @@ namespace HurricaneVR.Editor
}
}
private bool _inPrefabMode;
private bool _active;
private void OnEnable()
{
Poser = target as HVRHandPoser;
@ -452,13 +454,30 @@ namespace HurricaneVR.Editor
_root = new VisualElement();
_tree = UnityEngine.Resources.Load<VisualTreeAsset>("HVRHandPoserEditor");
var stage = PrefabStageUtility.GetPrefabStage(Poser.gameObject);
_inPrefabMode = stage != null;
_active = true;
var s = _root.schedule.Execute(EditorUpdate);
s.Every(1000);
s.Until(() => !_active);
}
private void EditorUpdate()
{
CheckRigidBody();
}
private void OnDisable()
{
_active = false;
}
private void CreatePoseIfNeeded()
{
if (PrimaryPose.Pose == null && HVRSettings.Instance.OpenHandPose)
{
_root.schedule.Execute(() =>
{
PrimaryPose.SetDefaults();
@ -473,7 +492,6 @@ namespace HurricaneVR.Editor
public override VisualElement CreateInspectorGUI()
{
_root.Clear();
_tree.CloneTree(_root);
@ -495,14 +513,23 @@ namespace HurricaneVR.Editor
SetupHandButtons();
SetupAutoPoseButtons();
//can't remember why I would add this field on the ui...
//_selectionIndexField = new IntegerField("SelectedIndex");
//_selectionIndexField.bindingPath = "SelectionIndex";
//_selectionIndexField.RegisterValueChangedCallback(evt =>
//{
// if (PosesListView.selectedIndex != evt.newValue) PosesListView.selectedIndex = evt.newValue;
//});
//_root.Add(_selectionIndexField);
_selectionIndexField = new IntegerField("SelectedIndex");
_selectionIndexField.bindingPath = "SelectionIndex";
_selectionIndexField.RegisterValueChangedCallback(evt =>
if (_inPrefabMode)
{
if (PosesListView.selectedIndex != evt.newValue) PosesListView.selectedIndex = evt.newValue;
});
_root.Add(_selectionIndexField);
_root.Q("MirrorAxis").style.display = DisplayStyle.None;
_root.Q("boxPreview").style.display = DisplayStyle.None;
}
else
{
_root.Q("warning").style.display = DisplayStyle.None;
PreviewLeftToggle = _root.Q<Toggle>("PreviewLeft");
PreviewLeftToggle.BindProperty(SP_PreviewLeft);
@ -513,6 +540,7 @@ namespace HurricaneVR.Editor
PreviewRightToggle.RegisterValueChangedCallback(OnPreviewRightChanged);
ToggleLeftAutoPose = _root.Q<Toggle>("LeftAutoPose");
ToggleLeftAutoPose.BindProperty(SP_LeftAutoPose);
ToggleRightAutoPose = _root.Q<Toggle>("RightAutoPose");
ToggleRightAutoPose.BindProperty(SP_RightAutoPose);
@ -588,6 +616,8 @@ namespace HurricaneVR.Editor
{
SP_RightAutoPose.boolValue = false;
}
}
serializedObject.ApplyModifiedProperties();
@ -650,6 +680,7 @@ namespace HurricaneVR.Editor
{
return;
}
_rightPhysicsPoser.LiveUpdate = evt.newValue;
}
}
@ -663,6 +694,7 @@ namespace HurricaneVR.Editor
{
return;
}
_leftPhysicsPoser.LiveUpdate = evt.newValue;
}
}
@ -709,12 +741,10 @@ namespace HurricaneVR.Editor
{
_rightPhysicsPoser.LiveUpdate = SP_RightAutoPose.boolValue;
}
}
private void OnPreviewLeftChanged(ChangeEvent<bool> evt)
{
CreatePoseIfNeeded();
if (FullBody)
@ -757,6 +787,18 @@ namespace HurricaneVR.Editor
}
}
private void CheckRigidBody()
{
var g = Poser.GetComponentInParent<HVRGrabbable>();
Rigidbody rb = null;
if (g)
{
rb = g.gameObject.GetComponent<Rigidbody>();
}
_root.Q("lblAutoPoseWarning").style.display = rb ? DisplayStyle.Flex : DisplayStyle.None;
}
private void UpdateBodyPreview(HVRHandPoseData leftpose, HVRHandPoseData rightpose, bool previewLeft, bool previewRight, bool poseChanged = false)
{
if (!previewRight && !previewLeft)
@ -769,6 +811,7 @@ namespace HurricaneVR.Editor
SetupIKTarget(previewLeft, "LeftIKTarget", out var dummy);
SetupIKTarget(previewRight, "RightIKTarget", out var dummy2);
}
return;
}
@ -863,7 +906,6 @@ namespace HurricaneVR.Editor
}
SceneView.RepaintAll();
serializedObject.ApplyModifiedProperties();
@ -958,6 +1000,9 @@ namespace HurricaneVR.Editor
private void OnSelectedPoseChanged(ChangeEvent<Object> evt)
{
if (_inPrefabMode)
return;
if (evt.newValue != null)
{
var newPose = evt.newValue as HVRHandPose;
@ -1289,7 +1334,6 @@ namespace HurricaneVR.Editor
rightHand.Pose(right);
}
}
};
var mirrorLeft = _root.Q<Button>("ButtonMirrorLeft");
@ -1328,8 +1372,6 @@ namespace HurricaneVR.Editor
leftHand.Pose(left);
}
}
};
}
@ -1391,10 +1433,7 @@ namespace HurricaneVR.Editor
SelectedPoseField.bindingPath = "Pose";
//SelectedPoseField.RegisterValueChangedCallback(OnSelectedPoseChanged);
////unity decide to fk with everything in 2020, hack to handle selected pose field from firing it's change event on enable that didn't happen in 2019..
var schedule = container.schedule.Execute(() =>
{
SelectedPoseField.RegisterValueChangedCallback(OnSelectedPoseChanged);
});
var schedule = container.schedule.Execute(() => { SelectedPoseField.RegisterValueChangedCallback(OnSelectedPoseChanged); });
schedule.StartingIn(1000);
}
@ -1417,7 +1456,6 @@ namespace HurricaneVR.Editor
#if UNITY_2021_1_OR_NEWER
PosesListView.onSelectionChange += OnPoseSelectionChanged;
#else
@ -1455,6 +1493,9 @@ namespace HurricaneVR.Editor
SelectedIndex = PosesListView.selectedIndex;
var poseName = SelectedPose == null ? "None" : SelectedPose.name;
blendEditorRoot.Q<Label>("lblSelectedPose").text = $"Selected Pose: {poseName}";
BindBlendContainer();
}
@ -1469,7 +1510,6 @@ namespace HurricaneVR.Editor
if (index == PrimaryIndex)
{
label.AddToClassList("primarypose");
}
if (index < Poser.PoseNames.Count)
@ -1509,7 +1549,11 @@ namespace HurricaneVR.Editor
serializedObject.ApplyModifiedProperties();
#if UNITY_2021_2_OR_NEWER
PosesListView?.Rebuild();
#else
PosesListView?.Refresh();
#endif
}
}

View File

@ -207,8 +207,8 @@ namespace HurricaneVR
Left.localPosition = Vector3.zero;
Right.localPosition = Vector3.zero;
var leftPrefab = PrefabUtility.SaveAsPrefabAssetAndConnect(Left.gameObject, "Assets/LeftHandPrefab.prefab", InteractionMode.UserAction);
var rightPrefab = PrefabUtility.SaveAsPrefabAssetAndConnect(Right.gameObject, "Assets/RightHandPrefab.prefab", InteractionMode.UserAction);
var leftPrefab = PrefabUtility.SaveAsPrefabAssetAndConnect(Left.gameObject, $"Assets/{Left.name}.prefab", InteractionMode.UserAction);
var rightPrefab = PrefabUtility.SaveAsPrefabAssetAndConnect(Right.gameObject, $"Assets/{Right.name}.prefab", InteractionMode.UserAction);
var so = new SerializedObject(HVRSettings.Instance);
var left = so.FindProperty("LeftHand");
@ -248,6 +248,35 @@ namespace HurricaneVR
SetupFallback(rightHand);
PosesAssigned = true;
EditorApplication.delayCall += () =>
{
var leftPath = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(LeftPhysics.gameObject);
var rightPath = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(RightPhysics.gameObject);
Debug.Log($"Applying pose overrides to {leftPath} and {rightPath}.");
PrefabUtility.ApplyObjectOverride(LeftPhysics, leftPath, InteractionMode.AutomatedAction);
PrefabUtility.ApplyObjectOverride(RightPhysics, rightPath, InteractionMode.AutomatedAction);
PrefabUtility.ApplyObjectOverride(LeftPoser, leftPath, InteractionMode.AutomatedAction);
PrefabUtility.ApplyObjectOverride(RightPoser, rightPath, InteractionMode.AutomatedAction);
//if (leftHand.FallbackPoser)
//{
// var so = new SerializedObject(leftHand.FallbackPoser);
// var blend = so.FindProperty("PrimaryPose");
// var pose = blend.FindPropertyRelative("Pose");
// PrefabUtility.ApplyPropertyOverride(pose, leftPath, InteractionMode.AutomatedAction);
//}
//if (rightHand.FallbackPoser)
//{
// var so = new SerializedObject(rightHand.FallbackPoser);
// var blend = so.FindProperty("PrimaryPose");
// var pose = blend.FindPropertyRelative("Pose");
// PrefabUtility.ApplyPropertyOverride(pose, rightPath, InteractionMode.AutomatedAction);
//}
};
}
@ -454,8 +483,8 @@ namespace HurricaneVR
if (GUILayout.Button("Detect Mirror"))
{
LeftHand.DetectBoneAxes(RightHand, LeftHand.transform.parent.forward, LeftHand.transform.parent.up);
RightHand.DetectBoneAxes(LeftHand, LeftHand.transform.parent.forward, LeftHand.transform.parent.up);
DetectBoneAxes(LeftHand, RightHand, LeftHand.transform.parent.forward, LeftHand.transform.parent.up);
DetectBoneAxes(RightHand, LeftHand, LeftHand.transform.parent.forward, LeftHand.transform.parent.up);
_badMirrorText = "";
_badMirror = false;
@ -477,6 +506,40 @@ namespace HurricaneVR
}
}
public void DetectBoneAxes(HVRPosableHand hand, HVRPosableHand otherHand, Vector3 forward, Vector3 up)
{
var so = new SerializedObject(hand);
var fingers = so.FindProperty("_fingers");
for (var i = 0; i < fingers.arraySize; i++)
{
var spFinger = fingers.GetArrayElementAtIndex(i);
var spBones = spFinger.FindPropertyRelative("Bones");
for (var j = 0; j < spBones.arraySize; j++)
{
var spBone = spBones.GetArrayElementAtIndex(j);
var bone = hand.Fingers[i].Bones[j];
var targetBone = otherHand.Fingers[i].Bones[j];
// Get local orthogonal axes of the right hand pointing forward and up
var axis1 = HVRPosableHand.GetSignedAxisVectorToDirection(bone.Transform.rotation, forward);
var axis2 = HVRPosableHand.GetSignedAxisVectorToDirection(bone.Transform.rotation, up);
var targetAxis1 = HVRPosableHand.GetSignedAxisVectorToDirection(targetBone.Transform.rotation, forward);
var targetAxis2 = HVRPosableHand.GetSignedAxisVectorToDirection(targetBone.Transform.rotation, up);
spBone.FindPropertyRelative(nameof(HVRPosableBone.Forward)).vector3Value = axis1;
spBone.FindPropertyRelative(nameof(HVRPosableBone.Up)).vector3Value = axis2;
spBone.FindPropertyRelative(nameof(HVRPosableBone.OtherForward)).vector3Value = targetAxis1;
spBone.FindPropertyRelative(nameof(HVRPosableBone.OtherUp)).vector3Value = targetAxis2;
}
}
so.ApplyModifiedProperties();
}
private void ValidateMirrorSettings(HVRPosableHand hand)
{
for (var i = 0; i < hand.Fingers.Length; i++)
@ -514,9 +577,8 @@ namespace HurricaneVR
" The default order matches most hand rigs. If your hand has less than 5 fingers, set those slots to 'None'\r\n" +
"\r\n3. Update the bone count for each finger.\r\n" +
"\r\n4. Some hand rigs may have an uneven hierarchy, update the Root Offset field with the # of bones between the parent and first bone.\r\n" +
"\r\n5. If the finger has Tip / End transforms already, enable 'Has Tip', otherwise they will be auto generated on the last bone.\r\n" +
"\r\n6. Press Setup and verify each HVRPosableHand fingers have the proper Root, Tip, and Bone counts assigned. Move the tip transforms to the center of the finger pad.\r\n" +
"\r\n7. Move the 'Palm' transforms that were added to the hands to the center of the palm (barely touching the surface) with the forward (blue) axis facing out of the palm.", helpBoxStyle);
"\r\n5. Press Setup and verify each HVRPosableHand fingers have the proper Root, Tip, and Bone counts assigned. Move the tip transforms to the center of the finger pad.\r\n" +
"\r\n6. Move the 'Palm' transforms that were added to the hands to the center of the palm (barely touching the surface) with the forward (blue) axis facing out of the palm.", helpBoxStyle);
//int i = 0;
//bool up = false;
@ -532,7 +594,6 @@ namespace HurricaneVR
HVREditorExtensions.EnumField("Finger", ref s.Finger);
HVREditorExtensions.IntField("Bones", ref s.BoneCount);
HVREditorExtensions.IntField("Root Offset", ref s.BoneOffset);
HVREditorExtensions.Toggle("Has Tip", ref s.HasTip);
//if (GUILayout.Button("^"))
//{
@ -673,7 +734,6 @@ namespace HurricaneVR
animator.DefaultPoseHand = false;
animator.PoseHand = true;
animator.PhysicsPoser = physicsPoser;
animator.Hand = hand;
animator.DefaultPoser = poser;
@ -724,8 +784,6 @@ namespace HurricaneVR
if (finger.Bones.Count > 0)
{
if (!s.HasTip)
{
var last = finger.Bones.Last();
var tipName = s.Finger.ToString() + " Tip";
@ -744,15 +802,7 @@ namespace HurricaneVR
{
finger.Tip = existing;
}
}
else
{
var last = finger.Bones.Last();
if (s.HasTip && last.Transform.childCount > 0)
{
finger.Tip = last.Transform.GetChild(0);
}
}
finger.Root = finger.Bones[0].Transform;
}
@ -825,7 +875,6 @@ namespace HurricaneVR
public Finger Finger;
public int BoneCount = 3;
public int BoneOffset = 0;
public bool HasTip = false;
public int Index;
}

View File

@ -29,7 +29,8 @@ namespace HurricaneVR.Editor
private const string URLHandGrabber = "https://cloudwalker2020.github.io/HurricaneVR-Docs/manual/hands.html";
private const string URLSockets = "https://cloudwalker2020.github.io/HurricaneVR-Docs/manual/sockets.html";
private const string URLSetup = "https://cloudwalker2020.github.io/HurricaneVR-Docs/manual/setup.html";
private const string URLCustomHand = "https://cloudwalker2020.github.io/HurricaneVR-Docs/manual/hand_setup.html";
private const string URLDoor = "https://cloudwalker2020.github.io/HurricaneVR-Docs/manual/components/door.html";
private const string URLDiscord = "https://discord.com/invite/7QUXEcuwKY";
private const string DEFINESteamVR = "HVR_STEAMVR";
@ -116,6 +117,8 @@ namespace HurricaneVR.Editor
SetupUrl("btnHandGrabber", URLHandGrabber);
SetupUrl("btnDiscord", URLDiscord);
SetupUrl("btnSetup", URLSetup);
SetupUrl("btnCustomHand", URLCustomHand);
SetupUrl("btnDoorSetup", URLDoor);
//SetupUrl("BtnPatreon", URLPatreon);
UpdatePanel(notesPanel);

View File

@ -0,0 +1,146 @@
using System;
using System.Collections.Generic;
using System.Linq;
using HurricaneVR.Framework.Core.Grabbers;
using HurricaneVR.Framework.Core.Sockets;
using HurricaneVR.Framework.Core.Utils;
using UnityEditor;
using UnityEngine;
namespace HurricaneVR.Editor
{
[CustomEditor(typeof(HVRSocketable), editorForChildClasses: true)]
public class HVRSocketableEditor : UnityEditor.Editor
{
private bool _expand;
private HVRSocket _socket;
private HVRSocketable component;
private Vector3 _pos;
private Quaternion _rot;
private static Dictionary<HVRSocketable, HVRSocket> _cache = new Dictionary<HVRSocketable, HVRSocket>();
private void OnEnable()
{
component = target as HVRSocketable;
if (_cache.TryGetValue(component, out var socket))
{
_socket = socket;
}
}
public override void OnInspectorGUI()
{
// _expand = EditorGUILayout.Foldout(_expand, "Posing Interface");
EditorGUILayout.LabelField("Posing:");
//if (_expand)
{
var temp = _socket;
HVREditorExtensions.ObjectField("Socket", ref _socket);
if (_socket)
{
if (string.IsNullOrWhiteSpace(_socket.PoseTag))
{
EditorGUILayout.HelpBox("Socket's PoseTag field is not assigned.", MessageType.Warning);
}
else
{
// if (GUILayout.Button("Snapshot Transform"))
// {
// _pos = component.transform.position;
// _rot = component.transform.rotation;
// }
//
// if (GUILayout.Button("Restore Transform"))
// {
// Undo.RecordObject(component.transform, "Restore Socketable");
// component.transform.SetPositionAndRotation(_pos, _rot);
// }
if (_socket.ScaleGrabbable)
{
if (GUILayout.Button("Apply Socket Scale"))
{
Undo.RecordObject(component.transform, "Editor Socket Scale");
component.transform.localScale = _socket.ComputeScale(component);
}
if (GUILayout.Button("Reset Scale"))
{
Undo.RecordObject(component.transform, "Editor Socket Scale");
component.transform.localScale = Vector3.one;
}
}
if (GUILayout.Button("Move to Socket"))
{
Undo.RecordObject(component.transform, "Move to Socket");
component.transform.position = _socket.transform.position;
component.transform.rotation = _socket.transform.rotation;
}
if (GUILayout.Button("Save Pose"))
{
var poses = serializedObject.FindProperty("Poses");
var i = component.Poses.FindIndex(e => e.SocketTag == _socket.PoseTag);
if (i < 0)
{
i = poses.arraySize;
poses.InsertArrayElementAtIndex(i);
}
var pose = poses.GetArrayElementAtIndex(i);
pose.FindPropertyRelative("Position").vector3Value = _socket.transform.InverseTransformPoint(component.transform.position);
pose.FindPropertyRelative("EulerAngles").vector3Value = (Quaternion.Inverse(_socket.transform.rotation) * component.transform.rotation).eulerAngles;
pose.FindPropertyRelative("SocketTag").stringValue = _socket.PoseTag;
serializedObject.ApplyModifiedProperties();
}
}
}
else
{
if(GUILayout.Button("Find Closest Socket"))
{
var dist = float.MaxValue;
HVRSocket closest = null;
foreach (var socket in FindObjectsOfType<HVRSocket>())
{
if (socket.transform.IsChildOf(component.transform))
{
continue;
}
var d = Vector3.Distance(component.transform.position, socket.transform.position);
if (d < dist)
{
dist = d;
closest = socket;
}
}
_socket = closest;
}
}
if (temp && !_socket)
{
_cache[component] = null;
}
else if (!temp && _socket)
{
_cache[component] = _socket;
}
}
EditorGUILayout.Space();
base.OnInspectorGUI();
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 50bc40950ea34e579fb36b46f4d10e85
timeCreated: 1661143344

View File

@ -8,15 +8,20 @@ namespace HurricaneVR.Editor
public class HVRSocketableTagsEditor : UnityEditor.Editor
{
private HVRSocketableTags tags;
private SerializedProperty SPIdentifier;
private void OnEnable()
{
tags = target as HVRSocketableTags;
SPIdentifier = serializedObject.FindProperty(nameof(HVRSocketableTags.Identifier));
}
public override void OnInspectorGUI()
{
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
EditorGUILayout.PropertyField(SPIdentifier);
GUILayout.Space(5);
for (int i = 0; i < 32; i++)

View File

@ -1,9 +1,7 @@
{
"name": "HurricaneVR.Editor",
"rootNamespace": "",
"references": [
"HurricaneVR.Framework",
"Zero"
"HurricaneVR.Framework"
],
"includePlatforms": [
"Editor"

View File

@ -1,6 +1,9 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements">
<ui:BindableElement name="BlendEditorRoot" style="height: auto; flex-grow: 1;">
<ui:BindableElement name="BlendEditorRoot" class="unity-box" style="height: auto; flex-grow: 1;">
<Style src="HVRBlendEditor.uss" />
<ui:VisualElement style="margin-top: 4px;">
<ui:Label text="Label" name="lblSelectedPose" style="font-size: 20px; -unity-font-style: bold; margin-left: 8px;" />
</ui:VisualElement>
<ui:VisualElement class="HandsContainer">
<ui:VisualElement name="CurlContainer" class="unity-box CurlContainer" style="flex-grow: 1;">
<ui:Label text="Finger Curls:" class="HandLabel" />

View File

@ -16,8 +16,11 @@
<ui:ListView name="Poses" style="flex-grow: 5;" />
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement name="warning">
<ui:Label text="Posing is not available while in Prefab Mode." style="height: 46px; color: rgb(217, 183, 9); -unity-font-style: bold; font-size: 20px; white-space: normal; margin-bottom: 10px;" />
</ui:VisualElement>
<uie:EnumField label="MirrorAxis" value="X" name="MirrorAxis" binding-path="MirrorAxis" />
<ui:Instance template="HandSettingsTemplate" />
<ui:Instance template="HandSettingsTemplate" name="boxPreview" />
<ui:Instance template="BlendEditorTemplate" />
</ui:Box>
</ui:UXML>

View File

@ -1,6 +1,9 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements">
<ui:VisualElement>
<Style src="HVRHandPoserEditor.uss" />
<ui:VisualElement name="lblAutoPoseWarning">
<ui:Label text="Rigidbody detected, if dynamic posing doesn&apos;t work, remove it temporarily." style="font-size: 18px; color: rgb(250, 235, 20); flex-wrap: nowrap; margin-bottom: 10px; height: 50px; white-space: normal;" />
</ui:VisualElement>
<ui:VisualElement class="HandsContainer">
<ui:VisualElement name="LeftHandContainer" class="unity-box HandContainer">
<ui:Label text="Left Hand:" class="HandLabel" />
@ -25,7 +28,7 @@
<ui:Button name="ButtonOpenRight" text="Open" class="HandMirrorButton" style="flex-basis: auto; flex-grow: 1;" />
<ui:Button name="ButtonCloseRight" text="Close" class="HandMirrorButton" style="flex-grow: 1; flex-basis: auto;" />
</ui:VisualElement>
<ui:VisualElement style="flex-direction: row; flex-basis: 28px;">
<ui:VisualElement style="flex-direction: row; flex-basis: 28px; flex-wrap: wrap;">
<ui:Button name="ButtonMirrorLeft" text="Mirror" class="HandMirrorButton" style="flex-basis: auto; flex-grow: 1;" />
<ui:Button name="ButtonFocusRight" text="Focus" class="HandMirrorButton" style="flex-grow: 1; flex-basis: auto;" />
<ui:Button name="RightExpand" text="+" class="HandMirrorButton" style="flex-grow: 1; flex-basis: auto;" />

View File

@ -9,6 +9,8 @@
<ui:Button text="Grabbable w/ Pose" name="BtnTutBasicGrabbable" class="tutorial-button docs-button" />
<ui:Button text="Sockets" name="btnSockets" class="docs-button" />
<ui:Button text="FinalIK (VRIK)" name="BtnVRIKSetup" class="docs-button" />
<ui:Button text="Custom Hand Setup" name="btnCustomHand" class="docs-button" />
<ui:Button text="Door Setup" name="btnDoorSetup" class="docs-button" />
<ui:Label text="Other" style="padding-top: 12px;" />
<ui:Button text="Discord Server" name="btnDiscord" class="docs-button" />
</ui:VisualElement>

View File

@ -12,28 +12,22 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
version: 1
--- !u!21 &2100000
Material:
serializedVersion: 8
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: GrabbableHighlight
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _EMISSION
- _ENVIRONMENTREFLECTIONS_OFF
- _SPECULAR_SETUP
m_InvalidKeywords:
- _GLOSSYREFLECTIONS_OFF
m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION _GLOSSYREFLECTIONS_OFF
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
stringTagMap:
RenderType: Opaque
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
@ -82,31 +76,15 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossinessSource: 0
@ -119,7 +97,7 @@ Material:
- _ReceiveShadows: 1
- _SampleGI: 0
- _Shininess: 0
- _Smoothness: 0
- _Smoothness: 0.5
- _SmoothnessSource: 0
- _SmoothnessTextureChannel: 0
- _SpecSource: 0
@ -127,11 +105,10 @@ Material:
- _SrcBlend: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor: {r: 0.21960786, g: 0.21960786, b: 0.21960786, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 9.921825, g: 2.8171844, b: 0.42374724, a: 1}
- _EmissionColor: {r: 2.837894, g: 1.6012586, b: 0.6827009, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@ -2,23 +2,19 @@
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Hand
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _ENVIRONMENTREFLECTIONS_OFF
m_InvalidKeywords:
- _GLOSSYREFLECTIONS_OFF
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
stringTagMap:
RenderType: Opaque
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
@ -67,31 +63,15 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossinessSource: 0
@ -103,7 +83,7 @@ Material:
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Shininess: 0
- _Smoothness: 0
- _Smoothness: 0.5
- _SmoothnessSource: 0
- _SmoothnessTextureChannel: 0
- _SpecSource: 0
@ -114,11 +94,10 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor: {r: 0.8584906, g: 0.8467471, b: 0.74105555, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &4878254909249241604
MonoBehaviour:
m_ObjectHideFlags: 11
@ -131,4 +110,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
version: 1

View File

@ -1,43 +1,23 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-46342407892727345
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
--- !u!21 &2100000
Material:
serializedVersion: 8
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: OculusTouchForQuestAndRiftS_Material
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_Shader: {fileID: 10703, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
stringTagMap:
RenderType: Opaque
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: a53d1d4e8207acf45b310f189c342b70, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
@ -74,54 +54,23 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _Cull: 2
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossinessSource: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Shininess: 0
- _Smoothness: 0.5
- _SmoothnessSource: 0
- _SmoothnessTextureChannel: 0
- _SpecSource: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.21960786, g: 0.21960786, b: 0.21960786, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
m_BuildTextureStacks: []

View File

@ -2,29 +2,23 @@
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TeleportMarker
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
stringTagMap:
RenderType: Opaque
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
@ -61,35 +55,11 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
@ -97,32 +67,11 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.006109435, g: 0.8308824, b: 0.7284968, a: 0.5}
- _Color: {r: 0.006109435, g: 0.8308824, b: 0.7284968, a: 0.5}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &4148255306042200568
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5

View File

@ -29,7 +29,6 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1846097449786136922}
m_Father: {fileID: 1846097449257274088}
@ -63,7 +62,6 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.9098039}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@ -103,7 +101,6 @@ MonoBehaviour:
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1 &1846097449257274101
GameObject:
m_ObjectHideFlags: 0
@ -134,7 +131,6 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0.01306337, z: 0, w: 0.9999147}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.0050000004, y: 0.005, z: 0.0050000004}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1846097448371537327}
m_Father: {fileID: 0}
@ -188,7 +184,6 @@ MonoBehaviour:
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 20
m_PresetInfoIsWorld: 1
--- !u!222 &1846097449257274091
CanvasRenderer:
m_ObjectHideFlags: 0
@ -238,7 +233,6 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.069}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1846097448371537327}
m_RootOrder: 0
@ -271,7 +265,6 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0.9990312, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:

View File

@ -1,87 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &6618112662589731389
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1596500242942430993, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: Preview
value:
objectReference: {fileID: 0}
- target: {fileID: 1596500242942430993, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: DoPreview
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1596500242942430993, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: SelectedPose
value:
objectReference: {fileID: 11400000, guid: 3195f5271090d494f8a7cc10c2e5c898, type: 2}
- target: {fileID: 2334803453370094399, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9990483
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_LocalRotation.y
value: 0.043619405
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 5
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7050223169496405804, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_Name
value: HVR_CustomHandLeft Variant
objectReference: {fileID: 0}
- target: {fileID: 7050223169496405807, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7050223169496405807, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7050223169496405807, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7050223169496405807, guid: bb680487e200bb1458405debc0da3606, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 90
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: bb680487e200bb1458405debc0da3606, type: 3}
--- !u!1 &4183614227780674833 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7050223169496405804, guid: bb680487e200bb1458405debc0da3606, type: 3}
m_PrefabInstance: {fileID: 6618112662589731389}
m_PrefabAsset: {fileID: 0}
--- !u!114 &6585287645860019873
MonoBehaviour:
m_ObjectHideFlags: 0
@ -94,9 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1ebbffaca5ed8a340ae381fb8a5695d8, type: 3}
m_Name:
m_EditorClassIdentifier:
PoseHand: 1
DefaultPoseHand: 1
DynamicPoseSpeed: 16
PosePosAndRot: 1
FingerCurlSpeed: 16
PhysicsPoser: {fileID: 0}
Hand: {fileID: 5620398756903288108}
DefaultPoser: {fileID: 7795976131308540296}
@ -118,8 +35,6 @@ MonoBehaviour:
BodyPreview: {fileID: 0}
PreviewLeft: 0
PreviewRight: 0
LeftAutoPose: 0
RightAutoPose: 0
SelectionIndex: 0
PoseNames:
- 'Primary: OculusCustomHandOpen'
@ -128,12 +43,12 @@ MonoBehaviour:
Pose: {fileID: 11400000, guid: 3195f5271090d494f8a7cc10c2e5c898, type: 2}
Weight: 1
Mask: 0
Disabled: 0
Type: 0
Speed: 16
AnimationParameter: None
ButtonParameter: 1
Button: 0
Disabled: 0
ThumbType: 1
IndexType: 1
MiddleType: 1
@ -148,12 +63,12 @@ MonoBehaviour:
- Pose: {fileID: 11400000, guid: f6a50a26271c0f44cbbcbc7307260d31, type: 2}
Weight: 1
Mask: 0
Disabled: 0
Type: 0
Speed: 16
AnimationParameter: None
ButtonParameter: 0
Button: 0
Disabled: 0
ThumbType: 1
IndexType: 1
MiddleType: 1
@ -166,9 +81,111 @@ MonoBehaviour:
PinkyStart: 0
ReferencePose: {fileID: 0}
MirrorAxis: 0
--- !u!1001 &6618112662589731389
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1596500242942430993, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: Preview
value:
objectReference: {fileID: 0}
- target: {fileID: 1596500242942430993, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: DoPreview
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1596500242942430993, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: SelectedPose
value:
objectReference: {fileID: 11400000, guid: 3195f5271090d494f8a7cc10c2e5c898,
type: 2}
- target: {fileID: 2334803453370094399, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.9990483
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.043619405
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 5
objectReference: {fileID: 0}
- target: {fileID: 5580718291316323345, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7050223169496405804, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_Name
value: HVR_CustomHandLeft Variant
objectReference: {fileID: 0}
- target: {fileID: 7050223169496405807, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7050223169496405807, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7050223169496405807, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7050223169496405807, guid: bb680487e200bb1458405debc0da3606,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 90
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: bb680487e200bb1458405debc0da3606, type: 3}
--- !u!1 &4183614227780674833 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7050223169496405804, guid: bb680487e200bb1458405debc0da3606,
type: 3}
m_PrefabInstance: {fileID: 6618112662589731389}
m_PrefabAsset: {fileID: 0}
--- !u!114 &5620398756903288108 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1596500242942430993, guid: bb680487e200bb1458405debc0da3606, type: 3}
m_CorrespondingSourceObject: {fileID: 1596500242942430993, guid: bb680487e200bb1458405debc0da3606,
type: 3}
m_PrefabInstance: {fileID: 6618112662589731389}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4183614227780674833}

View File

@ -1,43 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &1461800874448605312
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 811485385608274674, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
propertyPath: SelectedPose
value:
objectReference: {fileID: 11400000, guid: 3195f5271090d494f8a7cc10c2e5c898, type: 2}
- target: {fileID: 1575721949135083507, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
propertyPath: m_Name
value: HVR_CustomHandRight Variant
objectReference: {fileID: 0}
- target: {fileID: 3411870436646380634, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3411870436646380634, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3411870436646380634, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 13
objectReference: {fileID: 0}
- target: {fileID: 3411870436646380634, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -90.00001
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
--- !u!1 &114642666673063795 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1575721949135083507, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
m_PrefabInstance: {fileID: 1461800874448605312}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1230615514187084639
MonoBehaviour:
m_ObjectHideFlags: 0
@ -55,8 +17,6 @@ MonoBehaviour:
BodyPreview: {fileID: 0}
PreviewLeft: 0
PreviewRight: 0
LeftAutoPose: 0
RightAutoPose: 0
SelectionIndex: 0
PoseNames:
- 'Primary: OculusCustomHandOpen'
@ -65,12 +25,12 @@ MonoBehaviour:
Pose: {fileID: 11400000, guid: 3195f5271090d494f8a7cc10c2e5c898, type: 2}
Weight: 1
Mask: 0
Disabled: 0
Type: 0
Speed: 16
AnimationParameter: None
ButtonParameter: 0
Button: 0
Disabled: 0
ThumbType: 1
IndexType: 1
MiddleType: 1
@ -85,12 +45,12 @@ MonoBehaviour:
- Pose: {fileID: 11400000, guid: f6a50a26271c0f44cbbcbc7307260d31, type: 2}
Weight: 1
Mask: 0
Disabled: 0
Type: 0
Speed: 16
AnimationParameter: None
ButtonParameter: 0
Button: 0
Disabled: 0
ThumbType: 1
IndexType: 1
MiddleType: 1
@ -115,16 +75,62 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1ebbffaca5ed8a340ae381fb8a5695d8, type: 3}
m_Name:
m_EditorClassIdentifier:
PoseHand: 1
DefaultPoseHand: 1
DynamicPoseSpeed: 16
PosePosAndRot: 1
FingerCurlSpeed: 16
PhysicsPoser: {fileID: 0}
Hand: {fileID: 2237063672852083314}
DefaultPoser: {fileID: 1230615514187084639}
CurrentPoser: {fileID: 0}
--- !u!1001 &1461800874448605312
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 811485385608274674, guid: d9420cd6b732c874e805d2daa66f8409,
type: 3}
propertyPath: SelectedPose
value:
objectReference: {fileID: 11400000, guid: 3195f5271090d494f8a7cc10c2e5c898,
type: 2}
- target: {fileID: 1575721949135083507, guid: d9420cd6b732c874e805d2daa66f8409,
type: 3}
propertyPath: m_Name
value: HVR_CustomHandRight Variant
objectReference: {fileID: 0}
- target: {fileID: 3411870436646380634, guid: d9420cd6b732c874e805d2daa66f8409,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3411870436646380634, guid: d9420cd6b732c874e805d2daa66f8409,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3411870436646380634, guid: d9420cd6b732c874e805d2daa66f8409,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 13
objectReference: {fileID: 0}
- target: {fileID: 3411870436646380634, guid: d9420cd6b732c874e805d2daa66f8409,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -90.00001
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
--- !u!1 &114642666673063795 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1575721949135083507, guid: d9420cd6b732c874e805d2daa66f8409,
type: 3}
m_PrefabInstance: {fileID: 1461800874448605312}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2237063672852083314 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 811485385608274674, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
m_CorrespondingSourceObject: {fileID: 811485385608274674, guid: d9420cd6b732c874e805d2daa66f8409,
type: 3}
m_PrefabInstance: {fileID: 1461800874448605312}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 114642666673063795}

View File

@ -1,77 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &278922563901544862
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4183614225931664495, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 411603e247a5c244f8d2140955eda0a9, type: 2}
- target: {fileID: 4183614227780674833, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_Name
value: HVR_GhostHand_Oculus_Left Variant
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_LocalPosition.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7068644
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_LocalRotation.x
value: -0.14097446
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_LocalRotation.y
value: -0.018509882
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_LocalRotation.z
value: 0.6929115
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 90
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 1794001305696452778, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
--- !u!4 &4166322653361916109 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4183614226243096915, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
m_PrefabInstance: {fileID: 278922563901544862}
m_PrefabAsset: {fileID: 0}
--- !u!1 &4166322654767381647 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4183614227780674833, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
m_PrefabInstance: {fileID: 278922563901544862}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1481051882093435769
MonoBehaviour:
m_ObjectHideFlags: 0
@ -88,3 +16,90 @@ MonoBehaviour:
GhostHand: {fileID: 4166322653361916109}
ActualHand: {fileID: 0}
DisplayGhostHand: 0
--- !u!1001 &278922563901544862
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4183614225931664495, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 411603e247a5c244f8d2140955eda0a9, type: 2}
- target: {fileID: 4183614227780674833, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_Name
value: HVR_GhostHand_Oculus_Left Variant
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_LocalPosition.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_LocalRotation.x
value: -0.14097446
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.018509882
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_LocalRotation.z
value: 0.6929115
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.7068644
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4183614227780674834, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 90
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 1794001305696452778, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: 38bf26828eab9cc46ad2f78054d5594f, type: 3}
--- !u!1 &4166322654767381647 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4183614227780674833, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
m_PrefabInstance: {fileID: 278922563901544862}
m_PrefabAsset: {fileID: 0}
--- !u!4 &4166322653361916109 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4183614226243096915, guid: 38bf26828eab9cc46ad2f78054d5594f,
type: 3}
m_PrefabInstance: {fileID: 278922563901544862}
m_PrefabAsset: {fileID: 0}

View File

@ -1,77 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &7609886652459901482
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 114642666673063795, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_Name
value: HVR_GhostHand_Oculus_Right Variant
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_LocalPosition.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_LocalPosition.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7068645
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_LocalRotation.x
value: -0.14097445
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_LocalRotation.y
value: 0.018509874
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_LocalRotation.z
value: -0.6929114
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 13
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -90.00001
objectReference: {fileID: 0}
- target: {fileID: 4571702470150041887, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 411603e247a5c244f8d2140955eda0a9, type: 2}
m_RemovedComponents:
- {fileID: 7816638805891273299, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
--- !u!4 &6200011763639512121 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4580550387356012051, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
m_PrefabInstance: {fileID: 7609886652459901482}
m_PrefabAsset: {fileID: 0}
--- !u!1 &7497637352659821913 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 114642666673063795, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
m_PrefabInstance: {fileID: 7609886652459901482}
m_PrefabAsset: {fileID: 0}
--- !u!114 &8822055973328633994
MonoBehaviour:
m_ObjectHideFlags: 0
@ -88,3 +16,90 @@ MonoBehaviour:
GhostHand: {fileID: 6200011763639512121}
ActualHand: {fileID: 0}
DisplayGhostHand: 0
--- !u!1001 &7609886652459901482
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 114642666673063795, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_Name
value: HVR_GhostHand_Oculus_Right Variant
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_LocalPosition.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_LocalPosition.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_LocalRotation.x
value: -0.14097445
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.018509874
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_LocalRotation.z
value: -0.6929114
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.7068645
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 13
objectReference: {fileID: 0}
- target: {fileID: 4255965641504961754, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -90.00001
objectReference: {fileID: 0}
- target: {fileID: 4571702470150041887, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 411603e247a5c244f8d2140955eda0a9, type: 2}
m_RemovedComponents:
- {fileID: 7816638805891273299, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: e90900a2c44cf174e8b63baaee0459af, type: 3}
--- !u!1 &7497637352659821913 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 114642666673063795, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
m_PrefabInstance: {fileID: 7609886652459901482}
m_PrefabAsset: {fileID: 0}
--- !u!4 &6200011763639512121 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4580550387356012051, guid: e90900a2c44cf174e8b63baaee0459af,
type: 3}
m_PrefabInstance: {fileID: 7609886652459901482}
m_PrefabAsset: {fileID: 0}

View File

@ -320,7 +320,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: de1e5b754bd6d9241a88e889575193b2, type: 3}
m_Name:
m_EditorClassIdentifier:
JointSettings: {fileID: 11400000, guid: 10b31f17bbe7be94c900be1670865136, type: 2}
Strength: {fileID: 11400000, guid: 1482e8b1adffac04e8efc4fbd58275a6, type: 2}
JointSettings: {fileID: 0}
SolverIterations: 10
SolverVelocityIterations: 10
ReturnSpeed: 5
@ -402,6 +403,9 @@ MonoBehaviour:
RaycastLayermask:
serializedVersion: 2
m_Bits: 5242881
PushoutTime: 0.1
PullLerpTime: 0.06
MoveThreshold: 10
HandAnimator: {fileID: 4004377266273084089}
HandPhysics: {fileID: 0}
Inputs: {fileID: 0}
@ -409,6 +413,7 @@ MonoBehaviour:
ForceGrabber: {fileID: 0}
ControllerOffset: {fileID: 0}
CollisionHandler: {fileID: 0}
Pusher: {fileID: 0}
GrabIndicator: {fileID: 2216849731261072619}
TriggerGrabIndicator: {fileID: 2216849731261072619}
DynamicPoseIndicator: {fileID: 0}
@ -491,7 +496,8 @@ MonoBehaviour:
MaxDepenetration: 0
COMGizmoSize: {x: 0.02, y: 0.02, z: 0.02}
LiveUpdate: 0
Rigidbody: {fileID: 0}
ShowCOMGizmo: 0
Rigidbody: {fileID: 1272608247111003343}
--- !u!1 &1418766355926841473
GameObject:
m_ObjectHideFlags: 0
@ -1053,6 +1059,8 @@ MonoBehaviour:
AutoGrab: 1
AdditionalAutoGrabTime: 1
AutoGrabDistance: 0.3
SlowMo: 0
TimeScale: 0.25
--- !u!1 &5627524905124722554
GameObject:
m_ObjectHideFlags: 0
@ -1372,7 +1380,6 @@ MonoBehaviour:
RingStart: 0
PinkyStart: 0
Blends: []
ReferencePose: {fileID: 0}
MirrorAxis: 0
--- !u!1 &7474375505230444028
GameObject:

View File

@ -575,6 +575,8 @@ MonoBehaviour:
AutoGrab: 1
AdditionalAutoGrabTime: 1
AutoGrabDistance: 0.3
SlowMo: 0
TimeScale: 0.25
--- !u!1 &4348451690646725368
GameObject:
m_ObjectHideFlags: 0
@ -810,7 +812,6 @@ MonoBehaviour:
RingStart: 0
PinkyStart: 0
Blends: []
ReferencePose: {fileID: 0}
MirrorAxis: 0
--- !u!1 &7298255598267339687
GameObject:
@ -1004,7 +1005,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: de1e5b754bd6d9241a88e889575193b2, type: 3}
m_Name:
m_EditorClassIdentifier:
JointSettings: {fileID: 11400000, guid: 10b31f17bbe7be94c900be1670865136, type: 2}
Strength: {fileID: 11400000, guid: 1482e8b1adffac04e8efc4fbd58275a6, type: 2}
JointSettings: {fileID: 0}
SolverIterations: 10
SolverVelocityIterations: 10
ReturnSpeed: 5
@ -1086,6 +1088,9 @@ MonoBehaviour:
RaycastLayermask:
serializedVersion: 2
m_Bits: 9437185
PushoutTime: 0.1
PullLerpTime: 0.06
MoveThreshold: 10
HandAnimator: {fileID: 1776087990296578313}
HandPhysics: {fileID: 0}
Inputs: {fileID: 0}
@ -1093,6 +1098,7 @@ MonoBehaviour:
ForceGrabber: {fileID: 0}
ControllerOffset: {fileID: 0}
CollisionHandler: {fileID: 0}
Pusher: {fileID: 0}
GrabIndicator: {fileID: 7894897457090346305}
TriggerGrabIndicator: {fileID: 7894897457090346305}
DynamicPoseIndicator: {fileID: 0}
@ -1175,7 +1181,8 @@ MonoBehaviour:
MaxDepenetration: 0
COMGizmoSize: {x: 0.02, y: 0.02, z: 0.02}
LiveUpdate: 0
Rigidbody: {fileID: 0}
ShowCOMGizmo: 0
Rigidbody: {fileID: 8032787983860862300}
--- !u!1 &8265266644222074048
GameObject:
m_ObjectHideFlags: 0

View File

@ -30,7 +30,6 @@ Transform:
m_Children:
- {fileID: 1597478437996711727}
- {fileID: 9013499696880255983}
- {fileID: 8945561188959342034}
m_Father: {fileID: 8890804905152358655}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -48,7 +47,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
Arrow: {fileID: 4779085363590329893}
Ring: {fileID: 4822340545015479242}
Cylinder: {fileID: 4894702927335961675}
UseTeleporterColors: 1
ValidColor: {r: 0.006109435, g: 0.8308824, b: 0.7284968, a: 0.5}
InvalidColor: {r: 0.8679245, g: 0.1432894, b: 0.1432894, a: 0}
@ -499,82 +497,3 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &4894702927335961675
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8945561188959342034}
- component: {fileID: 5829644527658120820}
- component: {fileID: 8181262896154833788}
m_Layer: 0
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &8945561188959342034
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4894702927335961675}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.312, z: 0}
m_LocalScale: {x: 0.50328, y: 0.3107754, z: 0.50328}
m_Children: []
m_Father: {fileID: 617341589591466854}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &5829644527658120820
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4894702927335961675}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &8181262896154833788
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4894702927335961675}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 411603e247a5c244f8d2140955eda0a9, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0

View File

@ -1,82 +1,71 @@
2.8.4
2.9.1f
Fixed an issue with the version update check logic that was refreshing the asset database after compiles.
Fixed HVRStringSocketFilter / HVRStringSocketable filtering pair.
Fixed shoulder socket not working when moving forward.
Distance Grab Updates:
Force Pull logic re-worked using kinematics that takes into account mass, gravity, and hand velocity.
Force Pull Settings updated with Max Acceleration Force, Max Speed, Damping speed parameters to control behaviour.
2.9.1e
Hand Grab "Pull" sequence is improved and should be smoother, especially after a distance grab is executed.
New:
HVRGrabbable : Added 'BreakDistanceSource' [NoDistanceCheck, Hand, Controller] to control the distance check against the object, or to prevent dropping from distance altogether.
HVRGrabbable: new overridable function CanHandGrab for grab filtering.
HVRHandGrabFilter - abstract base class for modular hand grab filtering
HVRGrabHandFilter - new component for hvrgrabbable to limit which hand can grab
Example scene updated for grab hand filter
2.8.3.1
2.9.1d
OpenXR - added package check and update helper if 1.3 and higher version isn't detected.
VRIK Setup - fix IK solve at setup end when avatar spine isn't using normal forward / right vectors.
Adjust force grab default max force (was too strong for hexabody)
Fix Oculus and WMR menu button bindings for OpenXR
Fix HVRCockingHandle to handle initial grab offset better
2.9.1c - Fixed two hand strength overrides not resetting on release.
2.9.1b - Small bug fix in new editor script.
2.8.3
2.91
Fixed GC alloc in the socket detection
HVRControllerOffset will smoothly move / rotate to the grab points offset value instead of immediately snapping.
Tweaked force grabber to bring the object closer to the hand before the hand takes over.
Updated Hand Setup Wizard instructions to be more clear.
Fixed bug where the grab joint might end up on the wrong game object if the grabbable was a child of the rigidbody.
Fixed player controller to take into account the angle of the surface the player is standing on.
Fixed bug where child grabbables could be grabbed if their MasterGrabbable was socketed.
Added backpack rigs to hexabody integration.
2.8.2
Hand Strength Updates:
JointSettings on the hand and grabbable components are now deprecated, they will continue to work but will be removed in a future update.
PDStrength scriptable object is the replacement containing only the fields that are pertinent to the PD Controlled hands.
Fields that reference an existing PDStrength asset will display the editor in place for quick editing.
The following fields are added to replace the old ones:
HVRJointHand.Strength
HVRHexaBodyHands.Strength|OneHandedClimbStrength|TwoHandedClimbStrength
HVRGrabbable.OneHandStrength|TwoHandStrength
Included rig and hand prefabs are updated.
HurricaneVR extra dll's have been collapsed into a single final dll 'HurricaneVR.Framework'
Teleporter: Momentum is now maintained for the hands and held objects when teleporting.
Physics hands now account for teleporter jumping large distances.
Fix HVRStabber when the tip / base transforms aren't directly a child of the stabber
Fix HVRTeleporter capsule overlap check math that was failing at small capsule sizes.
Fix grabbing when the hand was set to toggle grab mode but the grabbable was set to Active mode.
Improved post teleport hand / held object positioning if the user rotated the player to a new direction.
HVRSocket - scale grabbable defaulted to false
Added basic EmeraldAI (v3) integration scene
HVRSettings - new DisableHaptics toggle
HVRPhysicsDial - fixed anchor to start at 0,0,0
HVRSocketLink:
Permanently links a grabbable to a socket with optional return time lerping.
Replaces the now deprecated grabbable fields StartingSocket/LinkStartingSocket.
Filter setup is not required as the socket will only accept the linked object.
Example scene updated with socket example. Backpack on rig prefab updated.
HVRSocket: all rb properties restored when RemoveRigidbody mode is used.
HVRPlayerInputs: ForceGrabber activated options updated with GripAndTrigger, Trigger, GripOrTrigger.
HVRHandImpactHaptics: MaxForce used in haptic amplitude calculation will default to the hand's max force value.
HVRGunBase: added hit collider, rigidbody, and distance to the arguments passed to the Hit event.
HVRStringSocketFilter and HVRStringSocketable updated to hash it's string value for performance.
HVRPlayerController:
- Added GroundedRadiusFactor which will multiply with the player capsules radius for the grounded sphere cast check.
- Horizontal ground movement will take into consideration the angle of the ground the player is on.
2.8
2.9
Fixed socket container grabber (example scene chest uses this)
Fixed impact component when rigidbody is missing
Fixed socket hover scale not completely hitting it's target scale size.
Fixed post teleport grabbable dropping due to the break distance check triggering
Fixed hand rotation post manual teleport
Fixed hand animator bug where finger curls were not properly applied to secondary poses.
Fixed hand animator to respect individual blend pose speeds.
Fixed gravity gloves adding Y force after a auto catch.
Fixed bug in custom hand setup wizard if hand didn't have tip transforms already.
Greatly improved post teleport collision handling
Improved post collision sweep after hand max distance reached
HandPoser blends with Speed of 0 will immediately lerp and not use smoothing to the target pose.
Demo SMG and Pistol trigger poses updated with speed of 0.
Suggested default MaxAngularSpeed reduced to 30.
HVRStabber Optimized GC allocation by caching stabbable colliders on start for reuse
HVRHandGrabber
Pusher [Box Collider] & PushoutTime [float] : optional box collider (generated automatically if not supplied) that will grow from zero to max size over PushoutTime.
Used when Hand goes to retrieve an object to ensure the hand doesn't get stuck in collision geometry.
Used after overlap clearance with a dropped object times out and is still overlapping to push the stuck object out of the hand.
Used after release if collisions were disabled on the hand while holding an object.
Users can start the push sequence by calling StartPushing if desired.
Pull Sequence Changes:
If pulling a grabbed object to the hand times out while trying to orient to the pose position, the hand will go retrieve
the object if the remaining angle difference is greater than "Move Threshold". This should help prevent objects getting stuck
when the fixed joint is created with the hand.
HVRGrabbable:
OverrideMaxDistanceBehaviour & MaxDistanceBehaviour to override what happens after the hand gets to far from the controller.
LinkedGrabbables: additional grabbables that might be on the same rigidbody to consider it a two hand grab.
InstantHandPose: If true, the removed object will instantly be orienated based on it's pose. Large sockets in demo scene enabled.
GrabBehaviour: override the Hand's "Pull or Hand Grab's" behaviour. (Default, PullToHand, HandRetrieves)
FinalJointMaxAngle defaulted to 15.
FinalJointTimeout defaulted to .25 seconds.
HVRSocket
DisableCollision: If false socketed objects maintain their collision, used only for static or kinematic rb sockets.
InstantHandPose: If true, the removed object will instantly be orienated based on it's pose. Large sockets in demo scene enabled.
Fixed grab indicators showing up even if they were marked disabled on the HVRGrabbable.
Fixed issue where CockingHandle would not lock forward if the controller was too far forward of the grab point.
Added HVRPoseZone: Uses a provided HVRHandPoser to pose the hand when the hand enters the overlap zone.
Demo KeyPad updated with a pose zone example.
HVRSocket: New 'PoseTag' field which links with HVRSocketable Poses field for saving orientation when socketed.
HVRSocketable: New Poses field with inspector interface to help save orientations for different socket types.
HVRGunBase: Added Hit event which passes the gun, hitpoint, normal, and direction variables.
HVRHandAnimator: Added 'HandOverride' transform field, allows HVRPosableHand component to be on a different component. VRIK IK targets is one example.
Bow: Fixed hand collision being re-enabled to early with the arrow.
Hand Prefabs: Added trigger collider with HVRHandTrigger component for easy hand detection by other components (HVRPoseZone).
Example Shotgun: modified two hand hold strengths to prevent forehand from moving the shotgun backward to easily.

View File

@ -18,6 +18,9 @@ MonoBehaviour:
WMR:
Position: {x: 0, y: 0, z: 0}
Rotation: {x: 40, y: 0, z: 0}
Pico:
Position: {x: 0.01, y: 0.01, z: 0.01}
Rotation: {x: 10, y: 0, z: 0}
OculusSteamVR:
Position: {x: -0.001, y: -0.005, z: -0.05}
Rotation: {x: 40, y: 0, z: 0}

View File

@ -0,0 +1,21 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 595f9e32dd154ba28dcd9b9fb86e85eb, type: 3}
m_Name: HVR_DefaultHandStrength
m_EditorClassIdentifier:
Mode: 0
Spring: 3000
Damper: 300
MaxForce: 300
TorqueSpring: 500
TorqueDamper: 50
MaxTorque: 75

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1482e8b1adffac04e8efc4fbd58275a6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 595f9e32dd154ba28dcd9b9fb86e85eb, type: 3}
m_Name: HVR_LargeWeapon_TwoHanded_Strength
m_EditorClassIdentifier:
Mode: 0
Spring: 3000
Damper: 300
MaxForce: 300
TorqueSpring: 200
TorqueDamper: 10
MaxTorque: 50

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b12c3f7f37233934f96dd9eaf0878672
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 595f9e32dd154ba28dcd9b9fb86e85eb, type: 3}
m_Name: HVR_Pistol_Stabilizer_TwoHanded_Strength
m_EditorClassIdentifier:
Mode: 0
Spring: 0
Damper: 0
MaxForce: 0
TorqueSpring: 0
TorqueDamper: 0
MaxTorque: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d743713d642f47b47b16425271dc9e35
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,87 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e581938f8c0341839ae0a0294479b8d3, type: 3}
m_Name: HVR_ShotgunPump_TwoHanded
m_EditorClassIdentifier:
XMaster: 1
XDrive:
Spring: 1000
Damper: 100
MaxForce: 100
SlerpDrive:
Spring: 0
Damper: 0
MaxForce: 0
ApplyMode: 0
EnableCollision: 0
EnablePreprocessing: 1
BreakForce: Infinity
BreakTorque: Infinity
MassScale: 1
ConnectedMassScale: 1
ProjectionMode: 0
ProjectionDistance: 0.1
ProjectionAngle: 180
CriticalDampPosition: 0
DampConnectedBody: 0
RotationDriveMode: 1
YDrive:
Spring: 0
Damper: 0
MaxForce: 0
ZDrive:
Spring: 0
Damper: 0
MaxForce: 0
AngularXDrive:
Spring: 0
Damper: 0
MaxForce: 0
AngularYZDrive:
Spring: 0
Damper: 0
MaxForce: 0
LinearLimit:
Limit: 0
Bounciness: 0
ContactDistance: 0
LinearLimitSpring:
Spring: 0
Damper: 0
XMotion: 2
YMotion: 2
ZMotion: 2
AngularXMotion: 2
AngularYMotion: 2
AngularZMotion: 2
LowAngularXLimit:
Limit: 0
Bounciness: 0
ContactDistance: 0
HighAngularXLimit:
Limit: 0
Bounciness: 0
ContactDistance: 0
AngularXLimitSpring:
Spring: 0
Damper: 0
AngularYLimit:
Limit: 0
Bounciness: 0
ContactDistance: 0
AngularZLimit:
Limit: 0
Bounciness: 0
ContactDistance: 0
AngularYZLimitSpring:
Spring: 0
Damper: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f4fc40462bb4bb041b5964be99f85368
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 595f9e32dd154ba28dcd9b9fb86e85eb, type: 3}
m_Name: HVR_ShotgunPump_TwoHanded_Strength
m_EditorClassIdentifier:
Mode: 0
Spring: 1000
Damper: 100
MaxForce: 100
TorqueSpring: 0
TorqueDamper: 0
MaxTorque: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e0cd6b1a451e3854ba6e54d82005a0e2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,87 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e581938f8c0341839ae0a0294479b8d3, type: 3}
m_Name: HVR_Shotgun_TwoHanded
m_EditorClassIdentifier:
XMaster: 1
XDrive:
Spring: 3000
Damper: 300
MaxForce: 300
SlerpDrive:
Spring: 100
Damper: 10
MaxForce: 25
ApplyMode: 2
EnableCollision: 0
EnablePreprocessing: 0
BreakForce: Infinity
BreakTorque: Infinity
MassScale: 1
ConnectedMassScale: 1
ProjectionMode: 0
ProjectionDistance: 0.1
ProjectionAngle: 180
CriticalDampPosition: 0
DampConnectedBody: 0
RotationDriveMode: 1
YDrive:
Spring: 0
Damper: 0
MaxForce: 0
ZDrive:
Spring: 0
Damper: 0
MaxForce: 0
AngularXDrive:
Spring: 0
Damper: 0
MaxForce: 0
AngularYZDrive:
Spring: 0
Damper: 0
MaxForce: 0
LinearLimit:
Limit: 0
Bounciness: 0
ContactDistance: 0
LinearLimitSpring:
Spring: 0
Damper: 0
XMotion: 2
YMotion: 2
ZMotion: 2
AngularXMotion: 2
AngularYMotion: 2
AngularZMotion: 2
LowAngularXLimit:
Limit: 0
Bounciness: 0
ContactDistance: 0
HighAngularXLimit:
Limit: 0
Bounciness: 0
ContactDistance: 0
AngularXLimitSpring:
Spring: 0
Damper: 0
AngularYLimit:
Limit: 0
Bounciness: 0
ContactDistance: 0
AngularZLimit:
Limit: 0
Bounciness: 0
ContactDistance: 0
AngularYZLimitSpring:
Spring: 0
Damper: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 561dfd33fe0af7e408e6ac5f5e30a3f1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 595f9e32dd154ba28dcd9b9fb86e85eb, type: 3}
m_Name: HVR_Shotgun_TwoHanded_Strength
m_EditorClassIdentifier:
Mode: 2
Spring: 3000
Damper: 300
MaxForce: 300
TorqueSpring: 100
TorqueDamper: 10
MaxTorque: 25

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 263b353c0100fed4cb7bd21bc56f0620
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 595f9e32dd154ba28dcd9b9fb86e85eb, type: 3}
m_Name: HVR_Stabilizer_TwoHanded_Strength
m_EditorClassIdentifier:
Mode: 2
Spring: 3000
Damper: 300
MaxForce: 750
TorqueSpring: 0
TorqueDamper: 0
MaxTorque: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bfff0207f648e9b4d9f1868798fb5efe
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -14,13 +14,13 @@ MonoBehaviour:
m_EditorClassIdentifier: HurricaneVR.Framework:HurricaneVR.Framework.Components:ImpactHaptics
Timeout: 0.3
SqrMagThreshold: 0.65
MaxForce: 700
MaxForce: 300
AmpCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.45
value: 0.15
inSlope: 0
outSlope: 0
tangentMode: 0

View File

@ -27,9 +27,9 @@ MonoBehaviour:
MaxUpForce: 5
UseTwoHandMaxUpforce: 0
UseTwoHandMaxSideForce: 0
MaxBackForce: 200
TwoHandMaxUpForce: 100
MaxSideForce: 100
MaxBackForce: 2000
TwoHandMaxUpForce: 200
MaxSideForce: 200
TwoHandMaxSideForce: 0
RecoveryDelay: 0
TwoHandedRecoveryDelay: 0.15

View File

@ -5,6 +5,10 @@ using UnityEngine.Events;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Basic button check for travel along a defined axis, requires the user to have setup their own constraint system.
/// Superceded by the new HVRPhysicsButton component which helps create joints and limits for you
/// </summary>
[RequireComponent(typeof(Rigidbody))]
public class HVRButton : MonoBehaviour
{
@ -38,11 +42,6 @@ namespace HurricaneVR.Framework.Components
Rigidbody = GetComponent<Rigidbody>();
}
void Update()
{
}
private void FixedUpdate()
{
var distance = (StartPosition - transform.localPosition).magnitude;

View File

@ -2,18 +2,12 @@
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Tags a grabbable object as climbable which is then used by the player controller to know if they can climb or not.
/// For the hexabody integration it will kick in the climbing strength override set on the HexaHands component.
/// </summary>
public class HVRClimbable : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
}

View File

@ -4,6 +4,9 @@ using UnityEngine.Events;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Helper component used to propogate a collision if a force or velocity threshold was met.
/// </summary>
public class HVRCollisionEvents : MonoBehaviour
{
[Header("Settings")]

View File

@ -5,6 +5,10 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Handles offsettings the physics hand target based on the connected device. Also offsets the target based on grab point settings if desired.
/// To manage custom offsets please use the SetMiscPositionOffset(Vector3 position, Vector3 rotation) and ResetGrabPointOffsets() functions.
/// </summary>
public class HVRControllerOffset : MonoBehaviour
{
/// <summary>
@ -30,16 +34,20 @@ namespace HurricaneVR.Framework.Components
public Vector3 ControllerRotationOffset => _offsets != null ? _offsets.Rotation : Vector3.zero;
[Header("Debugging")]
public Vector3 TargetGrabPointPositionOffset;
public Vector3 TargetGrabPointRotationOffset;
public Vector3 GrabPointPositionOffset;
public Vector3 GrabPointRotationOffset;
public Vector3 MiscPositionOffset;
public Vector3 MiscRotationOffset;
[Tooltip("Enable to test live updating of the Misc offset fields.")]
public bool LiveUpdateOffsets;
[SerializeField] private Vector3 TargetGrabPointPositionOffset;
[SerializeField] private Vector3 TargetGrabPointRotationOffset;
[SerializeField] private Vector3 GrabPointPositionOffset;
[SerializeField] private Vector3 GrabPointRotationOffset;
[SerializeField] private Vector3 MiscPositionOffset;
[SerializeField] private Vector3 MiscRotationOffset;
private Quaternion _teleportStartRotation;
public bool _updatingRotation;

View File

@ -15,10 +15,13 @@ namespace HurricaneVR.Framework.Components
{
[Header("Unity XR")]
public HVRDevicePoseOffset Oculus;
public HVRDevicePoseOffset WMR;
public HVRDevicePoseOffset Pico;
[Header("SteamVR")]
public HVRDevicePoseOffset OculusSteamVR;
public HVRDevicePoseOffset WMRSteamVR;
public HVRDevicePoseOffset ReverbG2SteamVR;
public HVRDevicePoseOffset CosmosSteamVR;
@ -27,11 +30,13 @@ namespace HurricaneVR.Framework.Components
[Header("OpenXR")]
public HVRDevicePoseOffset OculusOpenXR;
public HVRDevicePoseOffset WMROpenXR;
public HVRDevicePoseOffset ReverbG2OpenXR;
public HVRDevicePoseOffset ViveOpenXR;
public HVRDevicePoseOffset CosmosOpenXR;
public HVRDevicePoseOffset KnucklesOpenXR;
public HVRDevicePoseOffset PicoOpenXR;
public HVRDevicePoseOffset GetDeviceOffset(HVRHandSide side)
{
@ -47,7 +52,6 @@ namespace HurricaneVR.Framework.Components
switch (type)
{
case HVRControllerType.Oculus:
if (steamVR)
{
@ -83,6 +87,7 @@ namespace HurricaneVR.Framework.Components
{
return ViveOpenXR;
}
break;
case HVRControllerType.Knuckles:
if (steamVR)
@ -93,6 +98,7 @@ namespace HurricaneVR.Framework.Components
{
return KnucklesOpenXR;
}
break;
case HVRControllerType.Cosmos:
if (steamVR)
@ -103,6 +109,7 @@ namespace HurricaneVR.Framework.Components
{
return CosmosOpenXR;
}
break;
case HVRControllerType.ReverbG2:
if (steamVR)
@ -113,7 +120,14 @@ namespace HurricaneVR.Framework.Components
{
return ReverbG2OpenXR;
}
break;
case HVRControllerType.Pico:
if (steamVR) //is there a way to detect pico when using steamvr? it's emulated as a oculus device
return null;
if (openXr)
return PicoOpenXR;
return Pico;
}
return null;
@ -124,7 +138,9 @@ namespace HurricaneVR.Framework.Components
public class HVRDevicePoseOffset
{
public Vector3 Position;
[FormerlySerializedAs("_rotation")] [SerializeField]
[FormerlySerializedAs("_rotation")]
[SerializeField]
public Vector3 Rotation;
}
}

View File

@ -13,8 +13,6 @@ namespace HurricaneVR.Framework.Components
public HVRDestructible Desctructible;
void Start()
{
Rigidbody = GetComponent<Rigidbody>();

View File

@ -4,6 +4,9 @@ using UnityEngine.Events;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Publishes the destroyed event so others may know, used by the hand grabber to know if the held object is destroyed
/// </summary>
public class HVRDestroyListener : MonoBehaviour
{
public HVRDestroyedEvent Destroyed = new HVRDestroyedEvent();

View File

@ -3,6 +3,9 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Destroys this game object after a timeout
/// </summary>
public class HVRDestroyTimer : MonoBehaviour
{
public void StartTimer(float timeout)

View File

@ -3,6 +3,11 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Helper component that spawns a prefab game object when the Destroy function is called.
/// If the spawned game object has a rigidbodies then they will have force added to them based on the
/// fields provided.
/// </summary>
public class HVRDestructible : MonoBehaviour
{
public GameObject DestroyedVersion;
@ -17,8 +22,12 @@ namespace HurricaneVR.Framework.Components
public bool IgnorePlayerCollision = true;
public bool Destroyed { get; protected set; }
public virtual void Destroy()
{
if (Destroyed) return;
if (DestroyedVersion)
{
var destroyed = Instantiate(DestroyedVersion, transform.position, transform.rotation);
@ -59,6 +68,7 @@ namespace HurricaneVR.Framework.Components
}
}
Destroyed = true;
Destroy(gameObject);
}
}

View File

@ -5,6 +5,9 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Deprecated and left in for older projects. Superceded by HVRPhysicsDial and HVRRotationTracker
/// </summary>
[RequireComponent(typeof(HVRGrabbable))]
public class HVRDial : MonoBehaviour
{

View File

@ -1,18 +1,42 @@
using HurricaneVR.Framework.Core.Grabbers;
using HurricaneVR.Framework.Core.Player;
using UnityEngine;
namespace HurricaneVR.Framework.Components
{
public class HVRHandImpactHaptics : HVRImpactHapticsBase
{
public HVRHandGrabber Hand;
[Tooltip("If true and the hand is holding something, haptics will not play.")]
public bool HandGrabbingPrevents = true;
[Tooltip("If true the max force for the haptic amplitude calc will use the hand's default max force.")]
public bool UseHandMaxStrength = true;
private HVRJointHand _hand;
public override float MaxForce
{
get
{
if (UseHandMaxStrength)
{
if ( _hand && _hand.JointSettings)
return _hand.JointSettings.XDrive.MaxForce;
}
return base.MaxForce;
}
}
protected override void Awake()
{
base.Awake();
if (!Hand) TryGetComponent(out Hand);
TryGetComponent(out _hand);
}
protected override void Vibrate(float duration, float amplitude, float frequency)

View File

@ -46,10 +46,10 @@ namespace HurricaneVR.Framework.Components
{
Folder = DateTime.Now.ToString("yyyyMMdd_HH_mm");
}
#if UNITY_EDITOR
void Update()
{
#if UNITY_EDITOR
if (DisablePhysics && !_previousDisable)
{
@ -79,9 +79,9 @@ namespace HurricaneVR.Framework.Components
_previousDisable = DisablePhysics;
CheckSnapshot();
#endif
}
}
#endif
private void CheckSnapshot()
{
HVRPosableHand hand = null;

View File

@ -12,10 +12,19 @@ namespace HurricaneVR.Framework.Components
public class HVRImpactHaptics : ScriptableObject
{
public float Timeout = .3f;
[Tooltip("Collision Velocity Square Magnitude cut off filter")]
public float SqrMagThreshold = .30f;
public float MaxForce = 600f;
[Tooltip("Collision force divided by this and fed into the AmpCurve. ")]
public float MaxForce = 300f;
public AnimationCurve AmpCurve;
[Tooltip("Duration fed into haptics API.")]
public float Duration = .25f;
[Tooltip("Frequency fed into haptics API")]
public float Frequency = 150f;
public void Reset()

View File

@ -16,6 +16,8 @@ namespace HurricaneVR.Framework.Components
private float _lastHaptic;
private Rigidbody Rb;
public virtual float MaxForce => Data.MaxForce;
protected virtual void Awake()
{
TryGetComponent(out Rb);
@ -50,7 +52,7 @@ namespace HurricaneVR.Framework.Components
Force = impulse / Time.fixedDeltaTime;
var amp = Data.AmpCurve.Evaluate(Force / Data.MaxForce);
var amp = Data.AmpCurve.Evaluate(Force / MaxForce);
Vibrate(Data.Duration, amp, Data.Frequency);

View File

@ -6,7 +6,9 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Depecrecated and left in for older projects, superceded by HVRPhysicsLever and HVRRotationTracker
/// </summary>
[RequireComponent(typeof(HVRGrabbable))]
[RequireComponent(typeof(HingeJoint))]
public class HVRLever : MonoBehaviour

View File

@ -2,6 +2,9 @@
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Helper component to parent this transform to the assigned transform on game start
/// </summary>
public class HVRParentOnStart : MonoBehaviour
{
public Transform Parent;

View File

@ -7,13 +7,24 @@ using UnityEngine.Events;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Creates a joint constrained along one axis with limits based on start and end points defined in the inspector editor.
/// </summary>
[RequireComponent(typeof(Rigidbody))]
public class HVRPhysicsButton : MonoBehaviour
{
[Header("Settings")]
[Tooltip("Axis the button will travel on in local space.")]
public HVRAxis Axis;
[Tooltip("Rigidbody this button will connect to with a joint.")]
public Rigidbody ConnectedBody;
[Tooltip("Spring value of the joint")]
public float Spring = 1000f;
[Tooltip("Damper of the joint")]
public float Damper = 50f;

View File

@ -8,11 +8,12 @@ using UnityEngine.Serialization;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Simple component to help setup a joint constrained on one axis. With bonus rotation friction option when held.
/// </summary>
[RequireComponent(typeof(Rigidbody))]
public class HVRPhysicsDial : MonoBehaviour
{
[SerializeField] public HVRGrabbable Grabbable;
[Header("Settings")]
[Tooltip("Local axis of rotation")]
public HVRAxis Axis;
@ -23,6 +24,7 @@ namespace HurricaneVR.Framework.Components
[Tooltip("If true the angular velocity will be zero'd out on release.")]
public bool StopOnRelease = true;
[Tooltip("Defaults to true to prevent rotation when not held")]
public bool DisableGravity = true;
[Header("Joint Limits")]
@ -41,6 +43,7 @@ namespace HurricaneVR.Framework.Components
[Tooltip("Angular Damper when the dial is not grabbed")]
public float Damper = 3;
[Tooltip("Optional spring value of the joint to return to starting rotation if desired")]
public float Spring;
[Header("Editor")]
@ -52,6 +55,8 @@ namespace HurricaneVR.Framework.Components
public Rigidbody Rigidbody { get; private set; }
public HVRGrabbable Grabbable { get; private set; }
public ConfigurableJoint Joint { get; set; }
protected virtual void Awake()
@ -60,26 +65,14 @@ namespace HurricaneVR.Framework.Components
Rigidbody.useGravity = !DisableGravity;
if (!Grabbable) Grabbable = GetComponent<HVRGrabbable>();
Grabbable = GetComponent<HVRGrabbable>();
if (Grabbable)
{
Grabbable.HandGrabbed.AddListener(OnDialGrabbed);
Grabbable.HandReleased.AddListener(OnDialReleased);
}
if (MinAngle > 0)
{
MinAngle *= -1;
}
if (MaxAngle < 0)
{
MaxAngle *= -1;
}
MinAngle = Mathf.Clamp(MinAngle, MinAngle, 0);
MaxAngle = Mathf.Clamp(MaxAngle, 0, MaxAngle);
FixAngle(ref MinAngle, ref MaxAngle);
SetupJoint();
AfterJointCreated(Joint);
@ -95,7 +88,7 @@ namespace HurricaneVR.Framework.Components
if (TargetAngularVelocity > 0f || TargetAngularVelocity < 0f) Joint.targetAngularVelocity = new Vector3(TargetAngularVelocity, 0f, 0f);
}
private void OnDialReleased(HVRHandGrabber arg0, HVRGrabbable arg1)
protected virtual void OnDialReleased(HVRHandGrabber arg0, HVRGrabbable arg1)
{
Joint.SetAngularXDrive(Spring, Damper, 10000f);
if (StopOnRelease)
@ -104,7 +97,7 @@ namespace HurricaneVR.Framework.Components
}
}
private void OnDialGrabbed(HVRHandGrabber arg0, HVRGrabbable arg1)
protected virtual void OnDialGrabbed(HVRHandGrabber arg0, HVRGrabbable arg1)
{
Joint.SetAngularXDrive(0f, GrabbedDamper, 10000f);
}
@ -143,18 +136,53 @@ namespace HurricaneVR.Framework.Components
}
/// <summary>
/// Sets the rotation limits on the Joint's main rotation axis
/// </summary>
public void SetLimits(float minAngle, float maxAngle)
{
FixAngle(ref minAngle, ref maxAngle);
Joint.LimitAngularXMotion();
Joint.SetAngularXHighLimit(minAngle);
Joint.SetAngularXLowLimit(maxAngle);
}
/// <summary>
/// Resets the limit's to the -MinAngle and MaxAngle values of this component.
/// </summary>
public void ResetLimits()
{
Joint.LimitAngularXMotion();
Joint.SetAngularXHighLimit(-MinAngle);
Joint.SetAngularXLowLimit(-MaxAngle);
}
/// <summary>
/// Frees the axis of rotation
/// </summary>
public void RemoveLimits()
{
Joint.angularXMotion = ConfigurableJointMotion.Free;
}
/// <summary>
/// Sanity check on the angles for the joint high and low settings
/// </summary>
private void FixAngle(ref float min, ref float max)
{
if (min > 0)
{
min *= -1;
}
if (max < 0)
{
max *= -1;
}
min = Mathf.Clamp(min, min, 0);
max = Mathf.Clamp(max, 0, max);
}
}
}

View File

@ -7,42 +7,76 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// This component helps setup the basic functionality of a hinged door.
/// Includes locking and latching capability. Handle required rotation for unlatching.
/// </summary>
[HelpURL("https://cloudwalker2020.github.io/HurricaneVR-Docs/manual/components/door.html")]
[RequireComponent(typeof(HVRRotationTracker))]
[RequireComponent(typeof(Rigidbody))]
public class HVRPhysicsDoor : MonoBehaviour
{
[Header("Settings")]
[Tooltip("Local axis of rotation")]
[Header("Settings")] [Tooltip("Local axis of rotation")]
public HVRAxis Axis;
public float Mass = 10f;
[Tooltip("Door's rigidbody mass.")] public float Mass = 10f;
public bool DisableGravity = true;
[Tooltip("If true the door and it's handle will have their joint limit's locked on start.")]
public bool StartLocked;
[Tooltip("Rigidbody to connect the joint to")]
public Rigidbody ConnectedBody;
[Header("Door Closing Settings")]
[Header("Door Closing Settings")] [Tooltip("Angle threshold to determine if the door is closed or not.")]
public float CloseAngle = 5f;
[Tooltip("The door will automatically shut over this amount of time once it's close enough to be closed.")]
public float CloseOverTime = .25f;
[Tooltip("How long the door angle must be below 'CloseAngle' to become closed.")]
public float CloseDetectionTime = .5f;
[Header("SFX")]
[Header("SFX")] [Tooltip("Angle threshold to play opening and closing sound effects.")]
public float SFXThresholdAngle = 2.5f;
public float SFXResetThreshold = 1f;
public AudioClip SFXOpened;
public AudioClip SFXClosed;
[Tooltip("Delay before the open / close sfx can be played again")]
public float SFXTimeout = 1f;
[Tooltip("Optional transform to define the position of the open / close sound fx.")]
public Transform SFXPosition;
[Header("Handle")]
[Header("Handle")] [Tooltip("If true the handle must rotate beyond 'HandThreshold' amount of degrees before it will unlatch, if false the door will not latch automatically.")]
public bool HandleRequiresRotation;
[Tooltip("Required handle rotation to unlatch the door.")]
public float HandleThreshold = 45f;
[Tooltip("The rotation tracker that reports the amount of rotation of the handle.")]
public HVRRotationTracker HandleRotationTracker;
[Tooltip("If provided (and held) the door will not automatically shut when it is below 'CloseAngle' in degrees.")]
public HVRGrabbable HandleGrabbable;
[Tooltip("Rotational physics component that let's this door component lock the door handle's rotation when the door locks.")]
public HVRPhysicsDial DoorKnob;
[Header("Joint Limits")]
public bool LimitRotation = true;
[Tooltip("The rotation tracker that reports the amount of rotation of the handle.")]
public HVRRotationTracker SecondHandleRotationTracker;
[Tooltip("If provided (and held) the door will not automatically shut when it is below 'CloseAngle' in degrees.")]
public HVRGrabbable SecondHandleGrabbable;
[Tooltip("Rotational physics component that let's this door component lock the door handle's rotation when the door locks.")]
public HVRPhysicsDial SecondDoorKnob;
[Header("Joint Limits")] public bool LimitRotation = true;
[Tooltip("Minimum Angle about the axis of rotation")]
public float MinAngle;
@ -50,19 +84,17 @@ namespace HurricaneVR.Framework.Components
[Tooltip("Maximum rotation about the axis of rotation")]
public float MaxAngle;
[Header("Joint Settings")]
[Tooltip("Angular Damper when the dial is not grabbed")]
[Header("Joint Settings")] [Tooltip("Angular Damper of the door hinge.")]
public float Damper = 10;
[Tooltip("Angular Spring that will return the door to it's starting rotation")]
public float Spring;
//[Header("Editor")]
//[SerializeField]
//protected Quaternion JointStartRotation;
[Header("Debugging")]
public float TargetAngularVelocity = 0f;
[Header("Debugging")] public float TargetAngularVelocity = 0f;
public bool DoorLatched;
public bool DoorClosed;
public bool Opened;
@ -161,7 +193,7 @@ namespace HurricaneVR.Framework.Components
DoorClosed = false;
}
if (HandleGrabbable && HandleGrabbable.IsBeingHeld)
if (HandleGrabbable && HandleGrabbable.IsBeingHeld || SecondHandleGrabbable && SecondHandleGrabbable.IsBeingHeld)
{
_detectionTimer = 0f;
}
@ -209,11 +241,14 @@ namespace HurricaneVR.Framework.Components
if (HandleRequiresRotation)
{
if (HandleRotationTracker.UnsignedAngle >= HandleThreshold)
if (HandleRotationTracker.UnsignedAngle >= HandleThreshold ||
(SecondHandleRotationTracker && SecondHandleRotationTracker.UnsignedAngle >= HandleThreshold))
{
DoorLatched = false;
}
else if (HandleRotationTracker.UnsignedAngle < HandleThreshold && Tracker.UnsignedAngle < CloseAngle)
else if (HandleRotationTracker.UnsignedAngle < HandleThreshold &&
(!SecondHandleRotationTracker || SecondHandleRotationTracker.UnsignedAngle < HandleThreshold) &&
Tracker.UnsignedAngle < CloseAngle)
{
DoorLatched = true;
}
@ -235,7 +270,7 @@ namespace HurricaneVR.Framework.Components
PreviousClosed = DoorClosed;
}
private Vector3 GetSFXPosition()
protected virtual Vector3 GetSFXPosition()
{
var position = transform.position;
if (SFXPosition)
@ -248,31 +283,30 @@ namespace HurricaneVR.Framework.Components
protected virtual void PlayClosedSFX()
{
if(SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(SFXClosed, GetSFXPosition());
if (SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(SFXClosed, GetSFXPosition());
}
protected virtual void PlayOpenedSFX()
{
if(SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(SFXOpened, GetSFXPosition());
if (SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(SFXOpened, GetSFXPosition());
}
protected virtual void OnDoorUnLatched()
public virtual void OnDoorUnLatched()
{
if (VerboseLogging)
Debug.Log($"OnDoorUnLatched");
UnlockDoorJoint();
}
protected virtual void OnDoorLatched()
public virtual void OnDoorLatched()
{
if (VerboseLogging)
Debug.Log($"OnDoorLatched");
LockDoorJoint();
}
// ReSharper disable Unity.PerformanceAnalysis
protected virtual void OnDoorClosed()
{
if (VerboseLogging)
@ -281,6 +315,7 @@ namespace HurricaneVR.Framework.Components
StartCoroutine(DoorCloseRoutine());
}
// ReSharper disable Unity.PerformanceAnalysis
protected virtual void OnDoorOpened()
{
if (VerboseLogging)
@ -302,6 +337,9 @@ namespace HurricaneVR.Framework.Components
Joint.SetAngularXLowLimit(-MaxAngle);
}
/// <summary>
/// Locks the door joint, and the door knob's joint.
/// </summary>
public virtual void Lock()
{
Locked = true;
@ -309,6 +347,9 @@ namespace HurricaneVR.Framework.Components
LockDoorKnob();
}
/// <summary>
/// Unlocks the door and allows the door handle to rotate.
/// </summary>
public virtual void Unlock()
{
Locked = false;
@ -323,18 +364,14 @@ namespace HurricaneVR.Framework.Components
protected virtual void LockDoorKnob()
{
if (DoorKnob)
{
DoorKnob.SetLimits(0, 0);
}
if (DoorKnob) DoorKnob.SetLimits(0, 0);
if (SecondDoorKnob) SecondDoorKnob.SetLimits(0, 0);
}
protected virtual void UnlockDoorKnob()
{
if (DoorKnob)
{
DoorKnob.ResetLimits();
}
if (DoorKnob) DoorKnob.ResetLimits();
if (SecondDoorKnob) SecondDoorKnob.ResetLimits();
}
protected IEnumerator DoorCloseRoutine()
@ -353,7 +390,7 @@ namespace HurricaneVR.Framework.Components
_doorClosing = false;
}
private void SetupJoint()
protected virtual void SetupJoint()
{
var currentRotation = transform.localRotation;
//transform.localRotation = JointStartRotation;
@ -362,7 +399,7 @@ namespace HurricaneVR.Framework.Components
Joint.LockLinearMotion();
Joint.LockAngularYMotion();
Joint.LockAngularZMotion();
Joint.anchor = Vector3.zero;
Joint.axis = Axis.GetVector();
if (LimitRotation)

View File

@ -6,16 +6,28 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Helper component to constrain a drawer along the desired movement axis handling the joint creation and limiting for you.
/// Joint is constrained between the start and end position which is defined in the component inspector.
/// </summary>
[RequireComponent(typeof(Rigidbody))]
public class HVRPhysicsDrawer : MonoBehaviour
{
[Header("Settings")]
[Tooltip("Axis the drawer will travel on in local space.")]
public HVRAxis Axis;
[Tooltip("Rigidbody to joint to.")]
public Rigidbody ConnectedBody;
[Tooltip("Optional spring that will return to the starting position")]
public float Spring = 0;
[Tooltip("Damper to provide 'friction' to the drawer.")]
public float Damper = 10;
[Header("SFX")] public float SFXResetThreshold = .02f;
[Header("SFX")]
public float SFXResetThreshold = .02f;
public AudioClip SFXOpened;
public AudioClip SFXClosed;

View File

@ -7,23 +7,14 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Lever behaves similar to the dial in rigidbody joint behaviour at this time...
/// </summary>
[RequireComponent(typeof(Rigidbody))]
public class HVRPhysicsLever : HVRPhysicsDial
{
public bool DrawGizmos = true;
public ConfigurableJoint preJoint;
protected override void SetupJoint()
{
if(!preJoint)
{
base.SetupJoint();
}
else
{
Joint = preJoint;
}
}
public void OnDrawGizmosSelected()
{

View File

@ -3,6 +3,9 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Helper component to override various rigidbody properties
/// </summary>
[RequireComponent(typeof(Rigidbody))]
public class HVRRigidBodyOverrides : MonoBehaviour
{
@ -22,7 +25,7 @@ namespace HurricaneVR.Framework.Components
[Header("Debug")]
public Vector3 COMGizmoSize = new Vector3(.02f, .02f, .02f);
public bool LiveUpdate;
public bool ShowCOMGizmo;
public Rigidbody Rigidbody;
void Awake()
@ -75,7 +78,7 @@ namespace HurricaneVR.Framework.Components
void OnDrawGizmosSelected()
{
//if (OverrideCOM)
if (ShowCOMGizmo)
{
Gizmos.color = Color.yellow;
if (OverrideCOM)

View File

@ -3,6 +3,9 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Helps constrain loose joints on the desired axis.
/// </summary>
public class HVRRigidbodyLocker : MonoBehaviour
{
public LockOptions Locks;

View File

@ -10,17 +10,22 @@ namespace HurricaneVR.Framework.Components
public Transform Camera;
[Header("Settings")]
[Tooltip("Ring must be within this distance from the camera to be displayed")]
public float Distance = 5f;
[Header("Line of Sight Settings")]
[Tooltip("Use ray cast to the camera collider to determine if we should show")]
public bool RequireLineOfSight = true;
[Tooltip("Layer mask for checking line of sight, include the layer of the camera(default is Player)")]
public LayerMask LayerMask;
[Tooltip("Check line of sight only if distance greater than this")]
public float LineOfSightThreshold = 1.5f;
[Tooltip("Timeout to check line of sight")]
public float Delay = 1f;
@ -30,7 +35,7 @@ namespace HurricaneVR.Framework.Components
protected override void Start()
{
if (!Camera)
if (!Camera && HVRManager.Instance)
{
Camera = HVRManager.Instance.Camera;
}

View File

@ -7,15 +7,26 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Used to limit rotations beyond the default Physx limit of 177 degrees. Joint is recreated at certain thresholds to allow the wider
/// range of motion, only use this if you need range of motion beyond 177 degrees.
/// </summary>
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(HVRRotationTracker))]
public class HVRRotationLimiter : MonoBehaviour
{
public const float PhysxMaxLimit = 177f;
[Tooltip("Connected Body of the Joint")]
public Rigidbody ConnectedBody;
[Tooltip("Minimum angle of rotation")]
public int MinAngle;
[Tooltip("Maximum angle of rotation")]
public int MaxAngle;
[Tooltip("Distance traveled before the joint is recreated with new limits")]
public float JointResetThreshold = 90f;

View File

@ -3,11 +3,18 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Used in conjunction with the HVRRotationTracker to play SFX based on rotation amount.
/// </summary>
public class HVRRotationSFX : MonoBehaviour
{
[Tooltip("Tracker required to know how far something has rotated")]
public HVRRotationTracker Tracker;
[Tooltip("Clip chosen at random from this list when rotated beyond 'AngleThreshold'")]
public AudioClip[] SFX;
[Tooltip("Rotation distance must exceed this to play another sfx clip")]
public float AngleThreshold = 30f;
[Header("Debug")]
@ -41,11 +48,6 @@ namespace HurricaneVR.Framework.Components
}
}
public void Update()
{
}
protected virtual void PlaySFX(AudioClip sfx)
{
if(SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(sfx, transform.position);

View File

@ -7,6 +7,10 @@ using UnityEngine.Events;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Used to track the rotation in degrees about a defined axis of rotation.
/// Degrees are reported from the starting rotation of the transform.
/// </summary>
public class HVRRotationTracker : MonoBehaviour
{
[Tooltip("Local axis of rotation")]

View File

@ -2,6 +2,9 @@
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Specialized hover behaviour that scales this transform over time when a hand or force grabber is hovering it.
/// </summary>
public class HVRScaleHighlight : HVRGrabbableHoverBase
{
public Vector3 HoverScale = new Vector3(1.3f, 1.3f, 1.3f);

View File

@ -4,6 +4,9 @@ using UnityEngine;
namespace HurricaneVR.Framework.Components
{
/// <summary>
/// Used to define center of mass of the controller relative to the hand for bonus throwing velocity calculations
/// </summary>
public class HVRThrowingCenterOfMass : MonoBehaviour
{
public HVRHandSide HandSide;
@ -36,6 +39,7 @@ namespace HurricaneVR.Framework.Components
switch (controller.ControllerType)
{
case HVRControllerType.Pico:
case HVRControllerType.Oculus:
CenterOfMass = Oculus;
break;

View File

@ -19,6 +19,7 @@ namespace HurricaneVR.Framework.Components
Grabbable = GetComponent<HVRGrabbable>();
Grabbable.HandGrabbed.AddListener(OnHandGrabbed);
Grabbable.HandReleased.AddListener(OnHandReleased);
if (Others != null)
{
@ -33,6 +34,11 @@ namespace HurricaneVR.Framework.Components
}
}
private void OnHandReleased(HVRHandGrabber arg0, HVRGrabbable arg1)
{
Grabbable.ForceTwoHandSettings = false;
}
private void OnHandGrabbed(HVRHandGrabber arg0, HVRGrabbable arg1)
{
foreach (var other in Others)
@ -45,8 +51,21 @@ namespace HurricaneVR.Framework.Components
}
}
private void OnOtherGrabbableHandReleased(HVRHandGrabber arg0, HVRGrabbable arg1)
private void OnOtherGrabbableHandReleased(HVRHandGrabber arg0, HVRGrabbable g)
{
//handle scenario if two "others" are held, then one was released.
var force = false;
for (int i = 0; i < Others.Length; i++)
{
var other = Others[i];
if (other == g || other.HandGrabbers.Count == 0)
continue;
force = true;
break;
}
if (!force)
Grabbable.ForceTwoHandSettings = false;
}

View File

@ -33,7 +33,9 @@ using Valve.VR;
namespace HurricaneVR.Framework.ControllerInput
{
[Serializable]
public class HVRControllerEvent : UnityEvent<HVRController> { }
public class HVRControllerEvent : UnityEvent<HVRController>
{
}
public class HVRInputManager : MonoBehaviour
{
@ -50,15 +52,16 @@ namespace HurricaneVR.Framework.ControllerInput
public const string Reverb = "reverb";
public const string G2 = "g2";
public const string OpenXR_G2 = "hp reverb g2 controller";
public const string Pico = "pico";
public const string LegacyOpenVRName = "OpenVR";
public const string LegacyOculusName = "Oculus";
public const string LegacyNone = "None";
[Header("XR Plugin Detection Names")]
public string OpenVRLoader = "Open VR Loader";
public string OculusLoader = "Oculus Loader";
public string OpenXRLoader = "Open XR Loader";
public string WMRLoader = "Windows MR Loader";
@ -70,9 +73,7 @@ namespace HurricaneVR.Framework.ControllerInput
public static HVRInputManager Instance { get; private set; }
[Header("Oculus - Requires Oculus Asset + Integration")]
[Tooltip("If true ovrinputs will be used")]
public bool UseOVRInputs;
@ -84,10 +85,10 @@ namespace HurricaneVR.Framework.ControllerInput
[Header("SteamVR - Requires SteamVR + Integration")]
public bool InitializeSteamVR = true;
public bool InitializeSteamVRActions = true;
[Header("Input Settings")]
[Tooltip("If true uses the new input system bindings")]
public bool UseNewInputSystem;
@ -105,8 +106,10 @@ namespace HurricaneVR.Framework.ControllerInput
[Header("Device Specific Settings")]
public HVRInputSettings WMRInputMap;
[FormerlySerializedAs("WMRWithButtonsInputMap")]
public HVRInputSettings ReverbG2InputMap;
public HVRInputSettings OculusInputMap;
public HVRInputSettings ViveInputMap;
public HVRInputSettings KnucklesInputMap;
@ -178,8 +181,11 @@ namespace HurricaneVR.Framework.ControllerInput
public string RightManufacturer;
public string RightControllerName;
[SerializeField] private HVRControllerType LeftXRInputSystem = HVRControllerType.None;
[SerializeField] private HVRControllerType RightControllerType = HVRControllerType.None;
[SerializeField]
private HVRControllerType LeftControllerType = HVRControllerType.None;
[SerializeField]
private HVRControllerType RightControllerType = HVRControllerType.None;
public List<string> LeftFeatures = new List<string>();
public List<string> RightFeatures = new List<string>();
@ -243,7 +249,6 @@ namespace HurricaneVR.Framework.ControllerInput
{
get
{
if (!HMDActive)
return false;
@ -258,8 +263,6 @@ namespace HurricaneVR.Framework.ControllerInput
}
#elif !UNITY_2020_1_OR_NEWER
//https://stackoverflow.com/questions/51372771/how-to-check-if-a-hmd-in-unity-2018-is-in-use
#pragma warning disable 0618
//if xr management wasn't detected use the old API for legacy VR
@ -287,6 +290,7 @@ namespace HurricaneVR.Framework.ControllerInput
}
private InputDevice _leftDevice;
public InputDevice LeftDevice
{
get
@ -299,6 +303,7 @@ namespace HurricaneVR.Framework.ControllerInput
}
private InputDevice _rightDevice;
public InputDevice RightDevice
{
get
@ -311,8 +316,6 @@ namespace HurricaneVR.Framework.ControllerInput
}
private bool _isHMDFirstActivationReported;
@ -392,7 +395,7 @@ namespace HurricaneVR.Framework.ControllerInput
#if HVR_OCULUS
if (UseOVRInputs && ForceOVRInputUpdate && (LeftXRInputSystem == HVRControllerType.Oculus || RightControllerType == HVRControllerType.Oculus))
if (UseOVRInputs && ForceOVRInputUpdate && (LeftControllerType == HVRControllerType.Oculus || RightControllerType == HVRControllerType.Oculus))
{
HVROculusController.UpdateOVRInput();
}
@ -552,7 +555,6 @@ namespace HurricaneVR.Framework.ControllerInput
RightController = UpdateController(RightControllerType, device, HVRHandSide.Right);
if (device.isValid)
RightControllerConnected.Invoke(RightController);
}
private void UpdateLeftController(InputDevice device)
@ -574,8 +576,8 @@ namespace HurricaneVR.Framework.ControllerInput
}
}
LeftXRInputSystem = GetController(LeftDevice.manufacturer?.ToLower(), LeftDevice.name?.ToLower());
LeftController = UpdateController(LeftXRInputSystem, device, HVRHandSide.Left);
LeftControllerType = GetController(LeftDevice.manufacturer?.ToLower(), LeftDevice.name?.ToLower());
LeftController = UpdateController(LeftControllerType, device, HVRHandSide.Left);
if (device.isValid)
LeftControllerConnected.Invoke(LeftController);
}
@ -613,6 +615,7 @@ namespace HurricaneVR.Framework.ControllerInput
inputMap = WMRInputMap;
deadZone = WMRDeadzone;
break;
case HVRControllerType.Pico:
case HVRControllerType.Oculus:
inputMap = OculusInputMap;
deadZone = OculusDeadzone;
@ -801,7 +804,6 @@ namespace HurricaneVR.Framework.ControllerInput
}
if (manufaturerToLower.Contains(Oculus))
{
return HVRControllerType.Oculus;
@ -832,6 +834,8 @@ namespace HurricaneVR.Framework.ControllerInput
return HVRControllerType.WMR;
}
if (nameToLower.Contains(Pico))
return HVRControllerType.Pico;
return HVRControllerType.None;
}
@ -896,6 +900,7 @@ namespace HurricaneVR.Framework.ControllerInput
{
Debug.LogWarning($"HVR: {OpenVRLoader} active without SteamVR installed or HVR_STEAMVR define set.");
}
CurrentSDK = InputSDK.SteamVR;
return;
}
@ -906,7 +911,7 @@ namespace HurricaneVR.Framework.ControllerInput
}
//legacy vr
if (LeftXRInputSystem == HVRControllerType.Oculus || RightControllerType == HVRControllerType.Oculus)
if (LeftControllerType == HVRControllerType.Oculus || RightControllerType == HVRControllerType.Oculus)
{
CurrentSDK = UseOVRInputs ? InputSDK.Oculus : InputSDK.XRInput;
return;
@ -926,7 +931,6 @@ namespace HurricaneVR.Framework.ControllerInput
#if !OPENVR_DESKTOP && !OPENVR_XR
return false;
#else
#if OPENVR_DESKTOP
if (!Valve.VR.SteamVR.usingNativeSupport)
@ -977,13 +981,12 @@ namespace HurricaneVR.Framework.ControllerInput
#else
loaders = string.Join(",", XRGeneralSettings.Instance.Manager.loaders.Select(e => e.name));
#endif
Debug.Log($"{ XRGeneralSettings.Instance.Manager.automaticLoading}");
Debug.Log($"XRGeneralSettings.Instance.Manager.isInitializationComplete { XRGeneralSettings.Instance.Manager.isInitializationComplete}");
Debug.Log($"{XRGeneralSettings.Instance.Manager.automaticLoading}");
Debug.Log($"XRGeneralSettings.Instance.Manager.isInitializationComplete {XRGeneralSettings.Instance.Manager.isInitializationComplete}");
Debug.Log($"XRPlugin Detected | XRSettings.enabled {XRSettings.enabled} | Loader : {XRPluginLoader} | Loaders Enabled: {loaders}");
XRPluginActive = XRSettings.enabled && XRGeneralSettings.Instance.Manager.isInitializationComplete;
#elif !UNITY_2020_1_OR_NEWER
var legacyDevices = "";
foreach (var t in XRSettings.supportedDevices)
{
@ -1025,7 +1028,6 @@ namespace HurricaneVR.Framework.ControllerInput
}
public void StopXR()
{
#if USING_XR_MANAGEMENT
@ -1059,10 +1061,8 @@ namespace HurricaneVR.Framework.ControllerInput
Debug.LogWarning($"XR Plugin Management is in use. Cannot load Legacy VR");
return;
#elif !UNITY_2020_1_OR_NEWER
StartCoroutine(LoadLegacy(callback));
#endif
}
@ -1101,6 +1101,7 @@ namespace HurricaneVR.Framework.ControllerInput
{
callback(false);
}
LegacyActive = false;
}
}
@ -1152,7 +1153,6 @@ namespace HurricaneVR.Framework.ControllerInput
IsSteamVR = true;
#endif
}
private void StopSteamVR()
@ -1198,8 +1198,6 @@ namespace HurricaneVR.Framework.ControllerInput
}
#elif !UNITY_2020_1_OR_NEWER
if (originFlags == TrackingOriginModeFlags.Floor)
{
#pragma warning disable 0618
@ -1220,7 +1218,6 @@ namespace HurricaneVR.Framework.ControllerInput
}
#endif
}
}
@ -1229,5 +1226,4 @@ namespace HurricaneVR.Framework.ControllerInput
Legacy,
XRPlugin
}
}

View File

@ -16,6 +16,7 @@ namespace HurricaneVR.Framework.ControllerInput
{
[Header("Grab Settings")]
public bool CanDistanceGrab = true;
public bool CanTriggerGrab;
[Tooltip("For non flick style force grabber")]
@ -26,6 +27,7 @@ namespace HurricaneVR.Framework.ControllerInput
[Header("Inputs Debugging")]
public Vector2 MovementAxis;
public Vector2 TurnAxis;
public bool IsTeleportActivated;
@ -88,6 +90,15 @@ namespace HurricaneVR.Framework.ControllerInput
AfterInputUpdate();
}
protected virtual void OnEnable()
{
}
protected virtual void OnDisable()
{
}
protected virtual void UpdateInput()
{
if (!UpdateInputs)
@ -130,11 +141,9 @@ namespace HurricaneVR.Framework.ControllerInput
protected virtual void AfterInputUpdate()
{
}
protected void ResetState(ref HVRButtonState buttonState)
{
buttonState.JustDeactivated = false;
@ -172,18 +181,19 @@ namespace HurricaneVR.Framework.ControllerInput
{
if (RightController.ControllerType == HVRControllerType.Vive)
{
return false;//todo
return false; //todo
}
return false;
}
protected virtual void GetForceGrabActivated(out bool left, out bool right)
{
if (!CanDistanceGrab)
{
left = false;
right = false;
if (!CanDistanceGrab)
{
return;
}
@ -192,25 +202,53 @@ namespace HurricaneVR.Framework.ControllerInput
left = LeftController.GripButtonState.JustActivated;
right = RightController.GripButtonState.JustActivated;
}
else
else if (ForceGrabActivation == HVRForceGrabActivation.GripAndTrigger)
{
left = LeftController.GripButtonState.Active && LeftController.TriggerButtonState.JustActivated || LeftController.TriggerButtonState.Active && LeftController.GripButtonState.JustActivated;
right = RightController.GripButtonState.Active && RightController.TriggerButtonState.JustActivated || RightController.TriggerButtonState.Active && RightController.GripButtonState.JustActivated;
left = LeftController.GripButtonState.Active && LeftTriggerGrabState.JustActivated || LeftTriggerGrabState.Active && LeftController.GripButtonState.JustActivated;
right = RightController.GripButtonState.Active && RightTriggerGrabState.JustActivated || RightTriggerGrabState.Active && RightController.GripButtonState.JustActivated;
}
else if (ForceGrabActivation == HVRForceGrabActivation.Trigger)
{
left = LeftTriggerGrabState.JustActivated;
right = RightTriggerGrabState.JustActivated;
}
else if (ForceGrabActivation == HVRForceGrabActivation.GripOrTrigger)
{
left = LeftController.GripButtonState.JustActivated || LeftTriggerGrabState.JustActivated;
right = RightController.GripButtonState.JustActivated || RightTriggerGrabState.JustActivated;
}
}
protected virtual void GetForceGrabActive(out bool left, out bool right)
{
if (!CanDistanceGrab)
{
left = false;
right = false;
if (!CanDistanceGrab)
{
return;
}
if (ForceGrabActivation == HVRForceGrabActivation.Grip)
{
left = LeftController.GripButtonState.Active;
right = RightController.GripButtonState.Active;
}
else if (ForceGrabActivation == HVRForceGrabActivation.GripAndTrigger || ForceGrabActivation == HVRForceGrabActivation.GripOrTrigger)
{
left = LeftController.GripButtonState.Active || LeftTriggerGrabState.Active;
right = RightController.GripButtonState.Active || RightTriggerGrabState.Active;
}
else if (ForceGrabActivation == HVRForceGrabActivation.Trigger)
{
left = LeftTriggerGrabState.Active;
right = RightTriggerGrabState.Active;
}
}
public bool GetForceGrabActivated(HVRHandSide side)
{
@ -237,11 +275,6 @@ namespace HurricaneVR.Framework.ControllerInput
return side == HVRHandSide.Left ? IsLeftGrabActivated : IsRightGrabActivated;
}
public bool GetHoldActive(HVRHandSide side)
{
return side == HVRHandSide.Left ? IsLeftHoldActive : IsRightHoldActive;
}
public bool GetGripHoldActive(HVRHandSide side)
{
return side == HVRHandSide.Left ? IsLeftGripHoldActive : IsRightGripHoldActive;
@ -266,6 +299,7 @@ namespace HurricaneVR.Framework.ControllerInput
{
return true;
}
return LeftController.GripButtonState.Active;
}
@ -283,6 +317,7 @@ namespace HurricaneVR.Framework.ControllerInput
{
return true;
}
return RightController.GripButtonState.Active;
}
@ -358,6 +393,7 @@ namespace HurricaneVR.Framework.ControllerInput
{
return LeftController.TrackpadAxis;
}
return Vector2.zero;
}
@ -371,9 +407,9 @@ namespace HurricaneVR.Framework.ControllerInput
if (RightController.TrackpadButtonState.Active)
{
return RightController.TrackpadAxis;
}
return Vector2.zero;
}
@ -458,6 +494,8 @@ namespace HurricaneVR.Framework.ControllerInput
public enum HVRForceGrabActivation
{
Grip,
GripHoldTriggerPress
GripAndTrigger,
Trigger,
GripOrTrigger
}
}

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.3.0
// version 1.5.0
// from Assets/HurricaneVR/Framework/Scripts/ControllerInput/InputSystem/HVRInputActions.inputactions
//
// Changes to this file may cause incorrect behavior and will be lost if
@ -15,7 +15,7 @@ using System.Collections.Generic;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities;
public partial class @HVRInputActions : IInputActionCollection2, IDisposable
public partial class @HVRInputActions: IInputActionCollection2, IDisposable
{
public InputActionAsset asset { get; }
public @HVRInputActions()
@ -275,6 +275,28 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""692f48f9-3f21-406f-b2d5-5b5e0c4c2761"",
""path"": ""<OculusTouchController>{LeftHand}/menu"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Menu"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""d55f9044-c561-4b40-957b-ad0bd93adc50"",
""path"": ""<WMRSpatialController>{LeftHand}/menu"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Menu"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""54ac7ab0-8ca9-4cbc-a6d1-da5ee0b055cb"",
@ -738,6 +760,17 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""0c608bc0-1dda-4d95-8e76-add87e298bcc"",
""path"": ""<WMRSpatialController>{LeftHand}/menu"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Menu"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""488857b2-965c-486c-b24e-e21628ad2a07"",
@ -1167,12 +1200,14 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
{
asset.Disable();
}
public IEnumerable<InputBinding> bindings => asset.bindings;
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
{
return asset.FindAction(actionNameOrId, throwIfNotFound);
}
public int FindBinding(InputBinding bindingMask, out InputAction action)
{
return asset.FindBinding(bindingMask, out action);
@ -1180,7 +1215,7 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
// LeftHand
private readonly InputActionMap m_LeftHand;
private ILeftHandActions m_LeftHandActionsCallbackInterface;
private List<ILeftHandActions> m_LeftHandActionsCallbackInterfaces = new List<ILeftHandActions>();
private readonly InputAction m_LeftHand_TriggerPress;
private readonly InputAction m_LeftHand_Trigger;
private readonly InputAction m_LeftHand_PrimaryButton;
@ -1230,74 +1265,10 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(LeftHandActions set) { return set.Get(); }
public void SetCallbacks(ILeftHandActions instance)
{
if (m_Wrapper.m_LeftHandActionsCallbackInterface != null)
{
@TriggerPress.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTriggerPress;
@TriggerPress.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTriggerPress;
@TriggerPress.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTriggerPress;
@Trigger.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTrigger;
@Trigger.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTrigger;
@Trigger.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTrigger;
@PrimaryButton.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimaryButton;
@PrimaryButton.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimaryButton;
@PrimaryButton.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimaryButton;
@PrimaryTouch.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimaryTouch;
@PrimaryTouch.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimaryTouch;
@PrimaryTouch.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimaryTouch;
@Menu.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnMenu;
@Menu.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnMenu;
@Menu.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnMenu;
@Primary2DAxis.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimary2DAxis;
@Primary2DAxis.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimary2DAxis;
@Primary2DAxis.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimary2DAxis;
@Primary2DAxisClick.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimary2DAxisClick;
@Primary2DAxisClick.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimary2DAxisClick;
@Primary2DAxisClick.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimary2DAxisClick;
@Primary2DAxisTouch.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimary2DAxisTouch;
@Primary2DAxisTouch.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimary2DAxisTouch;
@Primary2DAxisTouch.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnPrimary2DAxisTouch;
@Secondary2DAxis.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondary2DAxis;
@Secondary2DAxis.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondary2DAxis;
@Secondary2DAxis.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondary2DAxis;
@Secondary2DAxisClick.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondary2DAxisClick;
@Secondary2DAxisClick.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondary2DAxisClick;
@Secondary2DAxisClick.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondary2DAxisClick;
@Secondary2DAxisTouch.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondary2DAxisTouch;
@Secondary2DAxisTouch.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondary2DAxisTouch;
@Secondary2DAxisTouch.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondary2DAxisTouch;
@Grip.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnGrip;
@Grip.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnGrip;
@Grip.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnGrip;
@GripPress.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnGripPress;
@GripPress.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnGripPress;
@GripPress.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnGripPress;
@GripForce.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnGripForce;
@GripForce.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnGripForce;
@GripForce.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnGripForce;
@SecondaryButton.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondaryButton;
@SecondaryButton.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondaryButton;
@SecondaryButton.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondaryButton;
@SecondaryTouch.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondaryTouch;
@SecondaryTouch.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondaryTouch;
@SecondaryTouch.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnSecondaryTouch;
@TriggerTouch.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTriggerTouch;
@TriggerTouch.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTriggerTouch;
@TriggerTouch.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTriggerTouch;
@ControllerPosition.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnControllerPosition;
@ControllerPosition.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnControllerPosition;
@ControllerPosition.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnControllerPosition;
@ControllerRotation.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnControllerRotation;
@ControllerRotation.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnControllerRotation;
@ControllerRotation.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnControllerRotation;
@Haptics.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnHaptics;
@Haptics.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnHaptics;
@Haptics.canceled -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnHaptics;
}
m_Wrapper.m_LeftHandActionsCallbackInterface = instance;
if (instance != null)
public void AddCallbacks(ILeftHandActions instance)
{
if (instance == null || m_Wrapper.m_LeftHandActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_LeftHandActionsCallbackInterfaces.Add(instance);
@TriggerPress.started += instance.OnTriggerPress;
@TriggerPress.performed += instance.OnTriggerPress;
@TriggerPress.canceled += instance.OnTriggerPress;
@ -1359,13 +1330,90 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
@Haptics.performed += instance.OnHaptics;
@Haptics.canceled += instance.OnHaptics;
}
private void UnregisterCallbacks(ILeftHandActions instance)
{
@TriggerPress.started -= instance.OnTriggerPress;
@TriggerPress.performed -= instance.OnTriggerPress;
@TriggerPress.canceled -= instance.OnTriggerPress;
@Trigger.started -= instance.OnTrigger;
@Trigger.performed -= instance.OnTrigger;
@Trigger.canceled -= instance.OnTrigger;
@PrimaryButton.started -= instance.OnPrimaryButton;
@PrimaryButton.performed -= instance.OnPrimaryButton;
@PrimaryButton.canceled -= instance.OnPrimaryButton;
@PrimaryTouch.started -= instance.OnPrimaryTouch;
@PrimaryTouch.performed -= instance.OnPrimaryTouch;
@PrimaryTouch.canceled -= instance.OnPrimaryTouch;
@Menu.started -= instance.OnMenu;
@Menu.performed -= instance.OnMenu;
@Menu.canceled -= instance.OnMenu;
@Primary2DAxis.started -= instance.OnPrimary2DAxis;
@Primary2DAxis.performed -= instance.OnPrimary2DAxis;
@Primary2DAxis.canceled -= instance.OnPrimary2DAxis;
@Primary2DAxisClick.started -= instance.OnPrimary2DAxisClick;
@Primary2DAxisClick.performed -= instance.OnPrimary2DAxisClick;
@Primary2DAxisClick.canceled -= instance.OnPrimary2DAxisClick;
@Primary2DAxisTouch.started -= instance.OnPrimary2DAxisTouch;
@Primary2DAxisTouch.performed -= instance.OnPrimary2DAxisTouch;
@Primary2DAxisTouch.canceled -= instance.OnPrimary2DAxisTouch;
@Secondary2DAxis.started -= instance.OnSecondary2DAxis;
@Secondary2DAxis.performed -= instance.OnSecondary2DAxis;
@Secondary2DAxis.canceled -= instance.OnSecondary2DAxis;
@Secondary2DAxisClick.started -= instance.OnSecondary2DAxisClick;
@Secondary2DAxisClick.performed -= instance.OnSecondary2DAxisClick;
@Secondary2DAxisClick.canceled -= instance.OnSecondary2DAxisClick;
@Secondary2DAxisTouch.started -= instance.OnSecondary2DAxisTouch;
@Secondary2DAxisTouch.performed -= instance.OnSecondary2DAxisTouch;
@Secondary2DAxisTouch.canceled -= instance.OnSecondary2DAxisTouch;
@Grip.started -= instance.OnGrip;
@Grip.performed -= instance.OnGrip;
@Grip.canceled -= instance.OnGrip;
@GripPress.started -= instance.OnGripPress;
@GripPress.performed -= instance.OnGripPress;
@GripPress.canceled -= instance.OnGripPress;
@GripForce.started -= instance.OnGripForce;
@GripForce.performed -= instance.OnGripForce;
@GripForce.canceled -= instance.OnGripForce;
@SecondaryButton.started -= instance.OnSecondaryButton;
@SecondaryButton.performed -= instance.OnSecondaryButton;
@SecondaryButton.canceled -= instance.OnSecondaryButton;
@SecondaryTouch.started -= instance.OnSecondaryTouch;
@SecondaryTouch.performed -= instance.OnSecondaryTouch;
@SecondaryTouch.canceled -= instance.OnSecondaryTouch;
@TriggerTouch.started -= instance.OnTriggerTouch;
@TriggerTouch.performed -= instance.OnTriggerTouch;
@TriggerTouch.canceled -= instance.OnTriggerTouch;
@ControllerPosition.started -= instance.OnControllerPosition;
@ControllerPosition.performed -= instance.OnControllerPosition;
@ControllerPosition.canceled -= instance.OnControllerPosition;
@ControllerRotation.started -= instance.OnControllerRotation;
@ControllerRotation.performed -= instance.OnControllerRotation;
@ControllerRotation.canceled -= instance.OnControllerRotation;
@Haptics.started -= instance.OnHaptics;
@Haptics.performed -= instance.OnHaptics;
@Haptics.canceled -= instance.OnHaptics;
}
public void RemoveCallbacks(ILeftHandActions instance)
{
if (m_Wrapper.m_LeftHandActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
public void SetCallbacks(ILeftHandActions instance)
{
foreach (var item in m_Wrapper.m_LeftHandActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_LeftHandActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
public LeftHandActions @LeftHand => new LeftHandActions(this);
// RightHand
private readonly InputActionMap m_RightHand;
private IRightHandActions m_RightHandActionsCallbackInterface;
private List<IRightHandActions> m_RightHandActionsCallbackInterfaces = new List<IRightHandActions>();
private readonly InputAction m_RightHand_TriggerPress;
private readonly InputAction m_RightHand_Trigger;
private readonly InputAction m_RightHand_PrimaryButton;
@ -1415,74 +1463,10 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(RightHandActions set) { return set.Get(); }
public void SetCallbacks(IRightHandActions instance)
{
if (m_Wrapper.m_RightHandActionsCallbackInterface != null)
{
@TriggerPress.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTriggerPress;
@TriggerPress.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTriggerPress;
@TriggerPress.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTriggerPress;
@Trigger.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTrigger;
@Trigger.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTrigger;
@Trigger.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTrigger;
@PrimaryButton.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimaryButton;
@PrimaryButton.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimaryButton;
@PrimaryButton.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimaryButton;
@PrimaryTouch.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimaryTouch;
@PrimaryTouch.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimaryTouch;
@PrimaryTouch.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimaryTouch;
@Menu.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnMenu;
@Menu.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnMenu;
@Menu.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnMenu;
@Primary2DAxis.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimary2DAxis;
@Primary2DAxis.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimary2DAxis;
@Primary2DAxis.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimary2DAxis;
@Primary2DAxisClick.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimary2DAxisClick;
@Primary2DAxisClick.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimary2DAxisClick;
@Primary2DAxisClick.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimary2DAxisClick;
@Primary2DAxisTouch.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimary2DAxisTouch;
@Primary2DAxisTouch.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimary2DAxisTouch;
@Primary2DAxisTouch.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnPrimary2DAxisTouch;
@Secondary2DAxis.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondary2DAxis;
@Secondary2DAxis.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondary2DAxis;
@Secondary2DAxis.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondary2DAxis;
@Secondary2DAxisClick.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondary2DAxisClick;
@Secondary2DAxisClick.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondary2DAxisClick;
@Secondary2DAxisClick.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondary2DAxisClick;
@Secondary2DAxisTouch.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondary2DAxisTouch;
@Secondary2DAxisTouch.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondary2DAxisTouch;
@Secondary2DAxisTouch.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondary2DAxisTouch;
@Grip.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnGrip;
@Grip.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnGrip;
@Grip.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnGrip;
@GripPress.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnGripPress;
@GripPress.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnGripPress;
@GripPress.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnGripPress;
@GripForce.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnGripForce;
@GripForce.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnGripForce;
@GripForce.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnGripForce;
@SecondaryButton.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondaryButton;
@SecondaryButton.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondaryButton;
@SecondaryButton.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondaryButton;
@SecondaryTouch.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondaryTouch;
@SecondaryTouch.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondaryTouch;
@SecondaryTouch.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnSecondaryTouch;
@TriggerTouch.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTriggerTouch;
@TriggerTouch.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTriggerTouch;
@TriggerTouch.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTriggerTouch;
@ControllerPosition.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnControllerPosition;
@ControllerPosition.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnControllerPosition;
@ControllerPosition.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnControllerPosition;
@ControllerRotation.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnControllerRotation;
@ControllerRotation.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnControllerRotation;
@ControllerRotation.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnControllerRotation;
@Haptics.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnHaptics;
@Haptics.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnHaptics;
@Haptics.canceled -= m_Wrapper.m_RightHandActionsCallbackInterface.OnHaptics;
}
m_Wrapper.m_RightHandActionsCallbackInterface = instance;
if (instance != null)
public void AddCallbacks(IRightHandActions instance)
{
if (instance == null || m_Wrapper.m_RightHandActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_RightHandActionsCallbackInterfaces.Add(instance);
@TriggerPress.started += instance.OnTriggerPress;
@TriggerPress.performed += instance.OnTriggerPress;
@TriggerPress.canceled += instance.OnTriggerPress;
@ -1544,13 +1528,90 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
@Haptics.performed += instance.OnHaptics;
@Haptics.canceled += instance.OnHaptics;
}
private void UnregisterCallbacks(IRightHandActions instance)
{
@TriggerPress.started -= instance.OnTriggerPress;
@TriggerPress.performed -= instance.OnTriggerPress;
@TriggerPress.canceled -= instance.OnTriggerPress;
@Trigger.started -= instance.OnTrigger;
@Trigger.performed -= instance.OnTrigger;
@Trigger.canceled -= instance.OnTrigger;
@PrimaryButton.started -= instance.OnPrimaryButton;
@PrimaryButton.performed -= instance.OnPrimaryButton;
@PrimaryButton.canceled -= instance.OnPrimaryButton;
@PrimaryTouch.started -= instance.OnPrimaryTouch;
@PrimaryTouch.performed -= instance.OnPrimaryTouch;
@PrimaryTouch.canceled -= instance.OnPrimaryTouch;
@Menu.started -= instance.OnMenu;
@Menu.performed -= instance.OnMenu;
@Menu.canceled -= instance.OnMenu;
@Primary2DAxis.started -= instance.OnPrimary2DAxis;
@Primary2DAxis.performed -= instance.OnPrimary2DAxis;
@Primary2DAxis.canceled -= instance.OnPrimary2DAxis;
@Primary2DAxisClick.started -= instance.OnPrimary2DAxisClick;
@Primary2DAxisClick.performed -= instance.OnPrimary2DAxisClick;
@Primary2DAxisClick.canceled -= instance.OnPrimary2DAxisClick;
@Primary2DAxisTouch.started -= instance.OnPrimary2DAxisTouch;
@Primary2DAxisTouch.performed -= instance.OnPrimary2DAxisTouch;
@Primary2DAxisTouch.canceled -= instance.OnPrimary2DAxisTouch;
@Secondary2DAxis.started -= instance.OnSecondary2DAxis;
@Secondary2DAxis.performed -= instance.OnSecondary2DAxis;
@Secondary2DAxis.canceled -= instance.OnSecondary2DAxis;
@Secondary2DAxisClick.started -= instance.OnSecondary2DAxisClick;
@Secondary2DAxisClick.performed -= instance.OnSecondary2DAxisClick;
@Secondary2DAxisClick.canceled -= instance.OnSecondary2DAxisClick;
@Secondary2DAxisTouch.started -= instance.OnSecondary2DAxisTouch;
@Secondary2DAxisTouch.performed -= instance.OnSecondary2DAxisTouch;
@Secondary2DAxisTouch.canceled -= instance.OnSecondary2DAxisTouch;
@Grip.started -= instance.OnGrip;
@Grip.performed -= instance.OnGrip;
@Grip.canceled -= instance.OnGrip;
@GripPress.started -= instance.OnGripPress;
@GripPress.performed -= instance.OnGripPress;
@GripPress.canceled -= instance.OnGripPress;
@GripForce.started -= instance.OnGripForce;
@GripForce.performed -= instance.OnGripForce;
@GripForce.canceled -= instance.OnGripForce;
@SecondaryButton.started -= instance.OnSecondaryButton;
@SecondaryButton.performed -= instance.OnSecondaryButton;
@SecondaryButton.canceled -= instance.OnSecondaryButton;
@SecondaryTouch.started -= instance.OnSecondaryTouch;
@SecondaryTouch.performed -= instance.OnSecondaryTouch;
@SecondaryTouch.canceled -= instance.OnSecondaryTouch;
@TriggerTouch.started -= instance.OnTriggerTouch;
@TriggerTouch.performed -= instance.OnTriggerTouch;
@TriggerTouch.canceled -= instance.OnTriggerTouch;
@ControllerPosition.started -= instance.OnControllerPosition;
@ControllerPosition.performed -= instance.OnControllerPosition;
@ControllerPosition.canceled -= instance.OnControllerPosition;
@ControllerRotation.started -= instance.OnControllerRotation;
@ControllerRotation.performed -= instance.OnControllerRotation;
@ControllerRotation.canceled -= instance.OnControllerRotation;
@Haptics.started -= instance.OnHaptics;
@Haptics.performed -= instance.OnHaptics;
@Haptics.canceled -= instance.OnHaptics;
}
public void RemoveCallbacks(IRightHandActions instance)
{
if (m_Wrapper.m_RightHandActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
public void SetCallbacks(IRightHandActions instance)
{
foreach (var item in m_Wrapper.m_RightHandActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_RightHandActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
public RightHandActions @RightHand => new RightHandActions(this);
// HMD
private readonly InputActionMap m_HMD;
private IHMDActions m_HMDActionsCallbackInterface;
private List<IHMDActions> m_HMDActionsCallbackInterfaces = new List<IHMDActions>();
private readonly InputAction m_HMD_hmdPosition;
private readonly InputAction m_HMD_hmdRotation;
public struct HMDActions
@ -1564,20 +1625,10 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(HMDActions set) { return set.Get(); }
public void SetCallbacks(IHMDActions instance)
{
if (m_Wrapper.m_HMDActionsCallbackInterface != null)
{
@hmdPosition.started -= m_Wrapper.m_HMDActionsCallbackInterface.OnHmdPosition;
@hmdPosition.performed -= m_Wrapper.m_HMDActionsCallbackInterface.OnHmdPosition;
@hmdPosition.canceled -= m_Wrapper.m_HMDActionsCallbackInterface.OnHmdPosition;
@hmdRotation.started -= m_Wrapper.m_HMDActionsCallbackInterface.OnHmdRotation;
@hmdRotation.performed -= m_Wrapper.m_HMDActionsCallbackInterface.OnHmdRotation;
@hmdRotation.canceled -= m_Wrapper.m_HMDActionsCallbackInterface.OnHmdRotation;
}
m_Wrapper.m_HMDActionsCallbackInterface = instance;
if (instance != null)
public void AddCallbacks(IHMDActions instance)
{
if (instance == null || m_Wrapper.m_HMDActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_HMDActionsCallbackInterfaces.Add(instance);
@hmdPosition.started += instance.OnHmdPosition;
@hmdPosition.performed += instance.OnHmdPosition;
@hmdPosition.canceled += instance.OnHmdPosition;
@ -1585,13 +1636,36 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
@hmdRotation.performed += instance.OnHmdRotation;
@hmdRotation.canceled += instance.OnHmdRotation;
}
private void UnregisterCallbacks(IHMDActions instance)
{
@hmdPosition.started -= instance.OnHmdPosition;
@hmdPosition.performed -= instance.OnHmdPosition;
@hmdPosition.canceled -= instance.OnHmdPosition;
@hmdRotation.started -= instance.OnHmdRotation;
@hmdRotation.performed -= instance.OnHmdRotation;
@hmdRotation.canceled -= instance.OnHmdRotation;
}
public void RemoveCallbacks(IHMDActions instance)
{
if (m_Wrapper.m_HMDActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
public void SetCallbacks(IHMDActions instance)
{
foreach (var item in m_Wrapper.m_HMDActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_HMDActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
public HMDActions @HMD => new HMDActions(this);
// UI
private readonly InputActionMap m_UI;
private IUIActions m_UIActionsCallbackInterface;
private List<IUIActions> m_UIActionsCallbackInterfaces = new List<IUIActions>();
private readonly InputAction m_UI_Click;
private readonly InputAction m_UI_pointerPosition;
private readonly InputAction m_UI_pointerRotation;
@ -1607,23 +1681,10 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(UIActions set) { return set.Get(); }
public void SetCallbacks(IUIActions instance)
{
if (m_Wrapper.m_UIActionsCallbackInterface != null)
{
@Click.started -= m_Wrapper.m_UIActionsCallbackInterface.OnClick;
@Click.performed -= m_Wrapper.m_UIActionsCallbackInterface.OnClick;
@Click.canceled -= m_Wrapper.m_UIActionsCallbackInterface.OnClick;
@pointerPosition.started -= m_Wrapper.m_UIActionsCallbackInterface.OnPointerPosition;
@pointerPosition.performed -= m_Wrapper.m_UIActionsCallbackInterface.OnPointerPosition;
@pointerPosition.canceled -= m_Wrapper.m_UIActionsCallbackInterface.OnPointerPosition;
@pointerRotation.started -= m_Wrapper.m_UIActionsCallbackInterface.OnPointerRotation;
@pointerRotation.performed -= m_Wrapper.m_UIActionsCallbackInterface.OnPointerRotation;
@pointerRotation.canceled -= m_Wrapper.m_UIActionsCallbackInterface.OnPointerRotation;
}
m_Wrapper.m_UIActionsCallbackInterface = instance;
if (instance != null)
public void AddCallbacks(IUIActions instance)
{
if (instance == null || m_Wrapper.m_UIActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_UIActionsCallbackInterfaces.Add(instance);
@Click.started += instance.OnClick;
@Click.performed += instance.OnClick;
@Click.canceled += instance.OnClick;
@ -1634,6 +1695,32 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
@pointerRotation.performed += instance.OnPointerRotation;
@pointerRotation.canceled += instance.OnPointerRotation;
}
private void UnregisterCallbacks(IUIActions instance)
{
@Click.started -= instance.OnClick;
@Click.performed -= instance.OnClick;
@Click.canceled -= instance.OnClick;
@pointerPosition.started -= instance.OnPointerPosition;
@pointerPosition.performed -= instance.OnPointerPosition;
@pointerPosition.canceled -= instance.OnPointerPosition;
@pointerRotation.started -= instance.OnPointerRotation;
@pointerRotation.performed -= instance.OnPointerRotation;
@pointerRotation.canceled -= instance.OnPointerRotation;
}
public void RemoveCallbacks(IUIActions instance)
{
if (m_Wrapper.m_UIActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
public void SetCallbacks(IUIActions instance)
{
foreach (var item in m_Wrapper.m_UIActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_UIActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
public UIActions @UI => new UIActions(this);

View File

@ -233,6 +233,28 @@
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "692f48f9-3f21-406f-b2d5-5b5e0c4c2761",
"path": "<OculusTouchController>{LeftHand}/menu",
"interactions": "",
"processors": "",
"groups": "",
"action": "Menu",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "d55f9044-c561-4b40-957b-ad0bd93adc50",
"path": "<WMRSpatialController>{LeftHand}/menu",
"interactions": "",
"processors": "",
"groups": "",
"action": "Menu",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "54ac7ab0-8ca9-4cbc-a6d1-da5ee0b055cb",
@ -676,6 +698,17 @@
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "0c608bc0-1dda-4d95-8e76-add87e298bcc",
"path": "<WMRSpatialController>{LeftHand}/menu",
"interactions": "",
"processors": "",
"groups": "",
"action": "Menu",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "488857b2-965c-486c-b24e-e21628ad2a07",

View File

@ -7,6 +7,9 @@ using UnityEngine;
namespace HurricaneVR.Framework.Core.Bags
{
/// <summary>
/// Used by the hand to detect sockets for removing objects from them
/// </summary>
public class HVRSocketBag : MonoBehaviour, IComparer<HVRSocket>
{
private readonly Dictionary<HVRSocket, HashSet<Collider>> _map = new Dictionary<HVRSocket, HashSet<Collider>>();
@ -53,6 +56,9 @@ namespace HurricaneVR.Framework.Core.Bags
Calculate();
}
/// <summary>
/// Causes the bag to ignore the provided socket when it's trigger collider overlaps ours.
/// </summary>
public void IgnoreSocket(HVRSocket socket)
{
if (_ignoredSockets == null)
@ -63,6 +69,14 @@ namespace HurricaneVR.Framework.Core.Bags
_ignoredSockets.Add(socket);
}
/// <summary>
/// Stops ignoring the provided socket
/// </summary>
public void UnIgnoreSocket(HVRSocket socket)
{
_ignoredSockets.Remove(socket);
}
protected void AddSocket(HVRSocket socket)
{
if (AllSockets.Contains(socket))

View File

@ -209,6 +209,9 @@ namespace HurricaneVR.Framework.Core.Grabbers
public override bool CanGrab(HVRGrabbable grabbable)
{
if (!grabbable.CanHandGrab(HandGrabber))
return false;
if (grabbable.IsSocketed)
return false;
@ -267,6 +270,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
}
args.Grabbable.IsBeingForcedGrabbed = true;
IsForceGrabbing = true;
if (GrabStyle == HVRForceGrabMode.GravityGloves)
{
@ -288,6 +292,13 @@ namespace HurricaneVR.Framework.Core.Grabbers
OnGrabbedHaptics();
}
protected override void OnReleased(HVRGrabbable grabbable)
{
base.OnReleased(grabbable);
grabbable.IsBeingForcedGrabbed = false;
}
protected override void OnHoverEnter(HVRGrabbable grabbable)
{
base.OnHoverEnter(grabbable);
@ -366,7 +377,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
rb.angularDrag = 0f;
rb.drag = 0f;
grabbable.IsBeingForcedGrabbed = true;
IsHoldActive = true;
var grabPoint = grabbable.GetGrabPointTransform(HandGrabber, GrabpointFilter.ForceGrab);
@ -434,7 +444,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
var delta = JointAnchorWorldPosition - grabbableAnchor;
distance = delta.magnitude;
if (isPhysicsGrab && distance < DynamicGrabThreshold && HandGrabber.TryAutoGrab(grabbable, posableGrabPoint))
if (isPhysicsGrab && distance < DynamicGrabThreshold && HandGrabber.TryTransferDistanceGrab(grabbable, posableGrabPoint))
{
rb.angularVelocity = Vector3.zero;
rb.velocity = Vector3.zero;
@ -514,11 +524,12 @@ namespace HurricaneVR.Framework.Core.Grabbers
rb.angularVelocity = Vector3.ClampMagnitude(rb.angularVelocity, settings.MaxMissAngularSpeed);
rb.centerOfMass = com;
if (IsGrabbing)
{
if (distance < limit)
{
if (HandGrabber.TryAutoGrab(grabbable, posableGrabPoint))
if (HandGrabber.TryTransferDistanceGrab(grabbable, posableGrabPoint))
{
rb.angularVelocity = Vector3.zero;
rb.velocity = Vector3.zero;
@ -529,10 +540,15 @@ namespace HurricaneVR.Framework.Core.Grabbers
ForceRelease();
}
}
grabbable.IsBeingForcedGrabbed = false;
else
{
HandGrabber.EnableHandCollision(grabbable);
ForceRelease();
}
}
}
}
@ -558,7 +574,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
_grabbableCollided = false;
IsHoldActive = true;
grabbable.IsBeingForcedGrabbed = true;
grabbable.Rigidbody.useGravity = false;
grabbable.Rigidbody.drag = 0f;
grabbable.Rigidbody.angularDrag = 0f;
@ -621,7 +637,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
if (AutoGrab && HandGrabber.IsValidGrabbable(GrabbedTarget) && HandGrabber.TryAutoGrab(GrabbedTarget, posableGrabPoint))
if (AutoGrab && HandGrabber.IsValidGrabbable(GrabbedTarget) && HandGrabber.TryTransferDistanceGrab(GrabbedTarget, posableGrabPoint))
{
grabbed = true;
IsForceGrabbing = false;
@ -630,7 +646,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
if (AutoGrab && (JointAnchorWorldPosition - grabPoint.position).magnitude < AutoGrabDistance)
{
if (HandGrabber.TryAutoGrab(GrabbedTarget, posableGrabPoint))
if (HandGrabber.TryTransferDistanceGrab(GrabbedTarget, posableGrabPoint))
{
grabbed = true;
IsForceGrabbing = false;
@ -697,7 +713,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
rb.useGravity = useGrav;
rb.drag = drag;
rb.angularDrag = angularDrag;
grabbable.IsBeingForcedGrabbed = false;
grabbable.Collided.RemoveListener(OnGrabbableCollided);
grabbable.Grabbed.RemoveListener(OnGrabbableGrabbed);
}
@ -731,7 +746,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
if ((JointAnchorWorldPosition - t.position).magnitude < AutoGrabDistance)
{
if (HandGrabber.TryAutoGrab(grabbable, grabPoint))
if (HandGrabber.TryTransferDistanceGrab(grabbable, grabPoint))
{
grabbable.Rigidbody.angularVelocity = Vector3.zero;
grabbable.Rigidbody.velocity = Vector3.zero;
@ -761,7 +776,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
private void UpdateGrabIndicator()
{
if (!IsHovering || !_grabIndicator)
if (!IsHovering || !_grabIndicator || !HoverTarget.ShowForceGrabIndicator)
return;
if (_grabIndicator.LookAtCamera && HVRManager.Instance.Camera)

View File

@ -40,6 +40,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
}
public HVRGrabbable HeldObject => GrabbedTarget;
public HVRGrabbable GrabbedTarget
{
@ -453,7 +454,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
var closestValid = ClosestValidHover();
if (closestValid == null)
if (!closestValid )
return false;
HoverGrabbable(this, closestValid);
@ -513,6 +514,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
public virtual bool CanGrab(HVRGrabbable grabbable)
{
if (grabbable.MasterGrabbable && grabbable.MasterGrabbable.IsSocketed)
return false;
return AllowGrabbing && !IsGrabbing;
}
@ -553,15 +556,19 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
}
// ReSharper disable Unity.PerformanceAnalysis
protected virtual void OnHoverEnter(HVRGrabbable grabbable)
{
// Debug.Log($"OnHoverEnter {gameObject.name}");
if(HVRSettings.Instance.VerboseGrabbableEvents)
Debug.Log($"OnHoverEnter {gameObject.name} -> {grabbable.name}");
grabbable.Destroyed.AddListener(OnHoverGrabbableDestroyed);
}
// ReSharper disable Unity.PerformanceAnalysis
protected virtual void OnHoverExit(HVRGrabbable grabbable)
{
// Debug.Log($"OnHoverExit {gameObject.name}");
if(HVRSettings.Instance.VerboseGrabbableEvents)
Debug.Log($"OnHoverExit {gameObject.name}-> {grabbable.name}");
grabbable.Destroyed.RemoveListener(OnHoverGrabbableDestroyed);
}
@ -577,6 +584,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
return false;
}
// ReSharper disable Unity.PerformanceAnalysis
private bool CheckLineOfSight(Vector3 rayOrigin, HVRGrabbable grabbable, LayerMask RaycastLayermask, float rayMaxDistance, List<Collider> colliders, QueryTriggerInteraction queryTrigger, bool useClosestPoint = true)
{
_lineOfSightRay.origin = rayOrigin;
@ -588,7 +596,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
if (!grabbableCollider)
continue;
if (!useClosestPoint || grabbable.HasConcaveColliders && grabbableCollider is MeshCollider meshCollider && !meshCollider.convex)
if (!useClosestPoint || grabbable.HasConcaveColliders && grabbableCollider is MeshCollider meshCollider && !meshCollider.convex ||
grabbable.HasWheelCollider && grabbableCollider is WheelCollider)
{
_lineOfSightRay.direction = grabbableCollider.bounds.center - _lineOfSightRay.origin;
}

View File

@ -4,6 +4,9 @@ using UnityEngine;
namespace HurricaneVR.Framework.Core.Grabbers
{
/// <summary>
/// Example code to grab an object in code on start
/// </summary>
public class HVRHandGrabOnStart : MonoBehaviour
{
public HVRHandGrabber Grabber;
@ -14,14 +17,13 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
if (Grabbable && Grabber)
{
if (Grabber.GrabTrigger == HVRGrabTrigger.Active ||
Grabbable.OverrideGrabTrigger && Grabbable.GrabTrigger == HVRGrabTrigger.Active)
Grabber.Grab(Grabbable, HVRGrabTrigger.Toggle);
if (!Grabber.GrabbedTarget)
{
Debug.LogWarning($"{Grabber.name} and {Grabbable.name} GrabTrigger is set to Active. The object will fall immediately if the user isn't holding the grab button.");
}
Grabbable.transform.position = Grabber.transform.position;
Grabbable.MainTransform.position = Grabber.transform.position;
Grabber.TryGrab(Grabbable, true);
Grabber.GrabToggleActive = true;
}
}
});
}

View File

@ -27,7 +27,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
public HVRSocketBag SocketBag;
[Header("HandSettings")]
[Tooltip("Set to true if the HandModel is an IK target")]
public bool InverseKinematics;
@ -35,7 +34,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
public bool ApplyHandLayer = true;
[Header("Grab Settings")]
[Tooltip("If true the hand will move to the grabbable instead of pulling the grabbable to the hand")]
public bool HandGrabs;
@ -60,7 +58,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
[Tooltip("If true the hand model will be cloned for collision use, and colliders removed off the original hand. This will prevent" +
"unwanted center of mass and inertia tensor recalculations on grabbable objects due to hand model parenting.")]
public bool CloneHandModel = true;
public bool CloneHandModel;
[Tooltip("Ignores hand model parenting distance check.")]
public bool IgnoreParentingDistance;
@ -84,7 +82,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
public float PushoutTime = .1f;
[Header("Pull Settings")]
[Tooltip("Lerps between grabbable starting position and final hand posed position over this amount of time")]
public float PullLerpTime = .06f;
@ -92,12 +89,12 @@ namespace HurricaneVR.Framework.Core.Grabbers
public float MoveThreshold = 10f;
[Header("Components")]
[Tooltip("The hand animator component, loads from children on startup if not supplied.")]
public HVRHandAnimator HandAnimator;
[Tooltip("Component that holds collider information about the hands. Auto populated from children if not set.")]
public HVRHandPhysics HandPhysics;
public HVRPlayerInputs Inputs;
public HVRPhysicsPoser PhysicsPoser;
public HVRForceGrabber ForceGrabber;
@ -110,6 +107,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
[Header("Grab Indicators")]
public HVRGrabbableHoverBase GrabIndicator;
public HVRGrabbableHoverBase TriggerGrabIndicator;
public HVRGrabbableHoverBase DynamicPoseIndicator;
public DynamicPoseGrabIndicator DynamicPoseIndicatorMode = DynamicPoseGrabIndicator.Palm;
@ -118,7 +116,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
public HVRHandPoser FallbackPoser;
[Header("Required Transforms")]
[Tooltip("Object holding the hand model.")]
public Transform HandModel;
@ -134,8 +131,10 @@ namespace HurricaneVR.Framework.Core.Grabbers
[Tooltip("Sphere collider that checks when collisions should be re-enabled between a released grabbable and this hand.")]
public Transform OverlapSizer;
[Header("Throw Settings")]
[Tooltip("Player controller transform, used to find the correct relative velocity of the hands")]
public Transform PlayerController;
[Header("Throw Settings")]
[Tooltip("Factor to apply to the linear velocity of the throw.")]
public float ReleasedVelocityFactor;
@ -154,6 +153,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
[Tooltip("If true throwing takes only the top peak velocities for throwing.")]
public bool TakePeakVelocities;
[DrawIf("TakePeakVelocities", true)]
public int CountPeakVelocities = 3;
@ -164,13 +164,16 @@ namespace HurricaneVR.Framework.Core.Grabbers
public VRHandGrabberEvent BreakDistanceReached = new VRHandGrabberEvent();
[Header("Debugging")]
[Tooltip("If enabled displays vectors involved in throwing calculation.")]
public bool DrawCenterOfMass;
public bool GrabToggleActive;
[SerializeField]
private HVRGrabbable _triggerHoverTarget;
public HVRSocket HoveredSocket;
[SerializeField]
private HVRGrabbable _hoverTarget;
@ -182,6 +185,9 @@ namespace HurricaneVR.Framework.Core.Grabbers
public override bool IsHandGrabber => true;
public bool IsLeftHand => HandSide == HVRHandSide.Left;
public bool IsRightHand => HandSide == HVRHandSide.Right;
public HVRHandStrengthHandler StrengthHandler { get; set; }
public Transform HandModelParent { get; private set; }
@ -238,6 +244,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
public HVRPosableGrabPoint PosableGrabPoint { get; private set; }
private Transform _triggerGrabPoint;
public Transform TriggerGrabPoint
{
get => _triggerGrabPoint;
@ -270,10 +277,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
/// </summary>
public Quaternion PoseWorldRotation
{
get
{
return GrabbedTarget.transform.rotation * PoseLocalRotation;
}
get { return GrabbedTarget.transform.rotation * PoseLocalRotation; }
}
public Vector3 PoseWorldPosition
@ -344,6 +348,12 @@ namespace HurricaneVR.Framework.Core.Grabbers
public bool CanRelease { get; set; } = true;
/// <summary>
/// ignores the next overlap check and enabling of collision with the released grabbable. Useful if grabbing something
/// requires collision to remain disabled with the object that is next released.
/// </summary>
public bool IgnoreNextCollisionCheck { get; set; }
protected Vector3 LineGrabHandVector => transform.rotation * HandModelRotation * _lineGrabHandRelativeDirection;
protected Vector3 LineGrabVector => PosableGrabPoint.WorldLine.normalized * (_flippedLinePose ? -1f : 1f);
@ -370,12 +380,13 @@ namespace HurricaneVR.Framework.Core.Grabbers
private bool _socketGrab;
private HVRPosableHand _posableHand;
private HVRPosableHand _collisionHand;
private bool _hasForceGrabber;
private HVRHandPoseData _physicsPose;
private HVRHandPoseData _savedPose;
private Vector3 _lineGrabHandRelativeDirection;
private WaitForFixedUpdate _wffu;
private bool _moveGrab;
private Vector3 _lastPlayerPos;
private Vector3 _playerVel;
protected bool IsGripGrabActivated;
protected bool IsTriggerGrabActivated;
protected bool IsGripGrabActive;
@ -396,8 +407,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
#endregion
protected override void Awake()
{
base.Awake();
@ -415,7 +424,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
protected override void Start()
{
base.Start();
@ -433,15 +441,14 @@ namespace HurricaneVR.Framework.Core.Grabbers
//created in awake of the hand components if not exist, snapshot in start
StrengthHandler = GetComponent<HVRHandStrengthHandler>();
if (!Inputs)
if (!Inputs && transform.root)
{
Inputs = GetComponentInParent<HVRPlayerInputs>();
Inputs = transform.root.GetComponentInChildren<HVRPlayerInputs>();
}
if (!ForceGrabber)
{
ForceGrabber = GetComponentInChildren<HVRForceGrabber>();
_hasForceGrabber = ForceGrabber;
}
if (!HandAnimator)
@ -515,7 +522,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
//removing colliders from the original hand model
foreach (var col in HandModel.GetComponentsInChildren<Collider>())
{
Destroy(col);
if (!col.isTrigger) Destroy(col);
}
_collisionTransform = handClone.transform;
@ -605,7 +612,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
protected override void FixedUpdate()
{
if(PullingGrabbable) UpdatePullGrabbable();
if (PullingGrabbable) UpdatePullGrabbable();
UpdateLineGrab();
UpdatePostMoveGrab();
UpdatePushing();
@ -814,7 +821,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
var closestValid = ClosestValidHover(false);
if (closestValid == null)
if (!closestValid)
return false;
HoverGrabbable(this, closestValid);
@ -850,7 +857,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
var closestValid = ClosestValidHover(true);
if (closestValid == null)
if (!closestValid)
return false;
OnTriggerHoverEnter(this, closestValid);
@ -858,7 +865,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
private void CheckUntoggleGrab()
{
if (GrabToggleActive && !_checkingSwap)
@ -953,7 +959,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
protected override void CheckGrab()
{
if (!AllowGrabbing || IsGrabbing || GrabbedTarget)
{
return;
@ -999,7 +1004,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
GrabPoint = null;
var gp = HoveredSocket.GrabbedTarget.GetGrabPointTransform(this, GrabpointFilter.Socket);
if (!gp)//in case any socket grab point is invalid, deleted, inactive
if (!gp) //in case any socket grab point is invalid, deleted, inactive
gp = HoveredSocket.GrabbedTarget.GetGrabPointTransform(this, GrabpointFilter.Normal);
GrabPoint = gp;
@ -1072,7 +1077,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
protected virtual void UpdateGrabIndicator()
{
if (!IsHovering || !_grabIndicator)
if (!IsHovering || !_grabIndicator || !HoverTarget.ShowGrabIndicator)
return;
if (_grabIndicator.LookAtCamera && HVRManager.Instance.Camera)
@ -1146,7 +1151,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
protected virtual void UpdateTriggerGrabIndicator()
{
if (!IsTriggerHovering || !_triggerIndicator || IsGrabbing || TriggerHoverTarget == HoverTarget)
if (!IsTriggerHovering || !_triggerIndicator || IsGrabbing || TriggerHoverTarget == HoverTarget || !TriggerHoverTarget.ShowTriggerGrabIndicator)
return;
if (_triggerIndicator.LookAtCamera && HVRManager.Instance.Camera)
@ -1185,7 +1190,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
if (grabPoint.IsLineGrab && !useGrabPoint && grabPoint.LineInitialCanReposition)
{
return grabbable.transform.TransformPoint(GetLocalLineGrabPoint(grabbable, transform.TransformPoint(GetLineGrabHandAnchor(PosableGrabPoint))));
return grabbable.transform.TransformPoint(GetLocalLineGrabPoint(grabbable, transform.TransformPoint(GetLineGrabHandAnchor(grabPoint)), grabPoint));
}
if (grabPoint.GrabIndicatorPosition)
@ -1243,6 +1248,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
ResetAnimator();
}
}
private void EnableGrabIndicator()
{
if (_grabIndicatorEnabled) return;
@ -1324,6 +1330,10 @@ namespace HurricaneVR.Framework.Core.Grabbers
private void TrackVelocities()
{
_playerVel = Vector3.zero;
if (PlayerController)
_playerVel = (PlayerController.position - _lastPlayerPos) / Time.deltaTime;
var deltaRotation = transform.rotation * Quaternion.Inverse(_previousRotation);
deltaRotation.ToAngleAxis(out var angle, out var axis);
angle *= Mathf.Deg2Rad;
@ -1331,6 +1341,9 @@ namespace HurricaneVR.Framework.Core.Grabbers
RecentVelocities.Enqueue(Rigidbody.velocity);
RecentAngularVelocities.Enqueue(angularVelocity);
if (PlayerController)
_lastPlayerPos = PlayerController.position;
}
protected virtual void CheckSocketUnhover()
@ -1352,7 +1365,12 @@ namespace HurricaneVR.Framework.Core.Grabbers
protected virtual bool CanGrabFromSocket(HVRSocket socket)
{
if (!socket)
if (!socket || !socket.GrabbedTarget)
{
return false;
}
if (!socket.GrabbedTarget.CanHandGrab(this))
{
return false;
}
@ -1362,7 +1380,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
return false;
}
return socket.GrabDetectionType == HVRGrabDetection.Socket && socket.GrabbedTarget;
return socket.GrabDetectionType == HVRGrabDetection.Socket;
}
protected virtual void CheckSocketHover()
@ -1520,7 +1538,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
else if (_distanceComplete && !_posJoint)
{
_posJoint = grabbable.gameObject.AddComponent<ConfigurableJoint>();
_posJoint = grabbable.Rigidbody.gameObject.AddComponent<ConfigurableJoint>();
_posJoint.LockLinearMotion();
_posJoint.connectedBody = Rigidbody;
_posJoint.autoConfigureConnectedAnchor = false;
@ -1529,13 +1547,14 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
_posJoint.anchor = BaseLineGrabAnchor + _lineOffset;
}
_posJoint.connectedAnchor = HandAnchorLocal;
PullJoint.SetLinearDrive(0f, 0f, 0f);
}
else if (angleComplete && !_rotJoint)
{
grabbable.transform.rotation = deltaRot * grabbable.transform.rotation;
_rotJoint = grabbable.gameObject.AddComponent<ConfigurableJoint>();
_rotJoint = grabbable.Rigidbody.gameObject.AddComponent<ConfigurableJoint>();
_rotJoint.LockAllAngularMotion();
_rotJoint.connectedBody = Rigidbody;
_rotJoint.autoConfigureConnectedAnchor = false;
@ -1544,6 +1563,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
_posJoint.anchor = BaseLineGrabAnchor + _lineOffset;
}
_rotJoint.connectedAnchor = HandAnchorLocal;
PullJoint.SetSlerpDrive(0f, 0f, 0f);
}
@ -1579,13 +1599,14 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
Debug.Log($"{name} break distance reached on {GrabbedTarget.name}.");
}
BreakDistanceReached.Invoke(this, GrabbedTarget);
ForceRelease();
}
protected virtual bool CheckBreakDistanceReached(HVRGrabbable grabbable)
{
if(grabbable.BreakDistanceSource == BreakDistanceSource.Hand)
if (grabbable.BreakDistanceSource == BreakDistanceSource.Hand)
return Vector3.Distance(GrabAnchorWorld, JointAnchorWorldPosition) > grabbable.BreakDistance;
if (grabbable.BreakDistanceSource == BreakDistanceSource.Controller)
return Vector3.Distance(GrabAnchorWorld, TrackedController.position) > grabbable.BreakDistance;
@ -1651,7 +1672,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
ParentHandModel(GrabPoint);
}
SetAnimatorPose(poser, parent);
if (CloneHandModel && _collisionAnimator) _collisionAnimator.SetHeldPoser(poser);
if (HandAnimator) HandAnimator.SetHeldPoser(poser);
}
private void ParentHandModel(Transform parent)
@ -1672,9 +1694,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
HandModel.parent = parent;
if (InverseKinematics && PosableGrabPoint)
if (PosableGrabPoint)
{
//posable hand not on the IK target, need to set pos / rot manually
var pose = PosableGrabPoint.HandPoser.PrimaryPose.Pose.GetPose(HandSide);
HandModel.localRotation = pose.Rotation;
HandModel.localPosition = pose.Position;
@ -1682,14 +1703,20 @@ namespace HurricaneVR.Framework.Core.Grabbers
_hasPosed = true;
var listener = parent.gameObject.AddComponent<HVRDestroyListener>();
var listener = parent.gameObject.EnsureComponent<HVRDestroyListener>();
listener.Destroyed.AddListener(OnGrabPointDestroyed);
}
public void SetAnimatorPose(HVRHandPoser poser, bool poseHand = false, bool poseHandClone = false)
public void SetAnimatorPose(HVRHandPoser poser)
{
if (CloneHandModel && _collisionAnimator) _collisionAnimator.SetCurrentPoser(poser, poseHandClone);
if (HandAnimator) HandAnimator.SetCurrentPoser(poser, poseHand);
if (CloneHandModel && _collisionAnimator) _collisionAnimator.SetCurrentPoser(poser);
if (HandAnimator) HandAnimator.SetCurrentPoser(poser);
}
public void SetAnimatorOverridePose(HVRHandPoser poser)
{
if (CloneHandModel && _collisionAnimator) _collisionAnimator.SetOverridePoser(poser);
if (HandAnimator) HandAnimator.SetOverridePoser(poser);
}
public void ResetAnimator()
@ -1718,11 +1745,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
}
public void OverrideHandSettings(HVRJointSettings settings)
{
StrengthHandler.OverrideHandSettings(settings);
}
public override bool CanHover(HVRGrabbable grabbable)
{
if (IsForceGrabbing || (IsGripGrabActive && (!HoverTarget || HoverTarget != grabbable)))
@ -1731,13 +1753,16 @@ namespace HurricaneVR.Framework.Core.Grabbers
return CanGrab(grabbable);
}
private bool IsForceGrabbing => _hasForceGrabber && (ForceGrabber.IsForceGrabbing || ForceGrabber.IsAiming);
private bool IsForceGrabbing => ForceGrabber && (ForceGrabber.IsForceGrabbing || ForceGrabber.IsAiming);
public override bool CanGrab(HVRGrabbable grabbable)
{
if (!base.CanGrab(grabbable))
return false;
if (!grabbable.CanHandGrab(this))
return false;
if ((!AllowMultiplayerSwap && !grabbable.AllowMultiplayerSwap) && grabbable.HoldType != HVRHoldType.ManyHands && grabbable.AnyGrabberNotMine())
{
return false;
@ -1752,7 +1777,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
return false;
}
if (GrabbedTarget != null && GrabbedTarget != grabbable)
if (GrabbedTarget && GrabbedTarget != grabbable)
return false;
if (grabbable.IsSocketed && grabbable.Socket.GrabDetectionType == HVRGrabDetection.Socket)
@ -1808,9 +1833,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
if (_socketGrab)
{
}
else
{
@ -1933,9 +1955,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
}
var isStatic = grabbable.Stationary ||
(grabbable.IsJointGrab && (!grabbable.Rigidbody || (grabbable.RemainsKinematic && grabbable.Rigidbody.isKinematic)));
var isStatic = grabbable.Stationary || (grabbable.IsJointGrab && (!grabbable.Rigidbody || grabbable.Rigidbody.isKinematic));
var linkedHeld = grabbable.MasterGrabbable && grabbable.MasterGrabbable.IsHandGrabbed || grabbable.AnyLinkedHandHeld();
@ -1956,7 +1976,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
public static bool IsV1Closest(Vector3 v, Vector3 v1, Vector3 v2)
{
var vNorm = v.normalized;
@ -1993,7 +2012,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
var mid = grabbable.transform.InverseTransformPoint(PosableGrabPoint.WorldLineMiddle);
var point = IsInitialLineGrab ? transform.TransformPoint(GetLineGrabHandAnchor(PosableGrabPoint)) : GrabPoint.position;
_lineOffset = GetLocalLineGrabPoint(grabbable, point) - mid;
_lineOffset = GetLocalLineGrabPoint(grabbable, point, PosableGrabPoint) - mid;
if (PosableGrabPoint.CanLineFlip)
{
@ -2016,10 +2035,10 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
private Vector3 GetLocalLineGrabPoint(HVRGrabbable grabbable, Vector3 point)
private Vector3 GetLocalLineGrabPoint(HVRGrabbable grabbable, Vector3 point, HVRPosableGrabPoint grabPoint)
{
var start = grabbable.transform.InverseTransformPoint(PosableGrabPoint.LineStart.position);
var end = grabbable.transform.InverseTransformPoint(PosableGrabPoint.LineEnd.position);
var start = grabbable.transform.InverseTransformPoint(grabPoint.LineStart.position);
var end = grabbable.transform.InverseTransformPoint(grabPoint.LineEnd.position);
var testPoint = grabbable.transform.InverseTransformPoint(point);
return HVRUtilities.FindNearestPointOnLine(start, end, testPoint);
}
@ -2038,12 +2057,13 @@ namespace HurricaneVR.Framework.Core.Grabbers
for (var i = 0; i < grabbable.Colliders.Count; i++)
{
var gc = grabbable.Colliders[i];
if (!gc.enabled || !gc.gameObject.activeInHierarchy || gc.isTrigger)
if (!gc || !gc.enabled || !gc.gameObject.activeInHierarchy || gc.isTrigger)
continue;
var anchor = Palm.transform.position;
Vector3 point;
if (grabbable.HasConcaveColliders && gc is MeshCollider meshCollider && !meshCollider.convex)
if (grabbable.HasConcaveColliders && gc is MeshCollider meshCollider && !meshCollider.convex ||
grabbable.HasWheelCollider && gc is WheelCollider wheelCollider)
{
if (!gc.Raycast(new Ray(anchor, Palm.transform.forward), out var hit, .3f))
{
@ -2085,7 +2105,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
return false;
}
return GrabbedTarget.PoseType == PoseType.PhysicPoser || ((GrabPoint == null || GrabPoint == GrabbedTarget.transform) && GrabbedTarget.PhysicsPoserFallback);
return GrabbedTarget.PoseType == PoseType.PhysicPoser || ((!GrabPoint || GrabPoint == GrabbedTarget.transform) && GrabbedTarget.PhysicsPoserFallback);
}
private IEnumerator MoveGrab()
@ -2177,7 +2197,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
SetupGrab(grabbable);
IsClimbing = grabbable.GetComponent<HVRClimbable>();
if (grabbable.HandGrabbedClip)
if (SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(grabbable.HandGrabbedClip, transform.position);
if (SFXPlayer.Instance)
SFXPlayer.Instance.PlaySFX(grabbable.HandGrabbedClip, transform.position);
}
public void SetupGrab(HVRGrabbable grabbable)
@ -2195,8 +2216,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
//determine if a pull to hand joint should be enabled, or should the final strong joint be enabled
final = grabbable.PoseType == PoseType.Offset || grabbable.Stationary ||
(grabbable.RemainsKinematic && grabbable.Rigidbody.isKinematic)
|| _moveGrab || _forceFullyGrabbed
grabbable.Rigidbody.isKinematic ||
_moveGrab || _forceFullyGrabbed
|| _socketGrab && HoveredSocket.InstantHandPose;
_moveGrab = false;
}
@ -2209,12 +2230,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
StartPull();
}
if (grabbable.Rigidbody && (!grabbable.Rigidbody.isKinematic || !grabbable.RemainsKinematic))
{
grabbable.Rigidbody.isKinematic = false;
grabbable.Rigidbody.collisionDetectionMode = grabbable.CollisionDetection;
}
}
if (GrabPoint)
@ -2335,18 +2350,12 @@ namespace HurricaneVR.Framework.Core.Grabbers
public Quaternion JointRotation
{
get
{
return Quaternion.Inverse(GrabbedTarget.transform.rotation) * CachedWorldRotation * Quaternion.Inverse(PoseLocalRotation);
get { return Quaternion.Inverse(GrabbedTarget.transform.rotation) * CachedWorldRotation * Quaternion.Inverse(PoseLocalRotation); }
}
}
private void SetupConfigurableJoint(HVRGrabbable grabbable)
{
var axis = Vector3.right;
var secondaryAxis = Vector3.up;
@ -2453,7 +2462,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
}
UpdateGrabbableCOM(grabbable);
OnHandAttached();
BreakDistanceCooldown(2f);
_finalJointCreated = true;
@ -2478,25 +2486,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
}
internal void UpdateGrabbableCOM(HVRGrabbable grabbable)
{
if (grabbable.Rigidbody && grabbable.PalmCenterOfMass)
{
//Debug.Log($"updating grabbable com { grabbable.HandGrabbers.Count}");
if (grabbable.HandGrabbers.Count == 1)
{
var p1 = grabbable.HandGrabbers[0].JointAnchorWorldPosition;
grabbable.Rigidbody.centerOfMass = grabbable.transform.InverseTransformPoint(p1);
}
else if (grabbable.HandGrabbers.Count == 2)
{
var p1 = grabbable.HandGrabbers[0].JointAnchorWorldPosition;
var p2 = grabbable.HandGrabbers[1].JointAnchorWorldPosition;
grabbable.Rigidbody.centerOfMass = grabbable.transform.InverseTransformPoint((p1 + p2) / 2);
}
}
}
private void UpdateLineGrab()
{
if (!IsLineGrab || PullingGrabbable || !_finalJointCreated || !Joint)
@ -2533,10 +2522,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
var mid = GrabbedTarget.transform.InverseTransformPoint(PosableGrabPoint.WorldLineMiddle);
_lineOffset = GetLocalLineGrabPoint(GrabbedTarget, transform.TransformPoint(HandAnchorLocal)) - mid;
_lineOffset = GetLocalLineGrabPoint(GrabbedTarget, transform.TransformPoint(HandAnchorLocal), PosableGrabPoint) - mid;
Joint.anchor = BaseLineGrabAnchor + _lineOffset;
UpdateGrabbableCOM(GrabbedTarget);
}
else if (_tightlyHeld && loosen)
{
@ -2561,7 +2548,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
xDrive.positionDamper = PosableGrabPoint.LooseDamper;
xDrive.maximumForce = 100000f;
Joint.xDrive = xDrive;
}
if (PosableGrabPoint.LineCanRotate || PosableGrabPoint.LineFreeRotation)
@ -2575,15 +2561,16 @@ namespace HurricaneVR.Framework.Core.Grabbers
xDrive.maximumForce = 100000f;
Joint.angularXDrive = xDrive;
}
}
// ReSharper disable Unity.PerformanceAnalysis
protected override void OnReleased(HVRGrabbable grabbable)
{
if (HVRSettings.Instance.VerboseHandGrabberEvents)
{
Debug.Log($"{name}:OnReleased");
}
base.OnReleased(grabbable);
if (ControllerOffset)
@ -2597,6 +2584,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
StartPushing();
}
_checkingEnableCollision = false;
_primaryGrabPointGrab = false;
_socketGrab = false;
@ -2606,7 +2594,17 @@ namespace HurricaneVR.Framework.Core.Grabbers
IsLineGrab = false;
TriggerGrabPoint = null;
ResetHandModel();
if (HandModel && HandModel.parent && HandModel.parent.TryGetComponent(out HVRDestroyListener listener))
{
listener.Destroyed.RemoveListener(OnGrabPointDestroyed);
}
_hasPosed = false;
ResetHandTransform(HandModel);
ResetHandTransform(_collisionTransform);
HandAnimator.OnHeldObjectReleased();
if (_collisionAnimator) _collisionAnimator.OnHeldObjectReleased();
IsPhysicsPose = false;
_physicsPose = null;
@ -2623,13 +2621,17 @@ namespace HurricaneVR.Framework.Core.Grabbers
if (grabbable.Rigidbody && !grabbable.Rigidbody.isKinematic)
{
var throwVelocity = ComputeThrowVelocity(grabbable, out var angularVelocity, true);
var throwVelocity = ComputeThrowVelocity(grabbable, out var angularVelocity);
if(!throwVelocity.IsInvalid())
grabbable.Rigidbody.velocity = throwVelocity;
if(!throwVelocity.IsInvalid())
grabbable.Rigidbody.angularVelocity = angularVelocity;
//prevent clipping on throw
if (timeout < .2f && grabbable.Rigidbody.velocity.magnitude > 2f) timeout = .2f;
}
if (!IgnoreNextCollisionCheck)
{
if (grabbable.Rigidbody && !grabbable.Rigidbody.isKinematic && (grabbable.RequireOverlapClearance || timeout > 0f))
{
var routine = StartCoroutine(CheckReleasedOverlap(grabbable, timeout));
@ -2639,10 +2641,13 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
EnableHandCollision(grabbable);
}
}
grabbable.HeldGrabPoints.Remove(GrabPoint);
}
IgnoreNextCollisionCheck = false;
GrabToggleActive = false;
GrabPoint = null;
Released.Invoke(this, grabbable);
@ -2678,14 +2683,15 @@ namespace HurricaneVR.Framework.Core.Grabbers
internal static Vector3 GetAverageVelocity(int frames, int start, CircularBuffer<Vector3> recentVelocities, bool takePeak = false, int nPeak = 3)
{
if (frames == 0)
return Vector3.zero;
var sum = Vector3.zero;
for (var i = start; i < start + frames; i++)
{
sum += recentVelocities[i];
}
if (Mathf.Approximately(frames, 0f))
return Vector3.zero;
var average = sum / frames;
@ -2695,7 +2701,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
for (var i = start; i < start + frames; i++)
{
//removing any vectors not going in the direction of the average vector
var dot = Vector3.Dot(average.normalized, recentVelocities[i].normalized);
if (dot < .2)
@ -2736,8 +2741,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
public Vector3 ComputeThrowVelocity(HVRGrabbable grabbable, out Vector3 angularVelocity, bool isThrowing = false)
public Vector3 ComputeThrowVelocity(HVRGrabbable grabbable, out Vector3 angularVelocity, bool playerRelative = false)
{
if (!grabbable.Rigidbody)
{
@ -2749,8 +2753,16 @@ namespace HurricaneVR.Framework.Core.Grabbers
var grabbableAngular = grabbable.GetAverageAngularVelocity(ThrowLookback, ThrowLookbackStart);
var handVelocity = GetAverageVelocity(ThrowLookback, ThrowLookbackStart);
if (playerRelative)
{
handVelocity -= _playerVel;
grabbableVelocity -= _playerVel;
}
var handAngularVelocity = GetAverageAngularVelocity(ThrowLookback, ThrowLookbackStart);
//var throwVelocity = handVelocity * (ReleasedVelocityFactor * grabbable.ReleasedVelocityFactor);
var throwVelocity = ReleasedVelocityFactor * handVelocity + grabbableVelocity * grabbable.ReleasedVelocityFactor;
//Debug.Log($"{handAngularVelocity.magnitude}");
@ -2758,7 +2770,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
if (handAngularVelocity.magnitude > ReleasedAngularThreshold)
{
//compute linear velocity from wrist rotation
var grabbableCom = GrabPoint != null ? GrabPoint.position : grabbable.Rigidbody.worldCenterOfMass;
var grabbableCom = GrabPoint ? GrabPoint.position : grabbable.Rigidbody.worldCenterOfMass;
Vector3 centerOfMass;
if (ThrowingCenterOfMass && ThrowingCenterOfMass.CenterOfMass)
@ -2770,12 +2782,14 @@ namespace HurricaneVR.Framework.Core.Grabbers
centerOfMass = Rigidbody.worldCenterOfMass;
}
var cross = Vector3.Cross(handAngularVelocity, grabbableCom - centerOfMass) * grabbable.ReleasedAngularConversionFactor * ReleasedAngularConversionFactor;
var cross = Vector3.Cross(handAngularVelocity, grabbableCom - centerOfMass) * (grabbable.ReleasedAngularConversionFactor * ReleasedAngularConversionFactor);
throwVelocity += cross;
}
angularVelocity = grabbableAngular * grabbable.ReleasedAngularFactor;
return throwVelocity;
}
@ -2934,9 +2948,9 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
}
public bool TryAutoGrab(HVRGrabbable grabbable, HVRPosableGrabPoint grabPoint)
public bool TryTransferDistanceGrab(HVRGrabbable grabbable, HVRPosableGrabPoint grabPoint)
{
if (GrabTrigger == HVRGrabTrigger.Active && !Inputs.GetHoldActive(HandSide))
if (GrabTrigger == HVRGrabTrigger.Active && !Inputs.GetForceGrabActive(HandSide))
{
return false;
}
@ -2956,7 +2970,24 @@ namespace HurricaneVR.Framework.Core.Grabbers
//if (grabPoint) OrientGrabbable(grabbable, grabPoint, true, false);
if (TryGrab(grabbable))
{
_currentGrabControl = grabbable.GrabControl;
if (Inputs.ForceGrabActivation == HVRForceGrabActivation.Grip)
{
_currentGrabControl = HVRGrabControls.GripOnly;
}
else if (Inputs.ForceGrabActivation == HVRForceGrabActivation.Trigger)
{
_currentGrabControl = HVRGrabControls.TriggerOnly;
}
else
{
if (IsGripGrabActive)
_currentGrabControl = HVRGrabControls.GripOnly;
else
_currentGrabControl = HVRGrabControls.TriggerOnly;
}
CheckGrabControlSwap();
return true;
}
}
@ -2964,6 +2995,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
_isForceAutoGrab = false;
}
return false;
}
@ -2975,36 +3007,18 @@ namespace HurricaneVR.Framework.Core.Grabbers
if (!HandModel)
return;
if (HandModel.parent)
{
var listener = HandModel.parent.GetComponent<HVRDestroyListener>();
if (listener)
{
listener.Destroyed.RemoveListener(OnGrabPointDestroyed);
Destroy(listener);
}
}
ResetHand(HandModel, HandAnimator);
ResetHandTransform(HandModel);
if (HandAnimator) HandAnimator.ResetToDefault();
if (_collisionTransform)
{
ResetHand(_collisionTransform, _collisionAnimator);
}
}
private void ResetHand(Transform hand, HVRHandAnimator animator)
{
ResetHandTransform(hand);
if (animator)
{
animator.ResetToDefault();
ResetHandTransform(_collisionTransform);
if (_collisionAnimator) _collisionAnimator.ResetToDefault();
}
}
private void ResetHandTransform(Transform hand)
{
if (!hand) return;
hand.parent = HandModelParent;
hand.localPosition = HandModelPosition;
hand.localRotation = HandModelRotation;
@ -3036,6 +3050,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
_collisionHand.Pose(HVRHandPoseData.FromByteArray(data, HandSide), GrabbedTarget.ParentHandModel);
}
_posableHand.Pose(HVRHandPoseData.FromByteArray(data, HandSide), GrabbedTarget.ParentHandModel);
}
@ -3048,7 +3063,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
protected virtual IEnumerator SwapGrabPoint(HVRPosableGrabPoint grabPoint, float time, HVRAxis axis)
{
var grabbable = GrabbedTarget;
@ -3136,7 +3150,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
/// <summary>
/// Will grab the provided object using the provided grab point, if the grab point isn't provided then the first valid one on the object will be used.
/// If there are no grab points that are allowed to be grabbed by this hand you shouldn't use this method.
@ -3186,8 +3199,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
public void OrientGrabbable(HVRGrabbable grabbable, HVRPosableGrabPoint grabPoint, bool position = true, bool rotation = true)
{
var deltaRot = CachedWorldRotation * Quaternion.Inverse(grabPoint.GetPoseWorldRotation(HandSide));
if (rotation) grabbable.transform.rotation = deltaRot * grabbable.transform.rotation;
if (position) grabbable.transform.position += (HandModel.position - grabPoint.GetPoseWorldPosition(HandSide));
if (rotation) grabbable.MainTransform.rotation = deltaRot * grabbable.MainTransform.rotation;
if (position) grabbable.MainTransform.position += (HandModel.position - grabPoint.GetPoseWorldPosition(HandSide));
}
public override void ForceRelease()
@ -3197,7 +3210,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
#if UNITY_EDITOR
private void OnDrawGizmos()
{
@ -3244,6 +3256,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
public enum DynamicPoseGrabIndicator
{
Transform, Palm, None
Transform,
Palm,
None
}
}

View File

@ -15,7 +15,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
public class HVRSocket : HVRGrabberBase
{
[Header("Grab Settings")]
public HVRGrabControls GrabControl = HVRGrabControls.GripOrTrigger;
@ -77,6 +76,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
[Tooltip("Fallback grabbed sfx to play if the socketable doesn't have one.")]
public AudioClip AudioGrabbedFallback;
[Tooltip("Fallback released sfx to play if the socketable doesn't have one.")]
public AudioClip AudioReleasedFallback;
@ -92,6 +92,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
[Tooltip("If supplied the hand will use this point when sorting distance to the closest socket instead of the socket position")]
public Transform DistanceSource;
[Tooltip("Used by the socketable to decide which saved pose to use.")]
public string PoseTag;
[Tooltip("If false, the socketed object colliders remain active, only works for static or kinematic rb sockets.")]
public bool DisableCollision = true;
@ -105,16 +107,23 @@ namespace HurricaneVR.Framework.Core.Grabbers
protected Transform _previousParent;
protected Vector3 _previousScale;
protected Bounds _modelBounds;
protected bool _appQuitting;
protected HVRGrabbable _timeoutGrabbable;
protected float _mass;
private RigidbodyInterpolation _rbInterpolation;
private float _rbDrag;
private float _rbAngularDrag;
private float _rbMass;
private bool _rbGravity;
private bool _rbKinematic;
private float _socketMass;
protected bool _hadRigidBody;
protected bool _ignoreGrabSFX;
protected Coroutine _fixPositionRoutine;
public HVRGrabbable LinkedGrabbable { get; internal set; }
/// <summary>
/// If assigned only this grabbable can enter this socket.
/// </summary>
public HVRGrabbable LinkedGrabbable { get; set; }
public override bool IsGrabActivated => !IsGrabbing;
public override bool IsHoldActive => IsGrabbing;
@ -125,6 +134,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
public override bool IsSocket => true;
public int? PoseHash { get; set; }
public bool CanAddGrabbable
{
get
@ -151,6 +162,9 @@ namespace HurricaneVR.Framework.Core.Grabbers
Debug.LogWarning($"Sockets with a non kinematic rigidbody should not disable DisableCollision");
}
if (!string.IsNullOrWhiteSpace(PoseTag))
PoseHash = Animator.StringToHash(PoseTag);
//if (!Rigidbody && HoldType == SocketHoldType.RemoveRigidbody)
//{
// HoldType = SocketHoldType.Kinematic;
@ -166,6 +180,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
SetupParentDisablesGrab();
if (SocketFilters == null || SocketFilters.Length == 0)
SocketFilters = GetComponents<HVRSocketFilter>();
if (HoverActions == null || HoverActions.Length == 0)
HoverActions = GetComponents<HVRSocketHoverAction>();
@ -201,7 +216,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
var cloneGrabbable = clone.GetComponent<HVRGrabbable>();
if (cloneGrabbable)
{
var t = TryGrab(cloneGrabbable, true, true);
TryGrab(cloneGrabbable, true, true);
SpawnedPrefab.Invoke(this, clone);
}
else
@ -270,7 +285,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
if (GrabbableMustBeHeld && grabbable.GrabberCount != 1)
return false;
var handGrabber = grabbable.PrimaryGrabber as HVRHandGrabber;
if (handGrabber == null)
if (!handGrabber)
return false;
if (_timeoutGrabbable && _timeoutGrabbable == grabbable)
return false;
@ -282,6 +297,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
return false;
}
}
return base.CanHover(grabbable);
}
@ -309,7 +325,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
grabbable.Released.AddListener(OnHoverGrabbableReleased);
base.OnHoverEnter(grabbable);
if (HoverActions != null)
{
@ -359,7 +374,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
if (CanAddGrabbable && TryGrab(grabbable))
{
}
}
@ -429,6 +443,11 @@ namespace HurricaneVR.Framework.Core.Grabbers
public virtual bool IsValid(HVRGrabbable grabbable)
{
if (LinkedGrabbable)
{
return LinkedGrabbable == grabbable;
}
if (grabbable.IsStabbing && !CanGrabStabbingGrabbable || grabbable.IsStabbed || !grabbable.Socketable)
return false;
@ -476,30 +495,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
_previousParent = grabbable.transform.parent;
_previousScale = grabbable.transform.localScale;
if (grabbable.Socketable && grabbable.Socketable.ScaleOverride)
{
var scaleBox = grabbable.Socketable.ScaleOverride;
var temp = scaleBox.enabled;
if (!scaleBox.enabled)
{
scaleBox.enabled = true;
}
_modelBounds = scaleBox.bounds;
if (!temp)
{
scaleBox.enabled = false;
}
}
else
{
_modelBounds = grabbable.ModelBounds;
}
grabbable.transform.parent = transform;
AttachGrabbable(grabbable);
OnGrabbableParented(grabbable);
HandleRigidBodyGrab(grabbable);
PlaySocketedSFX(grabbable.Socketable);
@ -510,24 +507,24 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
}
protected virtual Vector3 GetPositionOffset(HVRGrabbable grabbable)
protected virtual void AttachGrabbable(HVRGrabbable grabbable)
{
if (!grabbable || !grabbable.Socketable || !grabbable.Socketable.SocketOrientation)
grabbable.transform.parent = transform;
}
/// <summary>
/// Returns the socketed local position
/// </summary>
public virtual Vector3 GetTargetPosition(HVRGrabbable grabbable)
{
var socketable = grabbable.Socketable;
if (!grabbable || !socketable)
return Vector3.zero;
return grabbable.Socketable.SocketOrientation.localPosition;
}
protected virtual Quaternion GetRotationOffset(HVRGrabbable grabbable)
if (socketable.SocketOrientation)
{
if (!grabbable || !grabbable.Socketable || !grabbable.Socketable.SocketOrientation)
return Quaternion.identity;
return grabbable.Socketable.SocketOrientation.localRotation;
}
protected virtual Vector3 GetTargetPosition(HVRGrabbable grabbable)
{
var offSet = -GetPositionOffset(grabbable);
var delta = Quaternion.Inverse(GetRotationOffset(grabbable));
var offSet = -socketable.SocketOrientation.localPosition;
var delta = Quaternion.Inverse(socketable.SocketOrientation.localRotation);
offSet = delta * offSet;
offSet.x *= grabbable.transform.localScale.x;
@ -537,17 +534,24 @@ namespace HurricaneVR.Framework.Core.Grabbers
return offSet;
}
protected virtual Quaternion GetTargetRotation(HVRGrabbable grabbable)
return socketable.GetPositionOffset(this);
}
/// <summary>
/// Returns the socketed local rotation;
/// </summary>
public virtual Quaternion GetTargetRotation(HVRGrabbable grabbable)
{
var socketable = grabbable.Socketable;
if (!socketable)
return Quaternion.identity;
if (socketable.SocketOrientation)
{
var rotationOffset = GetRotationOffset(grabbable);
return Quaternion.Inverse(rotationOffset);
return Quaternion.Inverse(socketable.SocketOrientation.localRotation);
}
return Quaternion.identity;
return socketable.GetRotationOffset(this);
}
protected virtual void OnGrabbableParented(HVRGrabbable grabbable)
@ -572,13 +576,14 @@ namespace HurricaneVR.Framework.Core.Grabbers
if (!grabbable.Rigidbody)
return;
_rbKinematic = grabbable.Rigidbody.isKinematic;
_rbInterpolation = grabbable.Rigidbody.interpolation;
switch (HoldType)
{
case SocketHoldType.Kinematic:
{
grabbable.Rigidbody.useGravity = false;
grabbable.Rigidbody.velocity = Vector3.zero;
grabbable.Rigidbody.angularVelocity = Vector3.zero;
grabbable.Rigidbody.collisionDetectionMode = CollisionDetectionMode.ContinuousSpeculative;
@ -590,11 +595,15 @@ namespace HurricaneVR.Framework.Core.Grabbers
case SocketHoldType.RemoveRigidbody:
{
_hadRigidBody = true;
_rbMass = grabbable.Rigidbody.mass;
_rbGravity = grabbable.Rigidbody.useGravity;
_rbDrag = grabbable.Rigidbody.drag;
_rbAngularDrag = grabbable.Rigidbody.angularDrag;
if (Rigidbody)
{
_mass = Rigidbody.mass;
Rigidbody.mass += grabbable.Rigidbody.mass;
_socketMass = Rigidbody.mass;
Rigidbody.mass += _rbMass;
}
Destroy(grabbable.Rigidbody);
@ -602,25 +611,36 @@ namespace HurricaneVR.Framework.Core.Grabbers
{
StopCoroutine(_fixPositionRoutine);
}
_fixPositionRoutine = StartCoroutine(SetPositionNextFrame(grabbable));
}
break;
}
}
protected virtual void CleanupRigidBody(HVRGrabbable grabbable)
{
var rb = grabbable.Rigidbody;
if (HoldType == SocketHoldType.RemoveRigidbody && _hadRigidBody)
{
grabbable.Rigidbody = grabbable.gameObject.AddComponent<Rigidbody>();
rb = grabbable.Rigidbody = grabbable.gameObject.AddComponent<Rigidbody>();
if (Rigidbody)
{
Rigidbody.mass = _mass;
}
Rigidbody.mass = _socketMass;
}
grabbable.ResetRigidBody();
rb.useGravity = _rbGravity;
rb.mass = _rbMass;
rb.drag = _rbDrag;
rb.angularDrag = _rbAngularDrag;
}
if (rb)
{
rb.collisionDetectionMode = grabbable.OriginalCollisionMode;
rb.isKinematic = _rbKinematic;
rb.interpolation = _rbInterpolation;
}
}
private IEnumerator SetPositionNextFrame(HVRGrabbable grabbable)
@ -677,21 +697,27 @@ namespace HurricaneVR.Framework.Core.Grabbers
if (SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(clip, transform.position);
}
protected virtual float GetSocketableScaleSize(HVRSocketable socketable)
{
return socketable.GetSocketScaleSize(this);
}
protected virtual void UpdateScale(HVRGrabbable grabbable)
{
if (!grabbable || !ScaleGrabbable)
return;
var extents = _modelBounds.extents;
var axis = extents.x;
if (extents.y > axis) axis = extents.y;
if (extents.z > axis) axis = extents.z;
axis *= 2;
var finalScale = ComputeScale(grabbable.Socketable);
grabbable.transform.localScale = finalScale;
}
public virtual Vector3 ComputeScale(HVRSocketable socketable)
{
var axis = GetSocketableScaleSize(socketable);
var ratio = Size / axis;
ratio *= grabbable.Socketable.SocketScale;
var counterScale = grabbable.Socketable.CounterScale;
grabbable.transform.localScale = new Vector3(ratio * counterScale.x, ratio * counterScale.y, ratio * counterScale.z);
ratio *= socketable.SocketScale;
var counterScale = socketable.CounterScale;
return new Vector3(ratio * counterScale.x, ratio * counterScale.y, ratio * counterScale.z);
}
protected override void OnReleased(HVRGrabbable grabbable)
@ -744,8 +770,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
}
protected virtual IEnumerator GrabTimeoutRoutine(HVRGrabbable grabbable)
{
_timeoutGrabbable = grabbable;
@ -790,7 +814,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
[Serializable]
public class SocketSpawnEvent : UnityEvent<HVRSocket, GameObject>
{
}
public enum SocketCondition

View File

@ -6,6 +6,10 @@ using UnityEngine;
namespace HurricaneVR.Framework.Core.Grabbers
{
/// <summary>
/// Grabber that uses a HVRSocketContainer as a target of the grab. Main uses are over the shoulder or chest collection type inventories
/// </summary>
public class HVRSocketContainerGrabber : HVRGrabberBase
{
public HVRSocketContainer SocketContainer;

View File

@ -0,0 +1,31 @@
using System;
using HurricaneVR.Framework.Core.Grabbers;
/// <summary>
/// Filters the incoming grabbing hand by left or right hand only
/// </summary>
public class HVRGrabHandFilter : HVRHandGrabFilter
{
public HandOptions AllowedHands;
public override bool CanBeGrabbed(HVRHandGrabber hand)
{
if (AllowedHands == HandOptions.Both)
return true;
if (AllowedHands == HandOptions.Left && hand.IsLeftHand)
return true;
if (AllowedHands == HandOptions.Right && hand.IsRightHand)
return true;
return false;
}
//[Flags]
public enum HandOptions
{
Left = 0, Right = 1, Both = 2
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9cf9028b057d4b7db0423f5d0a26074b
timeCreated: 1674090737

Some files were not shown because too many files have changed in this diff Show More