NEW HVR 2.9.1f
This commit is contained in:
parent
f0bf64ed45
commit
91acc4d728
|
|
@ -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
|
2.8.4
|
||||||
|
|
||||||
Fixed an issue with the version update check logic that was refreshing the asset database after compiles.
|
Fixed an issue with the version update check logic that was refreshing the asset database after compiles.
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e2d14f6a173045b08af8717e276df756
|
||||||
|
timeCreated: 1666239275
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d3003c99effe439d9d06c4e9334443ba
|
||||||
|
timeCreated: 1666146629
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 63f79aabdd614d20a214af69939cd772
|
||||||
|
timeCreated: 1666142031
|
||||||
|
|
@ -43,6 +43,10 @@ namespace HurricaneVR.Editor
|
||||||
value = EditorGUILayout.ObjectField(label, value, typeof(HVRJointSettings), false) as HVRJointSettings;
|
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)
|
public static void Header(string label)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace HurricaneVR.Editor
|
||||||
public class HVREditorManager
|
public class HVREditorManager
|
||||||
{
|
{
|
||||||
private const string HurricaneVRUploader = "HurricaneVRUploader";
|
private const string HurricaneVRUploader = "HurricaneVRUploader";
|
||||||
public const string Version = "2.8.4";
|
public const string Version = "2.9.1f";
|
||||||
|
|
||||||
[InitializeOnLoadMethod]
|
[InitializeOnLoadMethod]
|
||||||
private static void Hook()
|
private static void Hook()
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,14 @@ using HurricaneVR.Framework.Core.HandPoser;
|
||||||
using HurricaneVR.Framework.Core.ScriptableObjects;
|
using HurricaneVR.Framework.Core.ScriptableObjects;
|
||||||
using HurricaneVR.Framework.Core.Utils;
|
using HurricaneVR.Framework.Core.Utils;
|
||||||
using HurricaneVR.Framework.Shared;
|
using HurricaneVR.Framework.Shared;
|
||||||
|
using HurricaneVR.Framework.Shared.Utilities;
|
||||||
using HurricaneVR.Framework.Weapons;
|
using HurricaneVR.Framework.Weapons;
|
||||||
using HurricaneVR.Framework.Weapons.Guns;
|
using HurricaneVR.Framework.Weapons.Guns;
|
||||||
using HurricaneVR.Framework.Weapons.Guns.PartFinders;
|
using HurricaneVR.Framework.Weapons.Guns.PartFinders;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using HVRPistol = HurricaneVR.Framework.Weapons.Guns.HVRPistol;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
using Zero;
|
|
||||||
|
|
||||||
namespace HurricaneVR.Editor
|
namespace HurricaneVR.Editor
|
||||||
{
|
{
|
||||||
|
|
@ -26,8 +27,8 @@ namespace HurricaneVR.Editor
|
||||||
|
|
||||||
//private const string TwoHandPistol = "HandSettings/HVR_Pistol_TwoHand";
|
//private const string TwoHandPistol = "HandSettings/HVR_Pistol_TwoHand";
|
||||||
//private const string TwoHandLarge = "HandSettings/HVR_LargeWeapon_TwoHanded";
|
//private const string TwoHandLarge = "HandSettings/HVR_LargeWeapon_TwoHanded";
|
||||||
private const string TwoHandLargeStabilizer = "HandSettings/HVR_Stabilizer_TwoHanded";
|
private const string TwoHandLargeStabilizer = "HandSettings/HVR_Stabilizer_TwoHanded_Strength";
|
||||||
private const string TwoHandPistolStabilizer = "HandSettings/HVR_Pistol_Stabilizer_TwoHanded";
|
private const string TwoHandPistolStabilizer = "HandSettings/HVR_Pistol_Stabilizer_TwoHanded_Strength";
|
||||||
|
|
||||||
//private const string OneHandPistol = "HandSettings/HVR_Pistol_OneHand";
|
//private const string OneHandPistol = "HandSettings/HVR_Pistol_OneHand";
|
||||||
//private const string OneHandDefault = "HandSettings/HVR_DefaultHandSettings";
|
//private const string OneHandDefault = "HandSettings/HVR_DefaultHandSettings";
|
||||||
|
|
@ -48,7 +49,7 @@ namespace HurricaneVR.Editor
|
||||||
private float _gunMass = 1.5f;
|
private float _gunMass = 1.5f;
|
||||||
private float _bulletSpeed = 80f;
|
private float _bulletSpeed = 80f;
|
||||||
private int _rpm = 900;
|
private int _rpm = 900;
|
||||||
private FireType _firingType;
|
private GunFireType _firingType;
|
||||||
|
|
||||||
private HVRHandPose _gripPose;
|
private HVRHandPose _gripPose;
|
||||||
private HVRHandPose _stabilizerPose;
|
private HVRHandPose _stabilizerPose;
|
||||||
|
|
@ -67,9 +68,9 @@ namespace HurricaneVR.Editor
|
||||||
private bool _stabilizerRequiresGripGrabbed = true;
|
private bool _stabilizerRequiresGripGrabbed = true;
|
||||||
private bool _stabilizerDropsOnGripReleased = true;
|
private bool _stabilizerDropsOnGripReleased = true;
|
||||||
private float _cycleTime = .05f;
|
private float _cycleTime = .05f;
|
||||||
private HVRJointSettings _gripOneHand;
|
private PDStrength _gripOneHand;
|
||||||
private HVRJointSettings _gripTwoHand;
|
private PDStrength _gripTwoHand;
|
||||||
private HVRJointSettings _stabilizerTwoHand;
|
private PDStrength _stabilizerTwoHand;
|
||||||
private bool _ejectedBulletPooled = true;
|
private bool _ejectedBulletPooled = true;
|
||||||
private HVRRecoilSettings _recoilSettings;
|
private HVRRecoilSettings _recoilSettings;
|
||||||
private Vector2 _scrollPosition;
|
private Vector2 _scrollPosition;
|
||||||
|
|
@ -127,7 +128,7 @@ namespace HurricaneVR.Editor
|
||||||
|
|
||||||
HVREditorExtensions.IntField("Rounds Per Minute", ref _rpm);
|
HVREditorExtensions.IntField("Rounds Per Minute", ref _rpm);
|
||||||
HVREditorExtensions.FloatField("Bullet Speed", ref _bulletSpeed);
|
HVREditorExtensions.FloatField("Bullet Speed", ref _bulletSpeed);
|
||||||
_firingType = (FireType)EditorGUILayout.EnumPopup("Firing Mode", _firingType);
|
_firingType = (GunFireType)EditorGUILayout.EnumPopup("Firing Mode", _firingType);
|
||||||
var currentType = _gunType;
|
var currentType = _gunType;
|
||||||
_gunType = (HVRGunType)EditorGUILayout.EnumPopup("Type", _gunType);
|
_gunType = (HVRGunType)EditorGUILayout.EnumPopup("Type", _gunType);
|
||||||
_hitLayerMask = LayerMaskDrawer.LayerMaskField("Hit Layer Mask", _hitLayerMask);
|
_hitLayerMask = LayerMaskDrawer.LayerMaskField("Hit Layer Mask", _hitLayerMask);
|
||||||
|
|
@ -179,9 +180,9 @@ namespace HurricaneVR.Editor
|
||||||
// PopulateDefaultHandSettings();
|
// PopulateDefaultHandSettings();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
HVREditorExtensions.JointField("Grip One Handed", ref _gripOneHand);
|
HVREditorExtensions.StrengthField("Grip One Handed", ref _gripOneHand);
|
||||||
HVREditorExtensions.JointField("Grip Two Handed", ref _gripTwoHand);
|
HVREditorExtensions.StrengthField("Grip Two Handed", ref _gripTwoHand);
|
||||||
HVREditorExtensions.JointField("Stabilizer Two Handed", ref _stabilizerTwoHand);
|
HVREditorExtensions.StrengthField("Stabilizer Two Handed", ref _stabilizerTwoHand);
|
||||||
|
|
||||||
GUILayout.Space(20f);
|
GUILayout.Space(20f);
|
||||||
HVREditorExtensions.Header("SFX");
|
HVREditorExtensions.Header("SFX");
|
||||||
|
|
@ -377,8 +378,8 @@ namespace HurricaneVR.Editor
|
||||||
Undo.RegisterCreatedObjectUndo(root, _gunPrefab.name);
|
Undo.RegisterCreatedObjectUndo(root, _gunPrefab.name);
|
||||||
|
|
||||||
gunGrabbable = AddGrabbable(root, out var poser, out var gp);
|
gunGrabbable = AddGrabbable(root, out var poser, out var gp);
|
||||||
gunGrabbable.OneHandJointSettings = _gripOneHand;
|
gunGrabbable.OneHandStrength = _gripOneHand;
|
||||||
gunGrabbable.TwoHandJointSettings = _gripTwoHand;
|
gunGrabbable.TwoHandStrength = _gripTwoHand;
|
||||||
poser.PrimaryPose.Pose = _gripPose;
|
poser.PrimaryPose.Pose = _gripPose;
|
||||||
gunGrabbable.HoldType = HVRHoldType.Swap;
|
gunGrabbable.HoldType = HVRHoldType.Swap;
|
||||||
gunGrabbable.RequireOverlapClearance = true;
|
gunGrabbable.RequireOverlapClearance = true;
|
||||||
|
|
@ -398,19 +399,19 @@ namespace HurricaneVR.Editor
|
||||||
|
|
||||||
private GameObject CreatePistol()
|
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;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GameObject CreateAutomatic()
|
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;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GameObject CreatePumpShotgun()
|
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>();
|
var mag = root.AddComponent<HVRShotgunMagazine>();
|
||||||
gun.ChambersAfterFiring = false;
|
gun.ChambersAfterFiring = false;
|
||||||
mag.MaxCount = 5;
|
mag.MaxCount = 5;
|
||||||
|
|
@ -454,9 +455,8 @@ namespace HurricaneVR.Editor
|
||||||
//grabbable.TrackingType = HVRGrabTracking.None;
|
//grabbable.TrackingType = HVRGrabTracking.None;
|
||||||
grabbable.HoldType = HVRHoldType.OneHand;
|
grabbable.HoldType = HVRHoldType.OneHand;
|
||||||
grabbable.DisableHandCollision = true;
|
grabbable.DisableHandCollision = true;
|
||||||
grabbable.PoseImmediately = true;
|
|
||||||
grabbable.ForceGrabbable = false;
|
grabbable.ForceGrabbable = false;
|
||||||
grabbable.TwoHandJointSettings = _stabilizerTwoHand;
|
grabbable.TwoHandStrength = _stabilizerTwoHand;
|
||||||
grabbable.ExtraIgnoreCollisionParents = new List<Transform>() { gunGrabbable.Rigidbody.transform };
|
grabbable.ExtraIgnoreCollisionParents = new List<Transform>() { gunGrabbable.Rigidbody.transform };
|
||||||
|
|
||||||
if (_stabilizerRequiresGripGrabbed)
|
if (_stabilizerRequiresGripGrabbed)
|
||||||
|
|
@ -500,6 +500,10 @@ namespace HurricaneVR.Editor
|
||||||
gun.RecoilComponent = gun.gameObject.AddComponent<HVRRecoil>();
|
gun.RecoilComponent = gun.gameObject.AddComponent<HVRRecoil>();
|
||||||
gun.RecoilComponent.Settings = _recoilSettings;
|
gun.RecoilComponent.Settings = _recoilSettings;
|
||||||
gun.GunSounds = gun.gameObject.AddComponent<HVRGunSounds>();
|
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;
|
gun.Bolt = bolt;
|
||||||
|
|
||||||
var adjustTransforms = AddAdjustTransform(gun.gameObject);
|
var adjustTransforms = AddAdjustTransform(gun.gameObject);
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,12 @@ using UnityEngine;
|
||||||
using UnityEngine.UIElements;
|
using UnityEngine.UIElements;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
|
#if UNITY_2021_2_OR_NEWER
|
||||||
|
using UnityEditor.SceneManagement;
|
||||||
|
#else
|
||||||
|
using UnityEditor.Experimental.SceneManagement;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace HurricaneVR.Editor
|
namespace HurricaneVR.Editor
|
||||||
{
|
{
|
||||||
[CustomEditor(typeof(HVRHandPoser))]
|
[CustomEditor(typeof(HVRHandPoser))]
|
||||||
|
|
@ -108,10 +114,7 @@ namespace HurricaneVR.Editor
|
||||||
|
|
||||||
private HVRHandPoseBlend PrimaryPose
|
private HVRHandPoseBlend PrimaryPose
|
||||||
{
|
{
|
||||||
get
|
get { return Poser.PrimaryPose; }
|
||||||
{
|
|
||||||
return Poser.PrimaryPose;
|
|
||||||
}
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Poser.PrimaryPose = value;
|
Poser.PrimaryPose = value;
|
||||||
|
|
@ -121,10 +124,7 @@ namespace HurricaneVR.Editor
|
||||||
|
|
||||||
public HVRHandPose SelectedPose
|
public HVRHandPose SelectedPose
|
||||||
{
|
{
|
||||||
get
|
get { return SelectedBlendPose?.Pose; }
|
||||||
{
|
|
||||||
return SelectedBlendPose?.Pose;
|
|
||||||
}
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (SelectedBlendPose == null) return;
|
if (SelectedBlendPose == null) return;
|
||||||
|
|
@ -184,7 +184,6 @@ namespace HurricaneVR.Editor
|
||||||
{
|
{
|
||||||
SceneView.duringSceneGui -= OnSceneGUI2;
|
SceneView.duringSceneGui -= OnSceneGUI2;
|
||||||
SceneView.duringSceneGui += OnSceneGUI2;
|
SceneView.duringSceneGui += OnSceneGUI2;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -225,7 +224,6 @@ namespace HurricaneVR.Editor
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var c in cleanup) _map.Remove(c);
|
foreach (var c in cleanup) _map.Remove(c);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetHands(ref HVRPosableHand leftHand, ref HVRPosableHand rightHand)
|
private void GetHands(ref HVRPosableHand leftHand, ref HVRPosableHand rightHand)
|
||||||
|
|
@ -414,6 +412,7 @@ namespace HurricaneVR.Editor
|
||||||
{
|
{
|
||||||
selectedFinger = i;
|
selectedFinger = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedBone = bone.Transform;
|
selectedBone = bone.Transform;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -425,6 +424,9 @@ namespace HurricaneVR.Editor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _inPrefabMode;
|
||||||
|
private bool _active;
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
Poser = target as HVRHandPoser;
|
Poser = target as HVRHandPoser;
|
||||||
|
|
@ -452,13 +454,30 @@ namespace HurricaneVR.Editor
|
||||||
|
|
||||||
_root = new VisualElement();
|
_root = new VisualElement();
|
||||||
_tree = UnityEngine.Resources.Load<VisualTreeAsset>("HVRHandPoserEditor");
|
_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()
|
private void CreatePoseIfNeeded()
|
||||||
{
|
{
|
||||||
if (PrimaryPose.Pose == null && HVRSettings.Instance.OpenHandPose)
|
if (PrimaryPose.Pose == null && HVRSettings.Instance.OpenHandPose)
|
||||||
{
|
{
|
||||||
|
|
||||||
_root.schedule.Execute(() =>
|
_root.schedule.Execute(() =>
|
||||||
{
|
{
|
||||||
PrimaryPose.SetDefaults();
|
PrimaryPose.SetDefaults();
|
||||||
|
|
@ -473,7 +492,6 @@ namespace HurricaneVR.Editor
|
||||||
|
|
||||||
public override VisualElement CreateInspectorGUI()
|
public override VisualElement CreateInspectorGUI()
|
||||||
{
|
{
|
||||||
|
|
||||||
_root.Clear();
|
_root.Clear();
|
||||||
_tree.CloneTree(_root);
|
_tree.CloneTree(_root);
|
||||||
|
|
||||||
|
|
@ -495,99 +513,111 @@ namespace HurricaneVR.Editor
|
||||||
SetupHandButtons();
|
SetupHandButtons();
|
||||||
SetupAutoPoseButtons();
|
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");
|
if (_inPrefabMode)
|
||||||
_selectionIndexField.bindingPath = "SelectionIndex";
|
|
||||||
_selectionIndexField.RegisterValueChangedCallback(evt =>
|
|
||||||
{
|
{
|
||||||
if (PosesListView.selectedIndex != evt.newValue) PosesListView.selectedIndex = evt.newValue;
|
_root.Q("MirrorAxis").style.display = DisplayStyle.None;
|
||||||
});
|
_root.Q("boxPreview").style.display = DisplayStyle.None;
|
||||||
_root.Add(_selectionIndexField);
|
|
||||||
|
|
||||||
PreviewLeftToggle = _root.Q<Toggle>("PreviewLeft");
|
|
||||||
PreviewLeftToggle.BindProperty(SP_PreviewLeft);
|
|
||||||
PreviewRightToggle = _root.Q<Toggle>("PreviewRight");
|
|
||||||
PreviewRightToggle.BindProperty(SP_PreviewRight);
|
|
||||||
|
|
||||||
PreviewLeftToggle.RegisterValueChangedCallback(OnPreviewLeftChanged);
|
|
||||||
PreviewRightToggle.RegisterValueChangedCallback(OnPreviewRightChanged);
|
|
||||||
|
|
||||||
ToggleLeftAutoPose = _root.Q<Toggle>("LeftAutoPose");
|
|
||||||
ToggleLeftAutoPose.BindProperty(SP_LeftAutoPose);
|
|
||||||
ToggleRightAutoPose = _root.Q<Toggle>("RightAutoPose");
|
|
||||||
ToggleRightAutoPose.BindProperty(SP_RightAutoPose);
|
|
||||||
|
|
||||||
ToggleLeftAutoPose.RegisterValueChangedCallback(OnLeftAutoPoseChanged);
|
|
||||||
ToggleRightAutoPose.RegisterValueChangedCallback(OnRightAutoPoseChanged);
|
|
||||||
|
|
||||||
if (SelectedIndex >= PosesListView.itemsSource.Count + PrimaryIndex)
|
|
||||||
{
|
|
||||||
Debug.Log($"Stored SelectedIndex is higher than pose count.");
|
|
||||||
SelectedIndex = PosesListView.itemsSource.Count - PrimaryIndex - 1;
|
|
||||||
serializedObject.ApplyModifiedProperties();
|
|
||||||
}
|
|
||||||
|
|
||||||
PosesListView.selectedIndex = SelectedIndex;
|
|
||||||
|
|
||||||
|
|
||||||
GetPhysicsPosers();
|
|
||||||
|
|
||||||
if (FullBody)
|
|
||||||
{
|
|
||||||
var body = GameObject.Find(_bodyId);
|
|
||||||
if (body)
|
|
||||||
{
|
|
||||||
SP_BodyPreview.objectReferenceValue = body;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateBodyPreview(SelectedPose != null ? SelectedPose.LeftHand : null, SelectedPose != null ? SelectedPose.RightHand : null, PreviewLeft, PreviewRight);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SP_PreviewLeft.boolValue = SP_LeftHandPreview.objectReferenceValue != null;
|
_root.Q("warning").style.display = DisplayStyle.None;
|
||||||
SP_PreviewRight.boolValue = SP_RightHandPreview.objectReferenceValue != null;
|
|
||||||
|
|
||||||
if (!SP_PreviewLeft.boolValue)
|
PreviewLeftToggle = _root.Q<Toggle>("PreviewLeft");
|
||||||
|
PreviewLeftToggle.BindProperty(SP_PreviewLeft);
|
||||||
|
PreviewRightToggle = _root.Q<Toggle>("PreviewRight");
|
||||||
|
PreviewRightToggle.BindProperty(SP_PreviewRight);
|
||||||
|
|
||||||
|
PreviewLeftToggle.RegisterValueChangedCallback(OnPreviewLeftChanged);
|
||||||
|
PreviewRightToggle.RegisterValueChangedCallback(OnPreviewRightChanged);
|
||||||
|
|
||||||
|
ToggleLeftAutoPose = _root.Q<Toggle>("LeftAutoPose");
|
||||||
|
|
||||||
|
ToggleLeftAutoPose.BindProperty(SP_LeftAutoPose);
|
||||||
|
ToggleRightAutoPose = _root.Q<Toggle>("RightAutoPose");
|
||||||
|
ToggleRightAutoPose.BindProperty(SP_RightAutoPose);
|
||||||
|
|
||||||
|
ToggleLeftAutoPose.RegisterValueChangedCallback(OnLeftAutoPoseChanged);
|
||||||
|
ToggleRightAutoPose.RegisterValueChangedCallback(OnRightAutoPoseChanged);
|
||||||
|
|
||||||
|
if (SelectedIndex >= PosesListView.itemsSource.Count + PrimaryIndex)
|
||||||
{
|
{
|
||||||
FindPreviewHand(true, out var left);
|
Debug.Log($"Stored SelectedIndex is higher than pose count.");
|
||||||
if (left)
|
SelectedIndex = PosesListView.itemsSource.Count - PrimaryIndex - 1;
|
||||||
|
serializedObject.ApplyModifiedProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
PosesListView.selectedIndex = SelectedIndex;
|
||||||
|
|
||||||
|
|
||||||
|
GetPhysicsPosers();
|
||||||
|
|
||||||
|
if (FullBody)
|
||||||
|
{
|
||||||
|
var body = GameObject.Find(_bodyId);
|
||||||
|
if (body)
|
||||||
{
|
{
|
||||||
SP_PreviewLeft.boolValue = true;
|
SP_BodyPreview.objectReferenceValue = body;
|
||||||
SP_LeftHandPreview.objectReferenceValue = left;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!SP_PreviewRight.boolValue)
|
UpdateBodyPreview(SelectedPose != null ? SelectedPose.LeftHand : null, SelectedPose != null ? SelectedPose.RightHand : null, PreviewLeft, PreviewRight);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
FindPreviewHand(false, out var right);
|
SP_PreviewLeft.boolValue = SP_LeftHandPreview.objectReferenceValue != null;
|
||||||
if (right)
|
SP_PreviewRight.boolValue = SP_RightHandPreview.objectReferenceValue != null;
|
||||||
|
|
||||||
|
if (!SP_PreviewLeft.boolValue)
|
||||||
{
|
{
|
||||||
SP_PreviewRight.boolValue = true;
|
FindPreviewHand(true, out var left);
|
||||||
SP_RightHandPreview.objectReferenceValue = right;
|
if (left)
|
||||||
|
{
|
||||||
|
SP_PreviewLeft.boolValue = true;
|
||||||
|
SP_LeftHandPreview.objectReferenceValue = left;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!SP_PreviewRight.boolValue)
|
||||||
|
{
|
||||||
|
FindPreviewHand(false, out var right);
|
||||||
|
if (right)
|
||||||
|
{
|
||||||
|
SP_PreviewRight.boolValue = true;
|
||||||
|
SP_RightHandPreview.objectReferenceValue = right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdatePreview(false, SP_PreviewRight.boolValue, SelectedPose != null ? SelectedPose.LeftHand : null);
|
||||||
|
UpdatePreview(true, SP_PreviewLeft.boolValue, SelectedPose != null ? SelectedPose.RightHand : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePreview(false, SP_PreviewRight.boolValue, SelectedPose != null ? SelectedPose.LeftHand : null);
|
if (_leftPhysicsPoser)
|
||||||
UpdatePreview(true, SP_PreviewLeft.boolValue, SelectedPose != null ? SelectedPose.RightHand : null);
|
{
|
||||||
|
SP_LeftAutoPose.boolValue = _leftPhysicsPoser.LiveUpdate;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SP_LeftAutoPose.boolValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_rightPhysicsPoser)
|
||||||
|
{
|
||||||
|
SP_RightAutoPose.boolValue = _rightPhysicsPoser.LiveUpdate;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SP_RightAutoPose.boolValue = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_leftPhysicsPoser)
|
|
||||||
{
|
|
||||||
SP_LeftAutoPose.boolValue = _leftPhysicsPoser.LiveUpdate;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SP_LeftAutoPose.boolValue = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_rightPhysicsPoser)
|
|
||||||
{
|
|
||||||
SP_RightAutoPose.boolValue = _rightPhysicsPoser.LiveUpdate;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SP_RightAutoPose.boolValue = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
serializedObject.ApplyModifiedProperties();
|
serializedObject.ApplyModifiedProperties();
|
||||||
|
|
||||||
|
|
@ -650,6 +680,7 @@ namespace HurricaneVR.Editor
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_rightPhysicsPoser.LiveUpdate = evt.newValue;
|
_rightPhysicsPoser.LiveUpdate = evt.newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -663,6 +694,7 @@ namespace HurricaneVR.Editor
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_leftPhysicsPoser.LiveUpdate = evt.newValue;
|
_leftPhysicsPoser.LiveUpdate = evt.newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -709,12 +741,10 @@ namespace HurricaneVR.Editor
|
||||||
{
|
{
|
||||||
_rightPhysicsPoser.LiveUpdate = SP_RightAutoPose.boolValue;
|
_rightPhysicsPoser.LiveUpdate = SP_RightAutoPose.boolValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPreviewLeftChanged(ChangeEvent<bool> evt)
|
private void OnPreviewLeftChanged(ChangeEvent<bool> evt)
|
||||||
{
|
{
|
||||||
|
|
||||||
CreatePoseIfNeeded();
|
CreatePoseIfNeeded();
|
||||||
|
|
||||||
if (FullBody)
|
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)
|
private void UpdateBodyPreview(HVRHandPoseData leftpose, HVRHandPoseData rightpose, bool previewLeft, bool previewRight, bool poseChanged = false)
|
||||||
{
|
{
|
||||||
if (!previewRight && !previewLeft)
|
if (!previewRight && !previewLeft)
|
||||||
|
|
@ -769,6 +811,7 @@ namespace HurricaneVR.Editor
|
||||||
SetupIKTarget(previewLeft, "LeftIKTarget", out var dummy);
|
SetupIKTarget(previewLeft, "LeftIKTarget", out var dummy);
|
||||||
SetupIKTarget(previewRight, "RightIKTarget", out var dummy2);
|
SetupIKTarget(previewRight, "RightIKTarget", out var dummy2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -863,7 +906,6 @@ namespace HurricaneVR.Editor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SceneView.RepaintAll();
|
SceneView.RepaintAll();
|
||||||
|
|
||||||
serializedObject.ApplyModifiedProperties();
|
serializedObject.ApplyModifiedProperties();
|
||||||
|
|
@ -958,6 +1000,9 @@ namespace HurricaneVR.Editor
|
||||||
|
|
||||||
private void OnSelectedPoseChanged(ChangeEvent<Object> evt)
|
private void OnSelectedPoseChanged(ChangeEvent<Object> evt)
|
||||||
{
|
{
|
||||||
|
if (_inPrefabMode)
|
||||||
|
return;
|
||||||
|
|
||||||
if (evt.newValue != null)
|
if (evt.newValue != null)
|
||||||
{
|
{
|
||||||
var newPose = evt.newValue as HVRHandPose;
|
var newPose = evt.newValue as HVRHandPose;
|
||||||
|
|
@ -1289,7 +1334,6 @@ namespace HurricaneVR.Editor
|
||||||
rightHand.Pose(right);
|
rightHand.Pose(right);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var mirrorLeft = _root.Q<Button>("ButtonMirrorLeft");
|
var mirrorLeft = _root.Q<Button>("ButtonMirrorLeft");
|
||||||
|
|
@ -1328,8 +1372,6 @@ namespace HurricaneVR.Editor
|
||||||
leftHand.Pose(left);
|
leftHand.Pose(left);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1391,10 +1433,7 @@ namespace HurricaneVR.Editor
|
||||||
SelectedPoseField.bindingPath = "Pose";
|
SelectedPoseField.bindingPath = "Pose";
|
||||||
//SelectedPoseField.RegisterValueChangedCallback(OnSelectedPoseChanged);
|
//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..
|
////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(() =>
|
var schedule = container.schedule.Execute(() => { SelectedPoseField.RegisterValueChangedCallback(OnSelectedPoseChanged); });
|
||||||
{
|
|
||||||
SelectedPoseField.RegisterValueChangedCallback(OnSelectedPoseChanged);
|
|
||||||
});
|
|
||||||
schedule.StartingIn(1000);
|
schedule.StartingIn(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1417,7 +1456,6 @@ namespace HurricaneVR.Editor
|
||||||
|
|
||||||
|
|
||||||
#if UNITY_2021_1_OR_NEWER
|
#if UNITY_2021_1_OR_NEWER
|
||||||
|
|
||||||
PosesListView.onSelectionChange += OnPoseSelectionChanged;
|
PosesListView.onSelectionChange += OnPoseSelectionChanged;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
@ -1455,6 +1493,9 @@ namespace HurricaneVR.Editor
|
||||||
|
|
||||||
SelectedIndex = PosesListView.selectedIndex;
|
SelectedIndex = PosesListView.selectedIndex;
|
||||||
|
|
||||||
|
var poseName = SelectedPose == null ? "None" : SelectedPose.name;
|
||||||
|
blendEditorRoot.Q<Label>("lblSelectedPose").text = $"Selected Pose: {poseName}";
|
||||||
|
|
||||||
BindBlendContainer();
|
BindBlendContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1469,7 +1510,6 @@ namespace HurricaneVR.Editor
|
||||||
if (index == PrimaryIndex)
|
if (index == PrimaryIndex)
|
||||||
{
|
{
|
||||||
label.AddToClassList("primarypose");
|
label.AddToClassList("primarypose");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index < Poser.PoseNames.Count)
|
if (index < Poser.PoseNames.Count)
|
||||||
|
|
@ -1509,7 +1549,11 @@ namespace HurricaneVR.Editor
|
||||||
serializedObject.ApplyModifiedProperties();
|
serializedObject.ApplyModifiedProperties();
|
||||||
|
|
||||||
|
|
||||||
|
#if UNITY_2021_2_OR_NEWER
|
||||||
PosesListView?.Rebuild();
|
PosesListView?.Rebuild();
|
||||||
|
#else
|
||||||
|
PosesListView?.Refresh();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -207,8 +207,8 @@ namespace HurricaneVR
|
||||||
Left.localPosition = Vector3.zero;
|
Left.localPosition = Vector3.zero;
|
||||||
Right.localPosition = Vector3.zero;
|
Right.localPosition = Vector3.zero;
|
||||||
|
|
||||||
var leftPrefab = PrefabUtility.SaveAsPrefabAssetAndConnect(Left.gameObject, "Assets/LeftHandPrefab.prefab", InteractionMode.UserAction);
|
var leftPrefab = PrefabUtility.SaveAsPrefabAssetAndConnect(Left.gameObject, $"Assets/{Left.name}.prefab", InteractionMode.UserAction);
|
||||||
var rightPrefab = PrefabUtility.SaveAsPrefabAssetAndConnect(Right.gameObject, "Assets/RightHandPrefab.prefab", InteractionMode.UserAction);
|
var rightPrefab = PrefabUtility.SaveAsPrefabAssetAndConnect(Right.gameObject, $"Assets/{Right.name}.prefab", InteractionMode.UserAction);
|
||||||
|
|
||||||
var so = new SerializedObject(HVRSettings.Instance);
|
var so = new SerializedObject(HVRSettings.Instance);
|
||||||
var left = so.FindProperty("LeftHand");
|
var left = so.FindProperty("LeftHand");
|
||||||
|
|
@ -248,6 +248,35 @@ namespace HurricaneVR
|
||||||
SetupFallback(rightHand);
|
SetupFallback(rightHand);
|
||||||
|
|
||||||
PosesAssigned = true;
|
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"))
|
if (GUILayout.Button("Detect Mirror"))
|
||||||
{
|
{
|
||||||
LeftHand.DetectBoneAxes(RightHand, LeftHand.transform.parent.forward, LeftHand.transform.parent.up);
|
DetectBoneAxes(LeftHand, RightHand, LeftHand.transform.parent.forward, LeftHand.transform.parent.up);
|
||||||
RightHand.DetectBoneAxes(LeftHand, LeftHand.transform.parent.forward, LeftHand.transform.parent.up);
|
DetectBoneAxes(RightHand, LeftHand, LeftHand.transform.parent.forward, LeftHand.transform.parent.up);
|
||||||
|
|
||||||
_badMirrorText = "";
|
_badMirrorText = "";
|
||||||
_badMirror = false;
|
_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)
|
private void ValidateMirrorSettings(HVRPosableHand hand)
|
||||||
{
|
{
|
||||||
for (var i = 0; i < hand.Fingers.Length; i++)
|
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" +
|
" 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\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\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\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. 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);
|
||||||
"\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);
|
|
||||||
|
|
||||||
//int i = 0;
|
//int i = 0;
|
||||||
//bool up = false;
|
//bool up = false;
|
||||||
|
|
@ -532,7 +594,6 @@ namespace HurricaneVR
|
||||||
HVREditorExtensions.EnumField("Finger", ref s.Finger);
|
HVREditorExtensions.EnumField("Finger", ref s.Finger);
|
||||||
HVREditorExtensions.IntField("Bones", ref s.BoneCount);
|
HVREditorExtensions.IntField("Bones", ref s.BoneCount);
|
||||||
HVREditorExtensions.IntField("Root Offset", ref s.BoneOffset);
|
HVREditorExtensions.IntField("Root Offset", ref s.BoneOffset);
|
||||||
HVREditorExtensions.Toggle("Has Tip", ref s.HasTip);
|
|
||||||
|
|
||||||
//if (GUILayout.Button("^"))
|
//if (GUILayout.Button("^"))
|
||||||
//{
|
//{
|
||||||
|
|
@ -673,7 +734,6 @@ namespace HurricaneVR
|
||||||
|
|
||||||
|
|
||||||
animator.DefaultPoseHand = false;
|
animator.DefaultPoseHand = false;
|
||||||
animator.PoseHand = true;
|
|
||||||
animator.PhysicsPoser = physicsPoser;
|
animator.PhysicsPoser = physicsPoser;
|
||||||
animator.Hand = hand;
|
animator.Hand = hand;
|
||||||
animator.DefaultPoser = poser;
|
animator.DefaultPoser = poser;
|
||||||
|
|
@ -725,35 +785,25 @@ namespace HurricaneVR
|
||||||
|
|
||||||
if (finger.Bones.Count > 0)
|
if (finger.Bones.Count > 0)
|
||||||
{
|
{
|
||||||
if (!s.HasTip)
|
var last = finger.Bones.Last();
|
||||||
|
var tipName = s.Finger.ToString() + " Tip";
|
||||||
|
var existing = last.Transform.Find(tipName);
|
||||||
|
|
||||||
|
if (!existing)
|
||||||
{
|
{
|
||||||
var last = finger.Bones.Last();
|
var tip = new GameObject(tipName);
|
||||||
var tipName = s.Finger.ToString() + " Tip";
|
tip.transform.parent = last.Transform;
|
||||||
var existing = last.Transform.Find(tipName);
|
tip.transform.ResetLocalProps();
|
||||||
|
finger.Tip = tip.transform;
|
||||||
|
|
||||||
if (!existing)
|
Undo.RegisterCreatedObjectUndo(tip, $"Add {tipName} to {last.Transform.name}");
|
||||||
{
|
|
||||||
var tip = new GameObject(tipName);
|
|
||||||
tip.transform.parent = last.Transform;
|
|
||||||
tip.transform.ResetLocalProps();
|
|
||||||
finger.Tip = tip.transform;
|
|
||||||
|
|
||||||
Undo.RegisterCreatedObjectUndo(tip, $"Add {tipName} to {last.Transform.name}");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
finger.Tip = existing;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var last = finger.Bones.Last();
|
finger.Tip = existing;
|
||||||
if (s.HasTip && last.Transform.childCount > 0)
|
|
||||||
{
|
|
||||||
finger.Tip = last.Transform.GetChild(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
finger.Root = finger.Bones[0].Transform;
|
finger.Root = finger.Bones[0].Transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -825,7 +875,6 @@ namespace HurricaneVR
|
||||||
public Finger Finger;
|
public Finger Finger;
|
||||||
public int BoneCount = 3;
|
public int BoneCount = 3;
|
||||||
public int BoneOffset = 0;
|
public int BoneOffset = 0;
|
||||||
public bool HasTip = false;
|
|
||||||
public int Index;
|
public int Index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,8 @@ namespace HurricaneVR.Editor
|
||||||
private const string URLHandGrabber = "https://cloudwalker2020.github.io/HurricaneVR-Docs/manual/hands.html";
|
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 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 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 URLDiscord = "https://discord.com/invite/7QUXEcuwKY";
|
||||||
|
|
||||||
private const string DEFINESteamVR = "HVR_STEAMVR";
|
private const string DEFINESteamVR = "HVR_STEAMVR";
|
||||||
|
|
@ -116,6 +117,8 @@ namespace HurricaneVR.Editor
|
||||||
SetupUrl("btnHandGrabber", URLHandGrabber);
|
SetupUrl("btnHandGrabber", URLHandGrabber);
|
||||||
SetupUrl("btnDiscord", URLDiscord);
|
SetupUrl("btnDiscord", URLDiscord);
|
||||||
SetupUrl("btnSetup", URLSetup);
|
SetupUrl("btnSetup", URLSetup);
|
||||||
|
SetupUrl("btnCustomHand", URLCustomHand);
|
||||||
|
SetupUrl("btnDoorSetup", URLDoor);
|
||||||
//SetupUrl("BtnPatreon", URLPatreon);
|
//SetupUrl("BtnPatreon", URLPatreon);
|
||||||
|
|
||||||
UpdatePanel(notesPanel);
|
UpdatePanel(notesPanel);
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 50bc40950ea34e579fb36b46f4d10e85
|
||||||
|
timeCreated: 1661143344
|
||||||
|
|
@ -8,15 +8,20 @@ namespace HurricaneVR.Editor
|
||||||
public class HVRSocketableTagsEditor : UnityEditor.Editor
|
public class HVRSocketableTagsEditor : UnityEditor.Editor
|
||||||
{
|
{
|
||||||
private HVRSocketableTags tags;
|
private HVRSocketableTags tags;
|
||||||
|
private SerializedProperty SPIdentifier;
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
tags = target as HVRSocketableTags;
|
tags = target as HVRSocketableTags;
|
||||||
|
SPIdentifier = serializedObject.FindProperty(nameof(HVRSocketableTags.Identifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnInspectorGUI()
|
public override void OnInspectorGUI()
|
||||||
{
|
{
|
||||||
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
|
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(SPIdentifier);
|
||||||
|
|
||||||
GUILayout.Space(5);
|
GUILayout.Space(5);
|
||||||
|
|
||||||
for (int i = 0; i < 32; i++)
|
for (int i = 0; i < 32; i++)
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "HurricaneVR.Editor",
|
"name": "HurricaneVR.Editor",
|
||||||
"rootNamespace": "",
|
|
||||||
"references": [
|
"references": [
|
||||||
"HurricaneVR.Framework",
|
"HurricaneVR.Framework"
|
||||||
"Zero"
|
|
||||||
],
|
],
|
||||||
"includePlatforms": [
|
"includePlatforms": [
|
||||||
"Editor"
|
"Editor"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements">
|
<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" />
|
<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 class="HandsContainer">
|
||||||
<ui:VisualElement name="CurlContainer" class="unity-box CurlContainer" style="flex-grow: 1;">
|
<ui:VisualElement name="CurlContainer" class="unity-box CurlContainer" style="flex-grow: 1;">
|
||||||
<ui:Label text="Finger Curls:" class="HandLabel" />
|
<ui:Label text="Finger Curls:" class="HandLabel" />
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,11 @@
|
||||||
<ui:ListView name="Poses" style="flex-grow: 5;" />
|
<ui:ListView name="Poses" style="flex-grow: 5;" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
</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" />
|
<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:Instance template="BlendEditorTemplate" />
|
||||||
</ui:Box>
|
</ui:Box>
|
||||||
</ui:UXML>
|
</ui:UXML>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements">
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements">
|
||||||
<ui:VisualElement>
|
<ui:VisualElement>
|
||||||
<Style src="HVRHandPoserEditor.uss" />
|
<Style src="HVRHandPoserEditor.uss" />
|
||||||
|
<ui:VisualElement name="lblAutoPoseWarning">
|
||||||
|
<ui:Label text="Rigidbody detected, if dynamic posing doesn'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 class="HandsContainer">
|
||||||
<ui:VisualElement name="LeftHandContainer" class="unity-box HandContainer">
|
<ui:VisualElement name="LeftHandContainer" class="unity-box HandContainer">
|
||||||
<ui:Label text="Left Hand:" class="HandLabel" />
|
<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="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:Button name="ButtonCloseRight" text="Close" class="HandMirrorButton" style="flex-grow: 1; flex-basis: auto;" />
|
||||||
</ui:VisualElement>
|
</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="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="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;" />
|
<ui:Button name="RightExpand" text="+" class="HandMirrorButton" style="flex-grow: 1; flex-basis: auto;" />
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
<ui:Button text="Grabbable w/ Pose" name="BtnTutBasicGrabbable" class="tutorial-button docs-button" />
|
<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="Sockets" name="btnSockets" class="docs-button" />
|
||||||
<ui:Button text="FinalIK (VRIK)" name="BtnVRIKSetup" 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:Label text="Other" style="padding-top: 12px;" />
|
||||||
<ui:Button text="Discord Server" name="btnDiscord" class="docs-button" />
|
<ui:Button text="Discord Server" name="btnDiscord" class="docs-button" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -12,28 +12,22 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
version: 5
|
version: 1
|
||||||
--- !u!21 &2100000
|
--- !u!21 &2100000
|
||||||
Material:
|
Material:
|
||||||
serializedVersion: 8
|
serializedVersion: 6
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: GrabbableHighlight
|
m_Name: GrabbableHighlight
|
||||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
m_ValidKeywords:
|
m_ShaderKeywords: _EMISSION _GLOSSYREFLECTIONS_OFF
|
||||||
- _EMISSION
|
|
||||||
- _ENVIRONMENTREFLECTIONS_OFF
|
|
||||||
- _SPECULAR_SETUP
|
|
||||||
m_InvalidKeywords:
|
|
||||||
- _GLOSSYREFLECTIONS_OFF
|
|
||||||
m_LightmapFlags: 2
|
m_LightmapFlags: 2
|
||||||
m_EnableInstancingVariants: 0
|
m_EnableInstancingVariants: 0
|
||||||
m_DoubleSidedGI: 0
|
m_DoubleSidedGI: 0
|
||||||
m_CustomRenderQueue: 2000
|
m_CustomRenderQueue: -1
|
||||||
stringTagMap:
|
stringTagMap: {}
|
||||||
RenderType: Opaque
|
|
||||||
disabledShaderPasses: []
|
disabledShaderPasses: []
|
||||||
m_SavedProperties:
|
m_SavedProperties:
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
|
|
@ -82,31 +76,15 @@ Material:
|
||||||
m_Texture: {fileID: 0}
|
m_Texture: {fileID: 0}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
m_Offset: {x: 0, y: 0}
|
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:
|
m_Floats:
|
||||||
- _AlphaClip: 0
|
- _AlphaClip: 0
|
||||||
- _Blend: 0
|
- _Blend: 0
|
||||||
- _BumpScale: 1
|
- _BumpScale: 1
|
||||||
- _ClearCoatMask: 0
|
|
||||||
- _ClearCoatSmoothness: 0
|
|
||||||
- _Cull: 2
|
- _Cull: 2
|
||||||
- _Cutoff: 0.5
|
- _Cutoff: 0.5
|
||||||
- _DetailAlbedoMapScale: 1
|
|
||||||
- _DetailNormalMapScale: 1
|
- _DetailNormalMapScale: 1
|
||||||
- _DstBlend: 0
|
- _DstBlend: 0
|
||||||
- _EnvironmentReflections: 0
|
- _EnvironmentReflections: 1
|
||||||
- _GlossMapScale: 0
|
- _GlossMapScale: 0
|
||||||
- _Glossiness: 0
|
- _Glossiness: 0
|
||||||
- _GlossinessSource: 0
|
- _GlossinessSource: 0
|
||||||
|
|
@ -119,7 +97,7 @@ Material:
|
||||||
- _ReceiveShadows: 1
|
- _ReceiveShadows: 1
|
||||||
- _SampleGI: 0
|
- _SampleGI: 0
|
||||||
- _Shininess: 0
|
- _Shininess: 0
|
||||||
- _Smoothness: 0
|
- _Smoothness: 0.5
|
||||||
- _SmoothnessSource: 0
|
- _SmoothnessSource: 0
|
||||||
- _SmoothnessTextureChannel: 0
|
- _SmoothnessTextureChannel: 0
|
||||||
- _SpecSource: 0
|
- _SpecSource: 0
|
||||||
|
|
@ -127,11 +105,10 @@ Material:
|
||||||
- _SrcBlend: 1
|
- _SrcBlend: 1
|
||||||
- _Surface: 0
|
- _Surface: 0
|
||||||
- _UVSec: 0
|
- _UVSec: 0
|
||||||
- _WorkflowMode: 0
|
- _WorkflowMode: 1
|
||||||
- _ZWrite: 1
|
- _ZWrite: 1
|
||||||
m_Colors:
|
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}
|
- _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}
|
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||||
m_BuildTextureStacks: []
|
|
||||||
|
|
|
||||||
|
|
@ -2,23 +2,19 @@
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
--- !u!21 &2100000
|
--- !u!21 &2100000
|
||||||
Material:
|
Material:
|
||||||
serializedVersion: 8
|
serializedVersion: 6
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: Hand
|
m_Name: Hand
|
||||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
m_ValidKeywords:
|
m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF
|
||||||
- _ENVIRONMENTREFLECTIONS_OFF
|
|
||||||
m_InvalidKeywords:
|
|
||||||
- _GLOSSYREFLECTIONS_OFF
|
|
||||||
m_LightmapFlags: 4
|
m_LightmapFlags: 4
|
||||||
m_EnableInstancingVariants: 0
|
m_EnableInstancingVariants: 0
|
||||||
m_DoubleSidedGI: 0
|
m_DoubleSidedGI: 0
|
||||||
m_CustomRenderQueue: 2000
|
m_CustomRenderQueue: -1
|
||||||
stringTagMap:
|
stringTagMap: {}
|
||||||
RenderType: Opaque
|
|
||||||
disabledShaderPasses: []
|
disabledShaderPasses: []
|
||||||
m_SavedProperties:
|
m_SavedProperties:
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
|
|
@ -67,31 +63,15 @@ Material:
|
||||||
m_Texture: {fileID: 0}
|
m_Texture: {fileID: 0}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
m_Offset: {x: 0, y: 0}
|
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:
|
m_Floats:
|
||||||
- _AlphaClip: 0
|
- _AlphaClip: 0
|
||||||
- _Blend: 0
|
- _Blend: 0
|
||||||
- _BumpScale: 1
|
- _BumpScale: 1
|
||||||
- _ClearCoatMask: 0
|
|
||||||
- _ClearCoatSmoothness: 0
|
|
||||||
- _Cull: 2
|
- _Cull: 2
|
||||||
- _Cutoff: 0.5
|
- _Cutoff: 0.5
|
||||||
- _DetailAlbedoMapScale: 1
|
|
||||||
- _DetailNormalMapScale: 1
|
- _DetailNormalMapScale: 1
|
||||||
- _DstBlend: 0
|
- _DstBlend: 0
|
||||||
- _EnvironmentReflections: 0
|
- _EnvironmentReflections: 1
|
||||||
- _GlossMapScale: 0
|
- _GlossMapScale: 0
|
||||||
- _Glossiness: 0
|
- _Glossiness: 0
|
||||||
- _GlossinessSource: 0
|
- _GlossinessSource: 0
|
||||||
|
|
@ -103,7 +83,7 @@ Material:
|
||||||
- _QueueOffset: 0
|
- _QueueOffset: 0
|
||||||
- _ReceiveShadows: 1
|
- _ReceiveShadows: 1
|
||||||
- _Shininess: 0
|
- _Shininess: 0
|
||||||
- _Smoothness: 0
|
- _Smoothness: 0.5
|
||||||
- _SmoothnessSource: 0
|
- _SmoothnessSource: 0
|
||||||
- _SmoothnessTextureChannel: 0
|
- _SmoothnessTextureChannel: 0
|
||||||
- _SpecSource: 0
|
- _SpecSource: 0
|
||||||
|
|
@ -114,11 +94,10 @@ Material:
|
||||||
- _WorkflowMode: 1
|
- _WorkflowMode: 1
|
||||||
- _ZWrite: 1
|
- _ZWrite: 1
|
||||||
m_Colors:
|
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}
|
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||||
m_BuildTextureStacks: []
|
|
||||||
--- !u!114 &4878254909249241604
|
--- !u!114 &4878254909249241604
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 11
|
m_ObjectHideFlags: 11
|
||||||
|
|
@ -131,4 +110,4 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
version: 5
|
version: 1
|
||||||
|
|
|
||||||
|
|
@ -1,43 +1,23 @@
|
||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%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
|
--- !u!21 &2100000
|
||||||
Material:
|
Material:
|
||||||
serializedVersion: 8
|
serializedVersion: 6
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_PrefabParentObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInternal: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: OculusTouchForQuestAndRiftS_Material
|
m_Name: OculusTouchForQuestAndRiftS_Material
|
||||||
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
|
m_Shader: {fileID: 10703, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
m_ValidKeywords: []
|
m_ShaderKeywords:
|
||||||
m_InvalidKeywords: []
|
|
||||||
m_LightmapFlags: 4
|
m_LightmapFlags: 4
|
||||||
m_EnableInstancingVariants: 0
|
m_EnableInstancingVariants: 0
|
||||||
m_DoubleSidedGI: 0
|
m_DoubleSidedGI: 0
|
||||||
m_CustomRenderQueue: 2000
|
m_CustomRenderQueue: -1
|
||||||
stringTagMap:
|
stringTagMap: {}
|
||||||
RenderType: Opaque
|
|
||||||
disabledShaderPasses: []
|
disabledShaderPasses: []
|
||||||
m_SavedProperties:
|
m_SavedProperties:
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_TexEnvs:
|
m_TexEnvs:
|
||||||
- _BaseMap:
|
|
||||||
m_Texture: {fileID: 2800000, guid: a53d1d4e8207acf45b310f189c342b70, type: 3}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _BumpMap:
|
- _BumpMap:
|
||||||
m_Texture: {fileID: 0}
|
m_Texture: {fileID: 0}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
|
|
@ -74,54 +54,23 @@ Material:
|
||||||
m_Texture: {fileID: 0}
|
m_Texture: {fileID: 0}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
m_Offset: {x: 0, y: 0}
|
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:
|
m_Floats:
|
||||||
- _AlphaClip: 0
|
|
||||||
- _Blend: 0
|
|
||||||
- _BumpScale: 1
|
- _BumpScale: 1
|
||||||
- _Cull: 2
|
|
||||||
- _Cutoff: 0.5
|
- _Cutoff: 0.5
|
||||||
- _DetailNormalMapScale: 1
|
- _DetailNormalMapScale: 1
|
||||||
- _DstBlend: 0
|
- _DstBlend: 0
|
||||||
- _GlossMapScale: 1
|
- _GlossMapScale: 1
|
||||||
- _Glossiness: 0.5
|
- _Glossiness: 0.5
|
||||||
- _GlossinessSource: 0
|
|
||||||
- _GlossyReflections: 1
|
- _GlossyReflections: 1
|
||||||
- _Metallic: 0
|
- _Metallic: 0
|
||||||
- _Mode: 0
|
- _Mode: 0
|
||||||
- _OcclusionStrength: 1
|
- _OcclusionStrength: 1
|
||||||
- _Parallax: 0.02
|
- _Parallax: 0.02
|
||||||
- _QueueOffset: 0
|
|
||||||
- _ReceiveShadows: 1
|
|
||||||
- _Shininess: 0
|
|
||||||
- _Smoothness: 0.5
|
|
||||||
- _SmoothnessSource: 0
|
|
||||||
- _SmoothnessTextureChannel: 0
|
- _SmoothnessTextureChannel: 0
|
||||||
- _SpecSource: 0
|
|
||||||
- _SpecularHighlights: 1
|
- _SpecularHighlights: 1
|
||||||
- _SrcBlend: 1
|
- _SrcBlend: 1
|
||||||
- _Surface: 0
|
|
||||||
- _UVSec: 0
|
- _UVSec: 0
|
||||||
- _ZWrite: 1
|
- _ZWrite: 1
|
||||||
m_Colors:
|
m_Colors:
|
||||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
- _Color: {r: 0.21960786, g: 0.21960786, b: 0.21960786, a: 1}
|
||||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
|
||||||
- _EmissionColor: {r: 0, g: 0, b: 0, 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: []
|
|
||||||
|
|
|
||||||
|
|
@ -2,29 +2,23 @@
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
--- !u!21 &2100000
|
--- !u!21 &2100000
|
||||||
Material:
|
Material:
|
||||||
serializedVersion: 8
|
serializedVersion: 6
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: TeleportMarker
|
m_Name: TeleportMarker
|
||||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
m_ValidKeywords: []
|
m_ShaderKeywords:
|
||||||
m_InvalidKeywords: []
|
|
||||||
m_LightmapFlags: 4
|
m_LightmapFlags: 4
|
||||||
m_EnableInstancingVariants: 0
|
m_EnableInstancingVariants: 0
|
||||||
m_DoubleSidedGI: 0
|
m_DoubleSidedGI: 0
|
||||||
m_CustomRenderQueue: 2000
|
m_CustomRenderQueue: -1
|
||||||
stringTagMap:
|
stringTagMap: {}
|
||||||
RenderType: Opaque
|
|
||||||
disabledShaderPasses: []
|
disabledShaderPasses: []
|
||||||
m_SavedProperties:
|
m_SavedProperties:
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_TexEnvs:
|
m_TexEnvs:
|
||||||
- _BaseMap:
|
|
||||||
m_Texture: {fileID: 0}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _BumpMap:
|
- _BumpMap:
|
||||||
m_Texture: {fileID: 0}
|
m_Texture: {fileID: 0}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
|
|
@ -61,35 +55,11 @@ Material:
|
||||||
m_Texture: {fileID: 0}
|
m_Texture: {fileID: 0}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
m_Offset: {x: 0, y: 0}
|
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:
|
m_Floats:
|
||||||
- _AlphaClip: 0
|
|
||||||
- _Blend: 0
|
|
||||||
- _BumpScale: 1
|
- _BumpScale: 1
|
||||||
- _ClearCoatMask: 0
|
|
||||||
- _ClearCoatSmoothness: 0
|
|
||||||
- _Cull: 2
|
|
||||||
- _Cutoff: 0.5
|
- _Cutoff: 0.5
|
||||||
- _DetailAlbedoMapScale: 1
|
|
||||||
- _DetailNormalMapScale: 1
|
- _DetailNormalMapScale: 1
|
||||||
- _DstBlend: 0
|
- _DstBlend: 0
|
||||||
- _EnvironmentReflections: 1
|
|
||||||
- _GlossMapScale: 1
|
- _GlossMapScale: 1
|
||||||
- _Glossiness: 0.5
|
- _Glossiness: 0.5
|
||||||
- _GlossyReflections: 1
|
- _GlossyReflections: 1
|
||||||
|
|
@ -97,32 +67,11 @@ Material:
|
||||||
- _Mode: 0
|
- _Mode: 0
|
||||||
- _OcclusionStrength: 1
|
- _OcclusionStrength: 1
|
||||||
- _Parallax: 0.02
|
- _Parallax: 0.02
|
||||||
- _QueueOffset: 0
|
|
||||||
- _ReceiveShadows: 1
|
|
||||||
- _Smoothness: 0.5
|
|
||||||
- _SmoothnessTextureChannel: 0
|
- _SmoothnessTextureChannel: 0
|
||||||
- _SpecularHighlights: 1
|
- _SpecularHighlights: 1
|
||||||
- _SrcBlend: 1
|
- _SrcBlend: 1
|
||||||
- _Surface: 0
|
|
||||||
- _UVSec: 0
|
- _UVSec: 0
|
||||||
- _WorkflowMode: 1
|
|
||||||
- _ZWrite: 1
|
- _ZWrite: 1
|
||||||
m_Colors:
|
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}
|
- _Color: {r: 0.006109435, g: 0.8308824, b: 0.7284968, a: 0.5}
|
||||||
- _EmissionColor: {r: 0, g: 0, b: 0, 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 &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
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ RectTransform:
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1846097449786136922}
|
- {fileID: 1846097449786136922}
|
||||||
m_Father: {fileID: 1846097449257274088}
|
m_Father: {fileID: 1846097449257274088}
|
||||||
|
|
@ -63,7 +62,6 @@ MonoBehaviour:
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_Color: {r: 0, g: 0, b: 0, a: 0.9098039}
|
m_Color: {r: 0, g: 0, b: 0, a: 0.9098039}
|
||||||
m_RaycastTarget: 1
|
m_RaycastTarget: 1
|
||||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
m_Maskable: 1
|
m_Maskable: 1
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
|
|
@ -103,7 +101,6 @@ MonoBehaviour:
|
||||||
m_ChildControlHeight: 1
|
m_ChildControlHeight: 1
|
||||||
m_ChildScaleWidth: 0
|
m_ChildScaleWidth: 0
|
||||||
m_ChildScaleHeight: 0
|
m_ChildScaleHeight: 0
|
||||||
m_ReverseArrangement: 0
|
|
||||||
--- !u!1 &1846097449257274101
|
--- !u!1 &1846097449257274101
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -134,7 +131,6 @@ RectTransform:
|
||||||
m_LocalRotation: {x: 0, y: 0.01306337, z: 0, w: 0.9999147}
|
m_LocalRotation: {x: 0, y: 0.01306337, z: 0, w: 0.9999147}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 0.0050000004, y: 0.005, z: 0.0050000004}
|
m_LocalScale: {x: 0.0050000004, y: 0.005, z: 0.0050000004}
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1846097448371537327}
|
- {fileID: 1846097448371537327}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
|
|
@ -188,7 +184,6 @@ MonoBehaviour:
|
||||||
m_FallbackScreenDPI: 96
|
m_FallbackScreenDPI: 96
|
||||||
m_DefaultSpriteDPI: 96
|
m_DefaultSpriteDPI: 96
|
||||||
m_DynamicPixelsPerUnit: 20
|
m_DynamicPixelsPerUnit: 20
|
||||||
m_PresetInfoIsWorld: 1
|
|
||||||
--- !u!222 &1846097449257274091
|
--- !u!222 &1846097449257274091
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -238,7 +233,6 @@ RectTransform:
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0.069}
|
m_LocalPosition: {x: 0, y: 0, z: 0.069}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1846097448371537327}
|
m_Father: {fileID: 1846097448371537327}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
|
|
@ -271,7 +265,6 @@ MonoBehaviour:
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_Color: {r: 1, g: 0.9990312, b: 0, a: 1}
|
m_Color: {r: 1, g: 0.9990312, b: 0, a: 1}
|
||||||
m_RaycastTarget: 1
|
m_RaycastTarget: 1
|
||||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
m_Maskable: 1
|
m_Maskable: 1
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
|
|
|
||||||
|
|
@ -1,87 +1,5 @@
|
||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%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
|
--- !u!114 &6585287645860019873
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -94,9 +12,8 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 1ebbffaca5ed8a340ae381fb8a5695d8, type: 3}
|
m_Script: {fileID: 11500000, guid: 1ebbffaca5ed8a340ae381fb8a5695d8, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
PoseHand: 1
|
PosePosAndRot: 1
|
||||||
DefaultPoseHand: 1
|
FingerCurlSpeed: 16
|
||||||
DynamicPoseSpeed: 16
|
|
||||||
PhysicsPoser: {fileID: 0}
|
PhysicsPoser: {fileID: 0}
|
||||||
Hand: {fileID: 5620398756903288108}
|
Hand: {fileID: 5620398756903288108}
|
||||||
DefaultPoser: {fileID: 7795976131308540296}
|
DefaultPoser: {fileID: 7795976131308540296}
|
||||||
|
|
@ -118,8 +35,6 @@ MonoBehaviour:
|
||||||
BodyPreview: {fileID: 0}
|
BodyPreview: {fileID: 0}
|
||||||
PreviewLeft: 0
|
PreviewLeft: 0
|
||||||
PreviewRight: 0
|
PreviewRight: 0
|
||||||
LeftAutoPose: 0
|
|
||||||
RightAutoPose: 0
|
|
||||||
SelectionIndex: 0
|
SelectionIndex: 0
|
||||||
PoseNames:
|
PoseNames:
|
||||||
- 'Primary: OculusCustomHandOpen'
|
- 'Primary: OculusCustomHandOpen'
|
||||||
|
|
@ -128,12 +43,12 @@ MonoBehaviour:
|
||||||
Pose: {fileID: 11400000, guid: 3195f5271090d494f8a7cc10c2e5c898, type: 2}
|
Pose: {fileID: 11400000, guid: 3195f5271090d494f8a7cc10c2e5c898, type: 2}
|
||||||
Weight: 1
|
Weight: 1
|
||||||
Mask: 0
|
Mask: 0
|
||||||
|
Disabled: 0
|
||||||
Type: 0
|
Type: 0
|
||||||
Speed: 16
|
Speed: 16
|
||||||
AnimationParameter: None
|
AnimationParameter: None
|
||||||
ButtonParameter: 1
|
ButtonParameter: 1
|
||||||
Button: 0
|
Button: 0
|
||||||
Disabled: 0
|
|
||||||
ThumbType: 1
|
ThumbType: 1
|
||||||
IndexType: 1
|
IndexType: 1
|
||||||
MiddleType: 1
|
MiddleType: 1
|
||||||
|
|
@ -148,12 +63,12 @@ MonoBehaviour:
|
||||||
- Pose: {fileID: 11400000, guid: f6a50a26271c0f44cbbcbc7307260d31, type: 2}
|
- Pose: {fileID: 11400000, guid: f6a50a26271c0f44cbbcbc7307260d31, type: 2}
|
||||||
Weight: 1
|
Weight: 1
|
||||||
Mask: 0
|
Mask: 0
|
||||||
|
Disabled: 0
|
||||||
Type: 0
|
Type: 0
|
||||||
Speed: 16
|
Speed: 16
|
||||||
AnimationParameter: None
|
AnimationParameter: None
|
||||||
ButtonParameter: 0
|
ButtonParameter: 0
|
||||||
Button: 0
|
Button: 0
|
||||||
Disabled: 0
|
|
||||||
ThumbType: 1
|
ThumbType: 1
|
||||||
IndexType: 1
|
IndexType: 1
|
||||||
MiddleType: 1
|
MiddleType: 1
|
||||||
|
|
@ -166,9 +81,111 @@ MonoBehaviour:
|
||||||
PinkyStart: 0
|
PinkyStart: 0
|
||||||
ReferencePose: {fileID: 0}
|
ReferencePose: {fileID: 0}
|
||||||
MirrorAxis: 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
|
--- !u!114 &5620398756903288108 stripped
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_CorrespondingSourceObject: {fileID: 1596500242942430993, guid: bb680487e200bb1458405debc0da3606, type: 3}
|
m_CorrespondingSourceObject: {fileID: 1596500242942430993, guid: bb680487e200bb1458405debc0da3606,
|
||||||
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 6618112662589731389}
|
m_PrefabInstance: {fileID: 6618112662589731389}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 4183614227780674833}
|
m_GameObject: {fileID: 4183614227780674833}
|
||||||
|
|
|
||||||
|
|
@ -1,43 +1,5 @@
|
||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%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
|
--- !u!114 &1230615514187084639
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -55,8 +17,6 @@ MonoBehaviour:
|
||||||
BodyPreview: {fileID: 0}
|
BodyPreview: {fileID: 0}
|
||||||
PreviewLeft: 0
|
PreviewLeft: 0
|
||||||
PreviewRight: 0
|
PreviewRight: 0
|
||||||
LeftAutoPose: 0
|
|
||||||
RightAutoPose: 0
|
|
||||||
SelectionIndex: 0
|
SelectionIndex: 0
|
||||||
PoseNames:
|
PoseNames:
|
||||||
- 'Primary: OculusCustomHandOpen'
|
- 'Primary: OculusCustomHandOpen'
|
||||||
|
|
@ -65,12 +25,12 @@ MonoBehaviour:
|
||||||
Pose: {fileID: 11400000, guid: 3195f5271090d494f8a7cc10c2e5c898, type: 2}
|
Pose: {fileID: 11400000, guid: 3195f5271090d494f8a7cc10c2e5c898, type: 2}
|
||||||
Weight: 1
|
Weight: 1
|
||||||
Mask: 0
|
Mask: 0
|
||||||
|
Disabled: 0
|
||||||
Type: 0
|
Type: 0
|
||||||
Speed: 16
|
Speed: 16
|
||||||
AnimationParameter: None
|
AnimationParameter: None
|
||||||
ButtonParameter: 0
|
ButtonParameter: 0
|
||||||
Button: 0
|
Button: 0
|
||||||
Disabled: 0
|
|
||||||
ThumbType: 1
|
ThumbType: 1
|
||||||
IndexType: 1
|
IndexType: 1
|
||||||
MiddleType: 1
|
MiddleType: 1
|
||||||
|
|
@ -85,12 +45,12 @@ MonoBehaviour:
|
||||||
- Pose: {fileID: 11400000, guid: f6a50a26271c0f44cbbcbc7307260d31, type: 2}
|
- Pose: {fileID: 11400000, guid: f6a50a26271c0f44cbbcbc7307260d31, type: 2}
|
||||||
Weight: 1
|
Weight: 1
|
||||||
Mask: 0
|
Mask: 0
|
||||||
|
Disabled: 0
|
||||||
Type: 0
|
Type: 0
|
||||||
Speed: 16
|
Speed: 16
|
||||||
AnimationParameter: None
|
AnimationParameter: None
|
||||||
ButtonParameter: 0
|
ButtonParameter: 0
|
||||||
Button: 0
|
Button: 0
|
||||||
Disabled: 0
|
|
||||||
ThumbType: 1
|
ThumbType: 1
|
||||||
IndexType: 1
|
IndexType: 1
|
||||||
MiddleType: 1
|
MiddleType: 1
|
||||||
|
|
@ -115,16 +75,62 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 1ebbffaca5ed8a340ae381fb8a5695d8, type: 3}
|
m_Script: {fileID: 11500000, guid: 1ebbffaca5ed8a340ae381fb8a5695d8, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
PoseHand: 1
|
PosePosAndRot: 1
|
||||||
DefaultPoseHand: 1
|
FingerCurlSpeed: 16
|
||||||
DynamicPoseSpeed: 16
|
|
||||||
PhysicsPoser: {fileID: 0}
|
PhysicsPoser: {fileID: 0}
|
||||||
Hand: {fileID: 2237063672852083314}
|
Hand: {fileID: 2237063672852083314}
|
||||||
DefaultPoser: {fileID: 1230615514187084639}
|
DefaultPoser: {fileID: 1230615514187084639}
|
||||||
CurrentPoser: {fileID: 0}
|
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
|
--- !u!114 &2237063672852083314 stripped
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_CorrespondingSourceObject: {fileID: 811485385608274674, guid: d9420cd6b732c874e805d2daa66f8409, type: 3}
|
m_CorrespondingSourceObject: {fileID: 811485385608274674, guid: d9420cd6b732c874e805d2daa66f8409,
|
||||||
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 1461800874448605312}
|
m_PrefabInstance: {fileID: 1461800874448605312}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 114642666673063795}
|
m_GameObject: {fileID: 114642666673063795}
|
||||||
|
|
|
||||||
|
|
@ -1,77 +1,5 @@
|
||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%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
|
--- !u!114 &1481051882093435769
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -88,3 +16,90 @@ MonoBehaviour:
|
||||||
GhostHand: {fileID: 4166322653361916109}
|
GhostHand: {fileID: 4166322653361916109}
|
||||||
ActualHand: {fileID: 0}
|
ActualHand: {fileID: 0}
|
||||||
DisplayGhostHand: 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}
|
||||||
|
|
|
||||||
|
|
@ -1,77 +1,5 @@
|
||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%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
|
--- !u!114 &8822055973328633994
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -88,3 +16,90 @@ MonoBehaviour:
|
||||||
GhostHand: {fileID: 6200011763639512121}
|
GhostHand: {fileID: 6200011763639512121}
|
||||||
ActualHand: {fileID: 0}
|
ActualHand: {fileID: 0}
|
||||||
DisplayGhostHand: 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}
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,8 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: de1e5b754bd6d9241a88e889575193b2, type: 3}
|
m_Script: {fileID: 11500000, guid: de1e5b754bd6d9241a88e889575193b2, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
JointSettings: {fileID: 11400000, guid: 10b31f17bbe7be94c900be1670865136, type: 2}
|
Strength: {fileID: 11400000, guid: 1482e8b1adffac04e8efc4fbd58275a6, type: 2}
|
||||||
|
JointSettings: {fileID: 0}
|
||||||
SolverIterations: 10
|
SolverIterations: 10
|
||||||
SolverVelocityIterations: 10
|
SolverVelocityIterations: 10
|
||||||
ReturnSpeed: 5
|
ReturnSpeed: 5
|
||||||
|
|
@ -402,6 +403,9 @@ MonoBehaviour:
|
||||||
RaycastLayermask:
|
RaycastLayermask:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 5242881
|
m_Bits: 5242881
|
||||||
|
PushoutTime: 0.1
|
||||||
|
PullLerpTime: 0.06
|
||||||
|
MoveThreshold: 10
|
||||||
HandAnimator: {fileID: 4004377266273084089}
|
HandAnimator: {fileID: 4004377266273084089}
|
||||||
HandPhysics: {fileID: 0}
|
HandPhysics: {fileID: 0}
|
||||||
Inputs: {fileID: 0}
|
Inputs: {fileID: 0}
|
||||||
|
|
@ -409,6 +413,7 @@ MonoBehaviour:
|
||||||
ForceGrabber: {fileID: 0}
|
ForceGrabber: {fileID: 0}
|
||||||
ControllerOffset: {fileID: 0}
|
ControllerOffset: {fileID: 0}
|
||||||
CollisionHandler: {fileID: 0}
|
CollisionHandler: {fileID: 0}
|
||||||
|
Pusher: {fileID: 0}
|
||||||
GrabIndicator: {fileID: 2216849731261072619}
|
GrabIndicator: {fileID: 2216849731261072619}
|
||||||
TriggerGrabIndicator: {fileID: 2216849731261072619}
|
TriggerGrabIndicator: {fileID: 2216849731261072619}
|
||||||
DynamicPoseIndicator: {fileID: 0}
|
DynamicPoseIndicator: {fileID: 0}
|
||||||
|
|
@ -491,7 +496,8 @@ MonoBehaviour:
|
||||||
MaxDepenetration: 0
|
MaxDepenetration: 0
|
||||||
COMGizmoSize: {x: 0.02, y: 0.02, z: 0.02}
|
COMGizmoSize: {x: 0.02, y: 0.02, z: 0.02}
|
||||||
LiveUpdate: 0
|
LiveUpdate: 0
|
||||||
Rigidbody: {fileID: 0}
|
ShowCOMGizmo: 0
|
||||||
|
Rigidbody: {fileID: 1272608247111003343}
|
||||||
--- !u!1 &1418766355926841473
|
--- !u!1 &1418766355926841473
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -1053,6 +1059,8 @@ MonoBehaviour:
|
||||||
AutoGrab: 1
|
AutoGrab: 1
|
||||||
AdditionalAutoGrabTime: 1
|
AdditionalAutoGrabTime: 1
|
||||||
AutoGrabDistance: 0.3
|
AutoGrabDistance: 0.3
|
||||||
|
SlowMo: 0
|
||||||
|
TimeScale: 0.25
|
||||||
--- !u!1 &5627524905124722554
|
--- !u!1 &5627524905124722554
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -1372,7 +1380,6 @@ MonoBehaviour:
|
||||||
RingStart: 0
|
RingStart: 0
|
||||||
PinkyStart: 0
|
PinkyStart: 0
|
||||||
Blends: []
|
Blends: []
|
||||||
ReferencePose: {fileID: 0}
|
|
||||||
MirrorAxis: 0
|
MirrorAxis: 0
|
||||||
--- !u!1 &7474375505230444028
|
--- !u!1 &7474375505230444028
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -575,6 +575,8 @@ MonoBehaviour:
|
||||||
AutoGrab: 1
|
AutoGrab: 1
|
||||||
AdditionalAutoGrabTime: 1
|
AdditionalAutoGrabTime: 1
|
||||||
AutoGrabDistance: 0.3
|
AutoGrabDistance: 0.3
|
||||||
|
SlowMo: 0
|
||||||
|
TimeScale: 0.25
|
||||||
--- !u!1 &4348451690646725368
|
--- !u!1 &4348451690646725368
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -810,7 +812,6 @@ MonoBehaviour:
|
||||||
RingStart: 0
|
RingStart: 0
|
||||||
PinkyStart: 0
|
PinkyStart: 0
|
||||||
Blends: []
|
Blends: []
|
||||||
ReferencePose: {fileID: 0}
|
|
||||||
MirrorAxis: 0
|
MirrorAxis: 0
|
||||||
--- !u!1 &7298255598267339687
|
--- !u!1 &7298255598267339687
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
@ -1004,7 +1005,8 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: de1e5b754bd6d9241a88e889575193b2, type: 3}
|
m_Script: {fileID: 11500000, guid: de1e5b754bd6d9241a88e889575193b2, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
JointSettings: {fileID: 11400000, guid: 10b31f17bbe7be94c900be1670865136, type: 2}
|
Strength: {fileID: 11400000, guid: 1482e8b1adffac04e8efc4fbd58275a6, type: 2}
|
||||||
|
JointSettings: {fileID: 0}
|
||||||
SolverIterations: 10
|
SolverIterations: 10
|
||||||
SolverVelocityIterations: 10
|
SolverVelocityIterations: 10
|
||||||
ReturnSpeed: 5
|
ReturnSpeed: 5
|
||||||
|
|
@ -1086,6 +1088,9 @@ MonoBehaviour:
|
||||||
RaycastLayermask:
|
RaycastLayermask:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 9437185
|
m_Bits: 9437185
|
||||||
|
PushoutTime: 0.1
|
||||||
|
PullLerpTime: 0.06
|
||||||
|
MoveThreshold: 10
|
||||||
HandAnimator: {fileID: 1776087990296578313}
|
HandAnimator: {fileID: 1776087990296578313}
|
||||||
HandPhysics: {fileID: 0}
|
HandPhysics: {fileID: 0}
|
||||||
Inputs: {fileID: 0}
|
Inputs: {fileID: 0}
|
||||||
|
|
@ -1093,6 +1098,7 @@ MonoBehaviour:
|
||||||
ForceGrabber: {fileID: 0}
|
ForceGrabber: {fileID: 0}
|
||||||
ControllerOffset: {fileID: 0}
|
ControllerOffset: {fileID: 0}
|
||||||
CollisionHandler: {fileID: 0}
|
CollisionHandler: {fileID: 0}
|
||||||
|
Pusher: {fileID: 0}
|
||||||
GrabIndicator: {fileID: 7894897457090346305}
|
GrabIndicator: {fileID: 7894897457090346305}
|
||||||
TriggerGrabIndicator: {fileID: 7894897457090346305}
|
TriggerGrabIndicator: {fileID: 7894897457090346305}
|
||||||
DynamicPoseIndicator: {fileID: 0}
|
DynamicPoseIndicator: {fileID: 0}
|
||||||
|
|
@ -1175,7 +1181,8 @@ MonoBehaviour:
|
||||||
MaxDepenetration: 0
|
MaxDepenetration: 0
|
||||||
COMGizmoSize: {x: 0.02, y: 0.02, z: 0.02}
|
COMGizmoSize: {x: 0.02, y: 0.02, z: 0.02}
|
||||||
LiveUpdate: 0
|
LiveUpdate: 0
|
||||||
Rigidbody: {fileID: 0}
|
ShowCOMGizmo: 0
|
||||||
|
Rigidbody: {fileID: 8032787983860862300}
|
||||||
--- !u!1 &8265266644222074048
|
--- !u!1 &8265266644222074048
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ Transform:
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1597478437996711727}
|
- {fileID: 1597478437996711727}
|
||||||
- {fileID: 9013499696880255983}
|
- {fileID: 9013499696880255983}
|
||||||
- {fileID: 8945561188959342034}
|
|
||||||
m_Father: {fileID: 8890804905152358655}
|
m_Father: {fileID: 8890804905152358655}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
|
@ -48,7 +47,6 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
Arrow: {fileID: 4779085363590329893}
|
Arrow: {fileID: 4779085363590329893}
|
||||||
Ring: {fileID: 4822340545015479242}
|
Ring: {fileID: 4822340545015479242}
|
||||||
Cylinder: {fileID: 4894702927335961675}
|
|
||||||
UseTeleporterColors: 1
|
UseTeleporterColors: 1
|
||||||
ValidColor: {r: 0.006109435, g: 0.8308824, b: 0.7284968, a: 0.5}
|
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}
|
InvalidColor: {r: 0.8679245, g: 0.1432894, b: 0.1432894, a: 0}
|
||||||
|
|
@ -499,82 +497,3 @@ MeshRenderer:
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 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
|
|
||||||
|
|
|
||||||
|
|
@ -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:
|
2.9.1e
|
||||||
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.
|
|
||||||
|
|
||||||
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.
|
Fix Oculus and WMR menu button bindings for OpenXR
|
||||||
VRIK Setup - fix IK solve at setup end when avatar spine isn't using normal forward / right vectors.
|
Fix HVRCockingHandle to handle initial grab offset better
|
||||||
Adjust force grab default max force (was too strong for hexabody)
|
|
||||||
|
|
||||||
|
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
|
Fixed bug where the grab joint might end up on the wrong game object if the grabbable was a child of the rigidbody.
|
||||||
HVRControllerOffset will smoothly move / rotate to the grab points offset value instead of immediately snapping.
|
Fixed player controller to take into account the angle of the surface the player is standing on.
|
||||||
Tweaked force grabber to bring the object closer to the hand before the hand takes over.
|
Fixed bug where child grabbables could be grabbed if their MasterGrabbable was socketed.
|
||||||
Updated Hand Setup Wizard instructions to be more clear.
|
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
|
HVRSocketLink:
|
||||||
Fix HVRTeleporter capsule overlap check math that was failing at small capsule sizes.
|
Permanently links a grabbable to a socket with optional return time lerping.
|
||||||
Fix grabbing when the hand was set to toggle grab mode but the grabbable was set to Active mode.
|
Replaces the now deprecated grabbable fields StartingSocket/LinkStartingSocket.
|
||||||
Improved post teleport hand / held object positioning if the user rotated the player to a new direction.
|
Filter setup is not required as the socket will only accept the linked object.
|
||||||
HVRSocket - scale grabbable defaulted to false
|
Example scene updated with socket example. Backpack on rig prefab updated.
|
||||||
Added basic EmeraldAI (v3) integration scene
|
|
||||||
HVRSettings - new DisableHaptics toggle
|
|
||||||
HVRPhysicsDial - fixed anchor to start at 0,0,0
|
|
||||||
|
|
||||||
|
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 grab indicators showing up even if they were marked disabled on the HVRGrabbable.
|
||||||
Fixed impact component when rigidbody is missing
|
Fixed issue where CockingHandle would not lock forward if the controller was too far forward of the grab point.
|
||||||
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.
|
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
@ -18,6 +18,9 @@ MonoBehaviour:
|
||||||
WMR:
|
WMR:
|
||||||
Position: {x: 0, y: 0, z: 0}
|
Position: {x: 0, y: 0, z: 0}
|
||||||
Rotation: {x: 40, 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:
|
OculusSteamVR:
|
||||||
Position: {x: -0.001, y: -0.005, z: -0.05}
|
Position: {x: -0.001, y: -0.005, z: -0.05}
|
||||||
Rotation: {x: 40, y: 0, z: 0}
|
Rotation: {x: 40, y: 0, z: 0}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1482e8b1adffac04e8efc4fbd58275a6
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b12c3f7f37233934f96dd9eaf0878672
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d743713d642f47b47b16425271dc9e35
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f4fc40462bb4bb041b5964be99f85368
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e0cd6b1a451e3854ba6e54d82005a0e2
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 561dfd33fe0af7e408e6ac5f5e30a3f1
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 263b353c0100fed4cb7bd21bc56f0620
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bfff0207f648e9b4d9f1868798fb5efe
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -14,13 +14,13 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier: HurricaneVR.Framework:HurricaneVR.Framework.Components:ImpactHaptics
|
m_EditorClassIdentifier: HurricaneVR.Framework:HurricaneVR.Framework.Components:ImpactHaptics
|
||||||
Timeout: 0.3
|
Timeout: 0.3
|
||||||
SqrMagThreshold: 0.65
|
SqrMagThreshold: 0.65
|
||||||
MaxForce: 700
|
MaxForce: 300
|
||||||
AmpCurve:
|
AmpCurve:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Curve:
|
m_Curve:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
time: 0
|
time: 0
|
||||||
value: 0.45
|
value: 0.15
|
||||||
inSlope: 0
|
inSlope: 0
|
||||||
outSlope: 0
|
outSlope: 0
|
||||||
tangentMode: 0
|
tangentMode: 0
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@ MonoBehaviour:
|
||||||
MaxUpForce: 5
|
MaxUpForce: 5
|
||||||
UseTwoHandMaxUpforce: 0
|
UseTwoHandMaxUpforce: 0
|
||||||
UseTwoHandMaxSideForce: 0
|
UseTwoHandMaxSideForce: 0
|
||||||
MaxBackForce: 200
|
MaxBackForce: 2000
|
||||||
TwoHandMaxUpForce: 100
|
TwoHandMaxUpForce: 200
|
||||||
MaxSideForce: 100
|
MaxSideForce: 200
|
||||||
TwoHandMaxSideForce: 0
|
TwoHandMaxSideForce: 0
|
||||||
RecoveryDelay: 0
|
RecoveryDelay: 0
|
||||||
TwoHandedRecoveryDelay: 0.15
|
TwoHandedRecoveryDelay: 0.15
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@ using UnityEngine.Events;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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))]
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
public class HVRButton : MonoBehaviour
|
public class HVRButton : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
@ -38,11 +42,6 @@ namespace HurricaneVR.Framework.Components
|
||||||
Rigidbody = GetComponent<Rigidbody>();
|
Rigidbody = GetComponent<Rigidbody>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FixedUpdate()
|
private void FixedUpdate()
|
||||||
{
|
{
|
||||||
var distance = (StartPosition - transform.localPosition).magnitude;
|
var distance = (StartPosition - transform.localPosition).magnitude;
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,12 @@
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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
|
public class HVRClimbable : MonoBehaviour
|
||||||
{
|
{
|
||||||
// Start is called before the first frame update
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ using UnityEngine.Events;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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
|
public class HVRCollisionEvents : MonoBehaviour
|
||||||
{
|
{
|
||||||
[Header("Settings")]
|
[Header("Settings")]
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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
|
public class HVRControllerOffset : MonoBehaviour
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -30,16 +34,20 @@ namespace HurricaneVR.Framework.Components
|
||||||
public Vector3 ControllerRotationOffset => _offsets != null ? _offsets.Rotation : Vector3.zero;
|
public Vector3 ControllerRotationOffset => _offsets != null ? _offsets.Rotation : Vector3.zero;
|
||||||
|
|
||||||
[Header("Debugging")]
|
[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;
|
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;
|
private Quaternion _teleportStartRotation;
|
||||||
|
|
||||||
public bool _updatingRotation;
|
public bool _updatingRotation;
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,13 @@ namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
[Header("Unity XR")]
|
[Header("Unity XR")]
|
||||||
public HVRDevicePoseOffset Oculus;
|
public HVRDevicePoseOffset Oculus;
|
||||||
|
|
||||||
public HVRDevicePoseOffset WMR;
|
public HVRDevicePoseOffset WMR;
|
||||||
|
public HVRDevicePoseOffset Pico;
|
||||||
|
|
||||||
[Header("SteamVR")]
|
[Header("SteamVR")]
|
||||||
public HVRDevicePoseOffset OculusSteamVR;
|
public HVRDevicePoseOffset OculusSteamVR;
|
||||||
|
|
||||||
public HVRDevicePoseOffset WMRSteamVR;
|
public HVRDevicePoseOffset WMRSteamVR;
|
||||||
public HVRDevicePoseOffset ReverbG2SteamVR;
|
public HVRDevicePoseOffset ReverbG2SteamVR;
|
||||||
public HVRDevicePoseOffset CosmosSteamVR;
|
public HVRDevicePoseOffset CosmosSteamVR;
|
||||||
|
|
@ -27,11 +30,13 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
[Header("OpenXR")]
|
[Header("OpenXR")]
|
||||||
public HVRDevicePoseOffset OculusOpenXR;
|
public HVRDevicePoseOffset OculusOpenXR;
|
||||||
|
|
||||||
public HVRDevicePoseOffset WMROpenXR;
|
public HVRDevicePoseOffset WMROpenXR;
|
||||||
public HVRDevicePoseOffset ReverbG2OpenXR;
|
public HVRDevicePoseOffset ReverbG2OpenXR;
|
||||||
public HVRDevicePoseOffset ViveOpenXR;
|
public HVRDevicePoseOffset ViveOpenXR;
|
||||||
public HVRDevicePoseOffset CosmosOpenXR;
|
public HVRDevicePoseOffset CosmosOpenXR;
|
||||||
public HVRDevicePoseOffset KnucklesOpenXR;
|
public HVRDevicePoseOffset KnucklesOpenXR;
|
||||||
|
public HVRDevicePoseOffset PicoOpenXR;
|
||||||
|
|
||||||
public HVRDevicePoseOffset GetDeviceOffset(HVRHandSide side)
|
public HVRDevicePoseOffset GetDeviceOffset(HVRHandSide side)
|
||||||
{
|
{
|
||||||
|
|
@ -47,7 +52,6 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
||||||
case HVRControllerType.Oculus:
|
case HVRControllerType.Oculus:
|
||||||
if (steamVR)
|
if (steamVR)
|
||||||
{
|
{
|
||||||
|
|
@ -83,6 +87,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
return ViveOpenXR;
|
return ViveOpenXR;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case HVRControllerType.Knuckles:
|
case HVRControllerType.Knuckles:
|
||||||
if (steamVR)
|
if (steamVR)
|
||||||
|
|
@ -93,6 +98,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
return KnucklesOpenXR;
|
return KnucklesOpenXR;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case HVRControllerType.Cosmos:
|
case HVRControllerType.Cosmos:
|
||||||
if (steamVR)
|
if (steamVR)
|
||||||
|
|
@ -103,6 +109,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
return CosmosOpenXR;
|
return CosmosOpenXR;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case HVRControllerType.ReverbG2:
|
case HVRControllerType.ReverbG2:
|
||||||
if (steamVR)
|
if (steamVR)
|
||||||
|
|
@ -113,7 +120,14 @@ namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
return ReverbG2OpenXR;
|
return ReverbG2OpenXR;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
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;
|
return null;
|
||||||
|
|
@ -124,7 +138,9 @@ namespace HurricaneVR.Framework.Components
|
||||||
public class HVRDevicePoseOffset
|
public class HVRDevicePoseOffset
|
||||||
{
|
{
|
||||||
public Vector3 Position;
|
public Vector3 Position;
|
||||||
[FormerlySerializedAs("_rotation")] [SerializeField]
|
|
||||||
|
[FormerlySerializedAs("_rotation")]
|
||||||
|
[SerializeField]
|
||||||
public Vector3 Rotation;
|
public Vector3 Rotation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -13,8 +13,6 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
public HVRDestructible Desctructible;
|
public HVRDestructible Desctructible;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
Rigidbody = GetComponent<Rigidbody>();
|
Rigidbody = GetComponent<Rigidbody>();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ using UnityEngine.Events;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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 class HVRDestroyListener : MonoBehaviour
|
||||||
{
|
{
|
||||||
public HVRDestroyedEvent Destroyed = new HVRDestroyedEvent();
|
public HVRDestroyedEvent Destroyed = new HVRDestroyedEvent();
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Destroys this game object after a timeout
|
||||||
|
/// </summary>
|
||||||
public class HVRDestroyTimer : MonoBehaviour
|
public class HVRDestroyTimer : MonoBehaviour
|
||||||
{
|
{
|
||||||
public void StartTimer(float timeout)
|
public void StartTimer(float timeout)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,11 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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 class HVRDestructible : MonoBehaviour
|
||||||
{
|
{
|
||||||
public GameObject DestroyedVersion;
|
public GameObject DestroyedVersion;
|
||||||
|
|
@ -17,8 +22,12 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
public bool IgnorePlayerCollision = true;
|
public bool IgnorePlayerCollision = true;
|
||||||
|
|
||||||
|
public bool Destroyed { get; protected set; }
|
||||||
|
|
||||||
public virtual void Destroy()
|
public virtual void Destroy()
|
||||||
{
|
{
|
||||||
|
if (Destroyed) return;
|
||||||
|
|
||||||
if (DestroyedVersion)
|
if (DestroyedVersion)
|
||||||
{
|
{
|
||||||
var destroyed = Instantiate(DestroyedVersion, transform.position, transform.rotation);
|
var destroyed = Instantiate(DestroyedVersion, transform.position, transform.rotation);
|
||||||
|
|
@ -59,6 +68,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Destroyed = true;
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Deprecated and left in for older projects. Superceded by HVRPhysicsDial and HVRRotationTracker
|
||||||
|
/// </summary>
|
||||||
[RequireComponent(typeof(HVRGrabbable))]
|
[RequireComponent(typeof(HVRGrabbable))]
|
||||||
public class HVRDial : MonoBehaviour
|
public class HVRDial : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,42 @@
|
||||||
using HurricaneVR.Framework.Core.Grabbers;
|
using HurricaneVR.Framework.Core.Grabbers;
|
||||||
|
using HurricaneVR.Framework.Core.Player;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
|
|
||||||
public class HVRHandImpactHaptics : HVRImpactHapticsBase
|
public class HVRHandImpactHaptics : HVRImpactHapticsBase
|
||||||
{
|
{
|
||||||
public HVRHandGrabber Hand;
|
public HVRHandGrabber Hand;
|
||||||
|
|
||||||
|
[Tooltip("If true and the hand is holding something, haptics will not play.")]
|
||||||
public bool HandGrabbingPrevents = true;
|
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()
|
protected override void Awake()
|
||||||
{
|
{
|
||||||
base.Awake();
|
base.Awake();
|
||||||
|
|
||||||
if (!Hand) TryGetComponent(out Hand);
|
if (!Hand) TryGetComponent(out Hand);
|
||||||
|
|
||||||
|
TryGetComponent(out _hand);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Vibrate(float duration, float amplitude, float frequency)
|
protected override void Vibrate(float duration, float amplitude, float frequency)
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,10 @@ namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
Folder = DateTime.Now.ToString("yyyyMMdd_HH_mm");
|
Folder = DateTime.Now.ToString("yyyyMMdd_HH_mm");
|
||||||
}
|
}
|
||||||
|
#if UNITY_EDITOR
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
|
||||||
|
|
||||||
if (DisablePhysics && !_previousDisable)
|
if (DisablePhysics && !_previousDisable)
|
||||||
{
|
{
|
||||||
|
|
@ -79,9 +79,9 @@ namespace HurricaneVR.Framework.Components
|
||||||
_previousDisable = DisablePhysics;
|
_previousDisable = DisablePhysics;
|
||||||
|
|
||||||
CheckSnapshot();
|
CheckSnapshot();
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
private void CheckSnapshot()
|
private void CheckSnapshot()
|
||||||
{
|
{
|
||||||
HVRPosableHand hand = null;
|
HVRPosableHand hand = null;
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,19 @@ namespace HurricaneVR.Framework.Components
|
||||||
public class HVRImpactHaptics : ScriptableObject
|
public class HVRImpactHaptics : ScriptableObject
|
||||||
{
|
{
|
||||||
public float Timeout = .3f;
|
public float Timeout = .3f;
|
||||||
|
|
||||||
|
[Tooltip("Collision Velocity Square Magnitude cut off filter")]
|
||||||
public float SqrMagThreshold = .30f;
|
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;
|
public AnimationCurve AmpCurve;
|
||||||
|
|
||||||
|
[Tooltip("Duration fed into haptics API.")]
|
||||||
public float Duration = .25f;
|
public float Duration = .25f;
|
||||||
|
|
||||||
|
[Tooltip("Frequency fed into haptics API")]
|
||||||
public float Frequency = 150f;
|
public float Frequency = 150f;
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ namespace HurricaneVR.Framework.Components
|
||||||
private float _lastHaptic;
|
private float _lastHaptic;
|
||||||
private Rigidbody Rb;
|
private Rigidbody Rb;
|
||||||
|
|
||||||
|
public virtual float MaxForce => Data.MaxForce;
|
||||||
|
|
||||||
protected virtual void Awake()
|
protected virtual void Awake()
|
||||||
{
|
{
|
||||||
TryGetComponent(out Rb);
|
TryGetComponent(out Rb);
|
||||||
|
|
@ -50,7 +52,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
Force = impulse / Time.fixedDeltaTime;
|
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);
|
Vibrate(Data.Duration, amp, Data.Frequency);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Depecrecated and left in for older projects, superceded by HVRPhysicsLever and HVRRotationTracker
|
||||||
|
/// </summary>
|
||||||
[RequireComponent(typeof(HVRGrabbable))]
|
[RequireComponent(typeof(HVRGrabbable))]
|
||||||
[RequireComponent(typeof(HingeJoint))]
|
[RequireComponent(typeof(HingeJoint))]
|
||||||
public class HVRLever : MonoBehaviour
|
public class HVRLever : MonoBehaviour
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Helper component to parent this transform to the assigned transform on game start
|
||||||
|
/// </summary>
|
||||||
public class HVRParentOnStart : MonoBehaviour
|
public class HVRParentOnStart : MonoBehaviour
|
||||||
{
|
{
|
||||||
public Transform Parent;
|
public Transform Parent;
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,24 @@ using UnityEngine.Events;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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))]
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
public class HVRPhysicsButton : MonoBehaviour
|
public class HVRPhysicsButton : MonoBehaviour
|
||||||
{
|
{
|
||||||
[Header("Settings")]
|
[Header("Settings")]
|
||||||
|
|
||||||
|
[Tooltip("Axis the button will travel on in local space.")]
|
||||||
public HVRAxis Axis;
|
public HVRAxis Axis;
|
||||||
|
|
||||||
|
[Tooltip("Rigidbody this button will connect to with a joint.")]
|
||||||
public Rigidbody ConnectedBody;
|
public Rigidbody ConnectedBody;
|
||||||
|
|
||||||
|
[Tooltip("Spring value of the joint")]
|
||||||
public float Spring = 1000f;
|
public float Spring = 1000f;
|
||||||
|
|
||||||
|
[Tooltip("Damper of the joint")]
|
||||||
public float Damper = 50f;
|
public float Damper = 50f;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,12 @@ using UnityEngine.Serialization;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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))]
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
public class HVRPhysicsDial : MonoBehaviour
|
public class HVRPhysicsDial : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] public HVRGrabbable Grabbable;
|
|
||||||
|
|
||||||
[Header("Settings")]
|
[Header("Settings")]
|
||||||
[Tooltip("Local axis of rotation")]
|
[Tooltip("Local axis of rotation")]
|
||||||
public HVRAxis Axis;
|
public HVRAxis Axis;
|
||||||
|
|
@ -23,6 +24,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
[Tooltip("If true the angular velocity will be zero'd out on release.")]
|
[Tooltip("If true the angular velocity will be zero'd out on release.")]
|
||||||
public bool StopOnRelease = true;
|
public bool StopOnRelease = true;
|
||||||
|
|
||||||
|
[Tooltip("Defaults to true to prevent rotation when not held")]
|
||||||
public bool DisableGravity = true;
|
public bool DisableGravity = true;
|
||||||
|
|
||||||
[Header("Joint Limits")]
|
[Header("Joint Limits")]
|
||||||
|
|
@ -41,6 +43,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
[Tooltip("Angular Damper when the dial is not grabbed")]
|
[Tooltip("Angular Damper when the dial is not grabbed")]
|
||||||
public float Damper = 3;
|
public float Damper = 3;
|
||||||
|
|
||||||
|
[Tooltip("Optional spring value of the joint to return to starting rotation if desired")]
|
||||||
public float Spring;
|
public float Spring;
|
||||||
|
|
||||||
[Header("Editor")]
|
[Header("Editor")]
|
||||||
|
|
@ -52,6 +55,8 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
public Rigidbody Rigidbody { get; private set; }
|
public Rigidbody Rigidbody { get; private set; }
|
||||||
|
|
||||||
|
public HVRGrabbable Grabbable { get; private set; }
|
||||||
|
|
||||||
public ConfigurableJoint Joint { get; set; }
|
public ConfigurableJoint Joint { get; set; }
|
||||||
|
|
||||||
protected virtual void Awake()
|
protected virtual void Awake()
|
||||||
|
|
@ -60,26 +65,14 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
Rigidbody.useGravity = !DisableGravity;
|
Rigidbody.useGravity = !DisableGravity;
|
||||||
|
|
||||||
if (!Grabbable) Grabbable = GetComponent<HVRGrabbable>();
|
Grabbable = GetComponent<HVRGrabbable>();
|
||||||
|
|
||||||
if (Grabbable)
|
if (Grabbable)
|
||||||
{
|
{
|
||||||
Grabbable.HandGrabbed.AddListener(OnDialGrabbed);
|
Grabbable.HandGrabbed.AddListener(OnDialGrabbed);
|
||||||
Grabbable.HandReleased.AddListener(OnDialReleased);
|
Grabbable.HandReleased.AddListener(OnDialReleased);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MinAngle > 0)
|
FixAngle(ref MinAngle, ref MaxAngle);
|
||||||
{
|
|
||||||
MinAngle *= -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MaxAngle < 0)
|
|
||||||
{
|
|
||||||
MaxAngle *= -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
MinAngle = Mathf.Clamp(MinAngle, MinAngle, 0);
|
|
||||||
MaxAngle = Mathf.Clamp(MaxAngle, 0, MaxAngle);
|
|
||||||
|
|
||||||
SetupJoint();
|
SetupJoint();
|
||||||
AfterJointCreated(Joint);
|
AfterJointCreated(Joint);
|
||||||
|
|
@ -95,7 +88,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
if (TargetAngularVelocity > 0f || TargetAngularVelocity < 0f) Joint.targetAngularVelocity = new Vector3(TargetAngularVelocity, 0f, 0f);
|
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);
|
Joint.SetAngularXDrive(Spring, Damper, 10000f);
|
||||||
if (StopOnRelease)
|
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);
|
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)
|
public void SetLimits(float minAngle, float maxAngle)
|
||||||
{
|
{
|
||||||
|
FixAngle(ref minAngle, ref maxAngle);
|
||||||
|
|
||||||
Joint.LimitAngularXMotion();
|
Joint.LimitAngularXMotion();
|
||||||
Joint.SetAngularXHighLimit(minAngle);
|
Joint.SetAngularXHighLimit(minAngle);
|
||||||
Joint.SetAngularXLowLimit(maxAngle);
|
Joint.SetAngularXLowLimit(maxAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the limit's to the -MinAngle and MaxAngle values of this component.
|
||||||
|
/// </summary>
|
||||||
public void ResetLimits()
|
public void ResetLimits()
|
||||||
{
|
{
|
||||||
Joint.LimitAngularXMotion();
|
Joint.LimitAngularXMotion();
|
||||||
Joint.SetAngularXHighLimit(-MinAngle);
|
Joint.SetAngularXHighLimit(-MinAngle);
|
||||||
Joint.SetAngularXLowLimit(-MaxAngle);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7,42 +7,76 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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(HVRRotationTracker))]
|
||||||
[RequireComponent(typeof(Rigidbody))]
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
public class HVRPhysicsDoor : MonoBehaviour
|
public class HVRPhysicsDoor : MonoBehaviour
|
||||||
{
|
{
|
||||||
[Header("Settings")]
|
[Header("Settings")] [Tooltip("Local axis of rotation")]
|
||||||
[Tooltip("Local axis of rotation")]
|
|
||||||
public HVRAxis Axis;
|
public HVRAxis Axis;
|
||||||
public float Mass = 10f;
|
|
||||||
|
[Tooltip("Door's rigidbody mass.")] public float Mass = 10f;
|
||||||
|
|
||||||
public bool DisableGravity = true;
|
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;
|
public bool StartLocked;
|
||||||
|
|
||||||
[Tooltip("Rigidbody to connect the joint to")]
|
[Tooltip("Rigidbody to connect the joint to")]
|
||||||
public Rigidbody ConnectedBody;
|
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;
|
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;
|
public float CloseOverTime = .25f;
|
||||||
|
|
||||||
|
[Tooltip("How long the door angle must be below 'CloseAngle' to become closed.")]
|
||||||
public float CloseDetectionTime = .5f;
|
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 SFXThresholdAngle = 2.5f;
|
||||||
|
|
||||||
public float SFXResetThreshold = 1f;
|
public float SFXResetThreshold = 1f;
|
||||||
public AudioClip SFXOpened;
|
public AudioClip SFXOpened;
|
||||||
public AudioClip SFXClosed;
|
public AudioClip SFXClosed;
|
||||||
|
|
||||||
|
[Tooltip("Delay before the open / close sfx can be played again")]
|
||||||
public float SFXTimeout = 1f;
|
public float SFXTimeout = 1f;
|
||||||
|
|
||||||
|
[Tooltip("Optional transform to define the position of the open / close sound fx.")]
|
||||||
public Transform SFXPosition;
|
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;
|
public bool HandleRequiresRotation;
|
||||||
|
|
||||||
|
[Tooltip("Required handle rotation to unlatch the door.")]
|
||||||
public float HandleThreshold = 45f;
|
public float HandleThreshold = 45f;
|
||||||
|
|
||||||
|
[Tooltip("The rotation tracker that reports the amount of rotation of the handle.")]
|
||||||
public HVRRotationTracker HandleRotationTracker;
|
public HVRRotationTracker HandleRotationTracker;
|
||||||
|
|
||||||
|
[Tooltip("If provided (and held) the door will not automatically shut when it is below 'CloseAngle' in degrees.")]
|
||||||
public HVRGrabbable HandleGrabbable;
|
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;
|
public HVRPhysicsDial DoorKnob;
|
||||||
|
|
||||||
|
|
||||||
[Header("Joint Limits")]
|
[Tooltip("The rotation tracker that reports the amount of rotation of the handle.")]
|
||||||
public bool LimitRotation = true;
|
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")]
|
[Tooltip("Minimum Angle about the axis of rotation")]
|
||||||
public float MinAngle;
|
public float MinAngle;
|
||||||
|
|
@ -50,19 +84,17 @@ namespace HurricaneVR.Framework.Components
|
||||||
[Tooltip("Maximum rotation about the axis of rotation")]
|
[Tooltip("Maximum rotation about the axis of rotation")]
|
||||||
public float MaxAngle;
|
public float MaxAngle;
|
||||||
|
|
||||||
[Header("Joint Settings")]
|
[Header("Joint Settings")] [Tooltip("Angular Damper of the door hinge.")]
|
||||||
|
|
||||||
[Tooltip("Angular Damper when the dial is not grabbed")]
|
|
||||||
public float Damper = 10;
|
public float Damper = 10;
|
||||||
|
|
||||||
|
[Tooltip("Angular Spring that will return the door to it's starting rotation")]
|
||||||
public float Spring;
|
public float Spring;
|
||||||
|
|
||||||
//[Header("Editor")]
|
//[Header("Editor")]
|
||||||
//[SerializeField]
|
//[SerializeField]
|
||||||
//protected Quaternion JointStartRotation;
|
//protected Quaternion JointStartRotation;
|
||||||
|
|
||||||
[Header("Debugging")]
|
[Header("Debugging")] public float TargetAngularVelocity = 0f;
|
||||||
public float TargetAngularVelocity = 0f;
|
|
||||||
public bool DoorLatched;
|
public bool DoorLatched;
|
||||||
public bool DoorClosed;
|
public bool DoorClosed;
|
||||||
public bool Opened;
|
public bool Opened;
|
||||||
|
|
@ -161,7 +193,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
DoorClosed = false;
|
DoorClosed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HandleGrabbable && HandleGrabbable.IsBeingHeld)
|
if (HandleGrabbable && HandleGrabbable.IsBeingHeld || SecondHandleGrabbable && SecondHandleGrabbable.IsBeingHeld)
|
||||||
{
|
{
|
||||||
_detectionTimer = 0f;
|
_detectionTimer = 0f;
|
||||||
}
|
}
|
||||||
|
|
@ -209,11 +241,14 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
if (HandleRequiresRotation)
|
if (HandleRequiresRotation)
|
||||||
{
|
{
|
||||||
if (HandleRotationTracker.UnsignedAngle >= HandleThreshold)
|
if (HandleRotationTracker.UnsignedAngle >= HandleThreshold ||
|
||||||
|
(SecondHandleRotationTracker && SecondHandleRotationTracker.UnsignedAngle >= HandleThreshold))
|
||||||
{
|
{
|
||||||
DoorLatched = false;
|
DoorLatched = false;
|
||||||
}
|
}
|
||||||
else if (HandleRotationTracker.UnsignedAngle < HandleThreshold && Tracker.UnsignedAngle < CloseAngle)
|
else if (HandleRotationTracker.UnsignedAngle < HandleThreshold &&
|
||||||
|
(!SecondHandleRotationTracker || SecondHandleRotationTracker.UnsignedAngle < HandleThreshold) &&
|
||||||
|
Tracker.UnsignedAngle < CloseAngle)
|
||||||
{
|
{
|
||||||
DoorLatched = true;
|
DoorLatched = true;
|
||||||
}
|
}
|
||||||
|
|
@ -235,7 +270,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
PreviousClosed = DoorClosed;
|
PreviousClosed = DoorClosed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vector3 GetSFXPosition()
|
protected virtual Vector3 GetSFXPosition()
|
||||||
{
|
{
|
||||||
var position = transform.position;
|
var position = transform.position;
|
||||||
if (SFXPosition)
|
if (SFXPosition)
|
||||||
|
|
@ -248,31 +283,30 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
protected virtual void PlayClosedSFX()
|
protected virtual void PlayClosedSFX()
|
||||||
{
|
{
|
||||||
|
if (SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(SFXClosed, GetSFXPosition());
|
||||||
if(SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(SFXClosed, GetSFXPosition());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected virtual void PlayOpenedSFX()
|
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)
|
if (VerboseLogging)
|
||||||
Debug.Log($"OnDoorUnLatched");
|
Debug.Log($"OnDoorUnLatched");
|
||||||
UnlockDoorJoint();
|
UnlockDoorJoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnDoorLatched()
|
public virtual void OnDoorLatched()
|
||||||
{
|
{
|
||||||
if (VerboseLogging)
|
if (VerboseLogging)
|
||||||
Debug.Log($"OnDoorLatched");
|
Debug.Log($"OnDoorLatched");
|
||||||
LockDoorJoint();
|
LockDoorJoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReSharper disable Unity.PerformanceAnalysis
|
||||||
protected virtual void OnDoorClosed()
|
protected virtual void OnDoorClosed()
|
||||||
{
|
{
|
||||||
if (VerboseLogging)
|
if (VerboseLogging)
|
||||||
|
|
@ -281,6 +315,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
StartCoroutine(DoorCloseRoutine());
|
StartCoroutine(DoorCloseRoutine());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReSharper disable Unity.PerformanceAnalysis
|
||||||
protected virtual void OnDoorOpened()
|
protected virtual void OnDoorOpened()
|
||||||
{
|
{
|
||||||
if (VerboseLogging)
|
if (VerboseLogging)
|
||||||
|
|
@ -302,6 +337,9 @@ namespace HurricaneVR.Framework.Components
|
||||||
Joint.SetAngularXLowLimit(-MaxAngle);
|
Joint.SetAngularXLowLimit(-MaxAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Locks the door joint, and the door knob's joint.
|
||||||
|
/// </summary>
|
||||||
public virtual void Lock()
|
public virtual void Lock()
|
||||||
{
|
{
|
||||||
Locked = true;
|
Locked = true;
|
||||||
|
|
@ -309,6 +347,9 @@ namespace HurricaneVR.Framework.Components
|
||||||
LockDoorKnob();
|
LockDoorKnob();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unlocks the door and allows the door handle to rotate.
|
||||||
|
/// </summary>
|
||||||
public virtual void Unlock()
|
public virtual void Unlock()
|
||||||
{
|
{
|
||||||
Locked = false;
|
Locked = false;
|
||||||
|
|
@ -323,18 +364,14 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
protected virtual void LockDoorKnob()
|
protected virtual void LockDoorKnob()
|
||||||
{
|
{
|
||||||
if (DoorKnob)
|
if (DoorKnob) DoorKnob.SetLimits(0, 0);
|
||||||
{
|
if (SecondDoorKnob) SecondDoorKnob.SetLimits(0, 0);
|
||||||
DoorKnob.SetLimits(0, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void UnlockDoorKnob()
|
protected virtual void UnlockDoorKnob()
|
||||||
{
|
{
|
||||||
if (DoorKnob)
|
if (DoorKnob) DoorKnob.ResetLimits();
|
||||||
{
|
if (SecondDoorKnob) SecondDoorKnob.ResetLimits();
|
||||||
DoorKnob.ResetLimits();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IEnumerator DoorCloseRoutine()
|
protected IEnumerator DoorCloseRoutine()
|
||||||
|
|
@ -353,7 +390,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
_doorClosing = false;
|
_doorClosing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetupJoint()
|
protected virtual void SetupJoint()
|
||||||
{
|
{
|
||||||
var currentRotation = transform.localRotation;
|
var currentRotation = transform.localRotation;
|
||||||
//transform.localRotation = JointStartRotation;
|
//transform.localRotation = JointStartRotation;
|
||||||
|
|
@ -362,7 +399,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
Joint.LockLinearMotion();
|
Joint.LockLinearMotion();
|
||||||
Joint.LockAngularYMotion();
|
Joint.LockAngularYMotion();
|
||||||
Joint.LockAngularZMotion();
|
Joint.LockAngularZMotion();
|
||||||
|
Joint.anchor = Vector3.zero;
|
||||||
Joint.axis = Axis.GetVector();
|
Joint.axis = Axis.GetVector();
|
||||||
|
|
||||||
if (LimitRotation)
|
if (LimitRotation)
|
||||||
|
|
|
||||||
|
|
@ -6,16 +6,28 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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))]
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
public class HVRPhysicsDrawer : MonoBehaviour
|
public class HVRPhysicsDrawer : MonoBehaviour
|
||||||
{
|
{
|
||||||
[Header("Settings")]
|
[Header("Settings")]
|
||||||
|
[Tooltip("Axis the drawer will travel on in local space.")]
|
||||||
public HVRAxis Axis;
|
public HVRAxis Axis;
|
||||||
|
|
||||||
|
[Tooltip("Rigidbody to joint to.")]
|
||||||
public Rigidbody ConnectedBody;
|
public Rigidbody ConnectedBody;
|
||||||
|
|
||||||
|
[Tooltip("Optional spring that will return to the starting position")]
|
||||||
public float Spring = 0;
|
public float Spring = 0;
|
||||||
|
|
||||||
|
[Tooltip("Damper to provide 'friction' to the drawer.")]
|
||||||
public float Damper = 10;
|
public float Damper = 10;
|
||||||
|
|
||||||
[Header("SFX")] public float SFXResetThreshold = .02f;
|
[Header("SFX")]
|
||||||
|
public float SFXResetThreshold = .02f;
|
||||||
public AudioClip SFXOpened;
|
public AudioClip SFXOpened;
|
||||||
public AudioClip SFXClosed;
|
public AudioClip SFXClosed;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,23 +7,14 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Lever behaves similar to the dial in rigidbody joint behaviour at this time...
|
||||||
|
/// </summary>
|
||||||
[RequireComponent(typeof(Rigidbody))]
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
public class HVRPhysicsLever : HVRPhysicsDial
|
public class HVRPhysicsLever : HVRPhysicsDial
|
||||||
{
|
{
|
||||||
public bool DrawGizmos = true;
|
public bool DrawGizmos = true;
|
||||||
public ConfigurableJoint preJoint;
|
|
||||||
|
|
||||||
protected override void SetupJoint()
|
|
||||||
{
|
|
||||||
if(!preJoint)
|
|
||||||
{
|
|
||||||
base.SetupJoint();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Joint = preJoint;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnDrawGizmosSelected()
|
public void OnDrawGizmosSelected()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Helper component to override various rigidbody properties
|
||||||
|
/// </summary>
|
||||||
[RequireComponent(typeof(Rigidbody))]
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
public class HVRRigidBodyOverrides : MonoBehaviour
|
public class HVRRigidBodyOverrides : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
@ -22,7 +25,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
[Header("Debug")]
|
[Header("Debug")]
|
||||||
public Vector3 COMGizmoSize = new Vector3(.02f, .02f, .02f);
|
public Vector3 COMGizmoSize = new Vector3(.02f, .02f, .02f);
|
||||||
public bool LiveUpdate;
|
public bool LiveUpdate;
|
||||||
|
public bool ShowCOMGizmo;
|
||||||
public Rigidbody Rigidbody;
|
public Rigidbody Rigidbody;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
|
|
@ -75,7 +78,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
void OnDrawGizmosSelected()
|
void OnDrawGizmosSelected()
|
||||||
{
|
{
|
||||||
//if (OverrideCOM)
|
if (ShowCOMGizmo)
|
||||||
{
|
{
|
||||||
Gizmos.color = Color.yellow;
|
Gizmos.color = Color.yellow;
|
||||||
if (OverrideCOM)
|
if (OverrideCOM)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Helps constrain loose joints on the desired axis.
|
||||||
|
/// </summary>
|
||||||
public class HVRRigidbodyLocker : MonoBehaviour
|
public class HVRRigidbodyLocker : MonoBehaviour
|
||||||
{
|
{
|
||||||
public LockOptions Locks;
|
public LockOptions Locks;
|
||||||
|
|
|
||||||
|
|
@ -10,17 +10,22 @@ namespace HurricaneVR.Framework.Components
|
||||||
public Transform Camera;
|
public Transform Camera;
|
||||||
|
|
||||||
[Header("Settings")]
|
[Header("Settings")]
|
||||||
|
|
||||||
[Tooltip("Ring must be within this distance from the camera to be displayed")]
|
[Tooltip("Ring must be within this distance from the camera to be displayed")]
|
||||||
public float Distance = 5f;
|
public float Distance = 5f;
|
||||||
|
|
||||||
|
|
||||||
[Header("Line of Sight Settings")]
|
[Header("Line of Sight Settings")]
|
||||||
|
|
||||||
[Tooltip("Use ray cast to the camera collider to determine if we should show")]
|
[Tooltip("Use ray cast to the camera collider to determine if we should show")]
|
||||||
public bool RequireLineOfSight = true;
|
public bool RequireLineOfSight = true;
|
||||||
|
|
||||||
[Tooltip("Layer mask for checking line of sight, include the layer of the camera(default is Player)")]
|
[Tooltip("Layer mask for checking line of sight, include the layer of the camera(default is Player)")]
|
||||||
public LayerMask LayerMask;
|
public LayerMask LayerMask;
|
||||||
|
|
||||||
[Tooltip("Check line of sight only if distance greater than this")]
|
[Tooltip("Check line of sight only if distance greater than this")]
|
||||||
public float LineOfSightThreshold = 1.5f;
|
public float LineOfSightThreshold = 1.5f;
|
||||||
|
|
||||||
[Tooltip("Timeout to check line of sight")]
|
[Tooltip("Timeout to check line of sight")]
|
||||||
public float Delay = 1f;
|
public float Delay = 1f;
|
||||||
|
|
||||||
|
|
@ -30,7 +35,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
protected override void Start()
|
protected override void Start()
|
||||||
{
|
{
|
||||||
if (!Camera)
|
if (!Camera && HVRManager.Instance)
|
||||||
{
|
{
|
||||||
Camera = HVRManager.Instance.Camera;
|
Camera = HVRManager.Instance.Camera;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,26 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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(Rigidbody))]
|
||||||
[RequireComponent(typeof(HVRRotationTracker))]
|
[RequireComponent(typeof(HVRRotationTracker))]
|
||||||
public class HVRRotationLimiter : MonoBehaviour
|
public class HVRRotationLimiter : MonoBehaviour
|
||||||
{
|
{
|
||||||
public const float PhysxMaxLimit = 177f;
|
public const float PhysxMaxLimit = 177f;
|
||||||
|
|
||||||
|
[Tooltip("Connected Body of the Joint")]
|
||||||
public Rigidbody ConnectedBody;
|
public Rigidbody ConnectedBody;
|
||||||
|
|
||||||
|
[Tooltip("Minimum angle of rotation")]
|
||||||
public int MinAngle;
|
public int MinAngle;
|
||||||
|
|
||||||
|
[Tooltip("Maximum angle of rotation")]
|
||||||
public int MaxAngle;
|
public int MaxAngle;
|
||||||
|
|
||||||
|
[Tooltip("Distance traveled before the joint is recreated with new limits")]
|
||||||
public float JointResetThreshold = 90f;
|
public float JointResetThreshold = 90f;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,18 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
namespace HurricaneVR.Framework.Components
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Used in conjunction with the HVRRotationTracker to play SFX based on rotation amount.
|
||||||
|
/// </summary>
|
||||||
public class HVRRotationSFX : MonoBehaviour
|
public class HVRRotationSFX : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
[Tooltip("Tracker required to know how far something has rotated")]
|
||||||
public HVRRotationTracker Tracker;
|
public HVRRotationTracker Tracker;
|
||||||
|
|
||||||
|
[Tooltip("Clip chosen at random from this list when rotated beyond 'AngleThreshold'")]
|
||||||
public AudioClip[] SFX;
|
public AudioClip[] SFX;
|
||||||
|
|
||||||
|
[Tooltip("Rotation distance must exceed this to play another sfx clip")]
|
||||||
public float AngleThreshold = 30f;
|
public float AngleThreshold = 30f;
|
||||||
|
|
||||||
[Header("Debug")]
|
[Header("Debug")]
|
||||||
|
|
@ -41,11 +48,6 @@ namespace HurricaneVR.Framework.Components
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void PlaySFX(AudioClip sfx)
|
protected virtual void PlaySFX(AudioClip sfx)
|
||||||
{
|
{
|
||||||
if(SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(sfx, transform.position);
|
if(SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(sfx, transform.position);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@ using UnityEngine.Events;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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
|
public class HVRRotationTracker : MonoBehaviour
|
||||||
{
|
{
|
||||||
[Tooltip("Local axis of rotation")]
|
[Tooltip("Local axis of rotation")]
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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 class HVRScaleHighlight : HVRGrabbableHoverBase
|
||||||
{
|
{
|
||||||
public Vector3 HoverScale = new Vector3(1.3f, 1.3f, 1.3f);
|
public Vector3 HoverScale = new Vector3(1.3f, 1.3f, 1.3f);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Components
|
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 class HVRThrowingCenterOfMass : MonoBehaviour
|
||||||
{
|
{
|
||||||
public HVRHandSide HandSide;
|
public HVRHandSide HandSide;
|
||||||
|
|
@ -36,6 +39,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
|
|
||||||
switch (controller.ControllerType)
|
switch (controller.ControllerType)
|
||||||
{
|
{
|
||||||
|
case HVRControllerType.Pico:
|
||||||
case HVRControllerType.Oculus:
|
case HVRControllerType.Oculus:
|
||||||
CenterOfMass = Oculus;
|
CenterOfMass = Oculus;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ namespace HurricaneVR.Framework.Components
|
||||||
Grabbable = GetComponent<HVRGrabbable>();
|
Grabbable = GetComponent<HVRGrabbable>();
|
||||||
|
|
||||||
Grabbable.HandGrabbed.AddListener(OnHandGrabbed);
|
Grabbable.HandGrabbed.AddListener(OnHandGrabbed);
|
||||||
|
Grabbable.HandReleased.AddListener(OnHandReleased);
|
||||||
|
|
||||||
if (Others != null)
|
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)
|
private void OnHandGrabbed(HVRHandGrabber arg0, HVRGrabbable arg1)
|
||||||
{
|
{
|
||||||
foreach (var other in Others)
|
foreach (var other in Others)
|
||||||
|
|
@ -45,9 +51,22 @@ namespace HurricaneVR.Framework.Components
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnOtherGrabbableHandReleased(HVRHandGrabber arg0, HVRGrabbable arg1)
|
private void OnOtherGrabbableHandReleased(HVRHandGrabber arg0, HVRGrabbable g)
|
||||||
{
|
{
|
||||||
Grabbable.ForceTwoHandSettings = false;
|
//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;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnOtherGrabbableHandGrabbed(HVRHandGrabber arg0, HVRGrabbable arg1)
|
private void OnOtherGrabbableHandGrabbed(HVRHandGrabber arg0, HVRGrabbable arg1)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,9 @@ using Valve.VR;
|
||||||
namespace HurricaneVR.Framework.ControllerInput
|
namespace HurricaneVR.Framework.ControllerInput
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class HVRControllerEvent : UnityEvent<HVRController> { }
|
public class HVRControllerEvent : UnityEvent<HVRController>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public class HVRInputManager : MonoBehaviour
|
public class HVRInputManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
@ -50,15 +52,16 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
public const string Reverb = "reverb";
|
public const string Reverb = "reverb";
|
||||||
public const string G2 = "g2";
|
public const string G2 = "g2";
|
||||||
public const string OpenXR_G2 = "hp reverb g2 controller";
|
public const string OpenXR_G2 = "hp reverb g2 controller";
|
||||||
|
public const string Pico = "pico";
|
||||||
|
|
||||||
public const string LegacyOpenVRName = "OpenVR";
|
public const string LegacyOpenVRName = "OpenVR";
|
||||||
public const string LegacyOculusName = "Oculus";
|
public const string LegacyOculusName = "Oculus";
|
||||||
public const string LegacyNone = "None";
|
public const string LegacyNone = "None";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[Header("XR Plugin Detection Names")]
|
[Header("XR Plugin Detection Names")]
|
||||||
public string OpenVRLoader = "Open VR Loader";
|
public string OpenVRLoader = "Open VR Loader";
|
||||||
|
|
||||||
public string OculusLoader = "Oculus Loader";
|
public string OculusLoader = "Oculus Loader";
|
||||||
public string OpenXRLoader = "Open XR Loader";
|
public string OpenXRLoader = "Open XR Loader";
|
||||||
public string WMRLoader = "Windows MR Loader";
|
public string WMRLoader = "Windows MR Loader";
|
||||||
|
|
@ -70,9 +73,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
public static HVRInputManager Instance { get; private set; }
|
public static HVRInputManager Instance { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[Header("Oculus - Requires Oculus Asset + Integration")]
|
[Header("Oculus - Requires Oculus Asset + Integration")]
|
||||||
|
|
||||||
[Tooltip("If true ovrinputs will be used")]
|
[Tooltip("If true ovrinputs will be used")]
|
||||||
public bool UseOVRInputs;
|
public bool UseOVRInputs;
|
||||||
|
|
||||||
|
|
@ -84,10 +85,10 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
|
|
||||||
[Header("SteamVR - Requires SteamVR + Integration")]
|
[Header("SteamVR - Requires SteamVR + Integration")]
|
||||||
public bool InitializeSteamVR = true;
|
public bool InitializeSteamVR = true;
|
||||||
|
|
||||||
public bool InitializeSteamVRActions = true;
|
public bool InitializeSteamVRActions = true;
|
||||||
|
|
||||||
[Header("Input Settings")]
|
[Header("Input Settings")]
|
||||||
|
|
||||||
[Tooltip("If true uses the new input system bindings")]
|
[Tooltip("If true uses the new input system bindings")]
|
||||||
public bool UseNewInputSystem;
|
public bool UseNewInputSystem;
|
||||||
|
|
||||||
|
|
@ -105,8 +106,10 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
|
|
||||||
[Header("Device Specific Settings")]
|
[Header("Device Specific Settings")]
|
||||||
public HVRInputSettings WMRInputMap;
|
public HVRInputSettings WMRInputMap;
|
||||||
|
|
||||||
[FormerlySerializedAs("WMRWithButtonsInputMap")]
|
[FormerlySerializedAs("WMRWithButtonsInputMap")]
|
||||||
public HVRInputSettings ReverbG2InputMap;
|
public HVRInputSettings ReverbG2InputMap;
|
||||||
|
|
||||||
public HVRInputSettings OculusInputMap;
|
public HVRInputSettings OculusInputMap;
|
||||||
public HVRInputSettings ViveInputMap;
|
public HVRInputSettings ViveInputMap;
|
||||||
public HVRInputSettings KnucklesInputMap;
|
public HVRInputSettings KnucklesInputMap;
|
||||||
|
|
@ -178,8 +181,11 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
public string RightManufacturer;
|
public string RightManufacturer;
|
||||||
public string RightControllerName;
|
public string RightControllerName;
|
||||||
|
|
||||||
[SerializeField] private HVRControllerType LeftXRInputSystem = HVRControllerType.None;
|
[SerializeField]
|
||||||
[SerializeField] private HVRControllerType RightControllerType = HVRControllerType.None;
|
private HVRControllerType LeftControllerType = HVRControllerType.None;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private HVRControllerType RightControllerType = HVRControllerType.None;
|
||||||
|
|
||||||
public List<string> LeftFeatures = new List<string>();
|
public List<string> LeftFeatures = new List<string>();
|
||||||
public List<string> RightFeatures = new List<string>();
|
public List<string> RightFeatures = new List<string>();
|
||||||
|
|
@ -243,7 +249,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!HMDActive)
|
if (!HMDActive)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -258,8 +263,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif !UNITY_2020_1_OR_NEWER
|
#elif !UNITY_2020_1_OR_NEWER
|
||||||
|
|
||||||
|
|
||||||
//https://stackoverflow.com/questions/51372771/how-to-check-if-a-hmd-in-unity-2018-is-in-use
|
//https://stackoverflow.com/questions/51372771/how-to-check-if-a-hmd-in-unity-2018-is-in-use
|
||||||
#pragma warning disable 0618
|
#pragma warning disable 0618
|
||||||
//if xr management wasn't detected use the old API for legacy VR
|
//if xr management wasn't detected use the old API for legacy VR
|
||||||
|
|
@ -287,6 +290,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
}
|
}
|
||||||
|
|
||||||
private InputDevice _leftDevice;
|
private InputDevice _leftDevice;
|
||||||
|
|
||||||
public InputDevice LeftDevice
|
public InputDevice LeftDevice
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -299,6 +303,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
}
|
}
|
||||||
|
|
||||||
private InputDevice _rightDevice;
|
private InputDevice _rightDevice;
|
||||||
|
|
||||||
public InputDevice RightDevice
|
public InputDevice RightDevice
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -311,8 +316,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private bool _isHMDFirstActivationReported;
|
private bool _isHMDFirstActivationReported;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -392,7 +395,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
|
|
||||||
#if HVR_OCULUS
|
#if HVR_OCULUS
|
||||||
|
|
||||||
if (UseOVRInputs && ForceOVRInputUpdate && (LeftXRInputSystem == HVRControllerType.Oculus || RightControllerType == HVRControllerType.Oculus))
|
if (UseOVRInputs && ForceOVRInputUpdate && (LeftControllerType == HVRControllerType.Oculus || RightControllerType == HVRControllerType.Oculus))
|
||||||
{
|
{
|
||||||
HVROculusController.UpdateOVRInput();
|
HVROculusController.UpdateOVRInput();
|
||||||
}
|
}
|
||||||
|
|
@ -552,7 +555,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
RightController = UpdateController(RightControllerType, device, HVRHandSide.Right);
|
RightController = UpdateController(RightControllerType, device, HVRHandSide.Right);
|
||||||
if (device.isValid)
|
if (device.isValid)
|
||||||
RightControllerConnected.Invoke(RightController);
|
RightControllerConnected.Invoke(RightController);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateLeftController(InputDevice device)
|
private void UpdateLeftController(InputDevice device)
|
||||||
|
|
@ -574,8 +576,8 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LeftXRInputSystem = GetController(LeftDevice.manufacturer?.ToLower(), LeftDevice.name?.ToLower());
|
LeftControllerType = GetController(LeftDevice.manufacturer?.ToLower(), LeftDevice.name?.ToLower());
|
||||||
LeftController = UpdateController(LeftXRInputSystem, device, HVRHandSide.Left);
|
LeftController = UpdateController(LeftControllerType, device, HVRHandSide.Left);
|
||||||
if (device.isValid)
|
if (device.isValid)
|
||||||
LeftControllerConnected.Invoke(LeftController);
|
LeftControllerConnected.Invoke(LeftController);
|
||||||
}
|
}
|
||||||
|
|
@ -613,6 +615,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
inputMap = WMRInputMap;
|
inputMap = WMRInputMap;
|
||||||
deadZone = WMRDeadzone;
|
deadZone = WMRDeadzone;
|
||||||
break;
|
break;
|
||||||
|
case HVRControllerType.Pico:
|
||||||
case HVRControllerType.Oculus:
|
case HVRControllerType.Oculus:
|
||||||
inputMap = OculusInputMap;
|
inputMap = OculusInputMap;
|
||||||
deadZone = OculusDeadzone;
|
deadZone = OculusDeadzone;
|
||||||
|
|
@ -801,7 +804,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (manufaturerToLower.Contains(Oculus))
|
if (manufaturerToLower.Contains(Oculus))
|
||||||
{
|
{
|
||||||
return HVRControllerType.Oculus;
|
return HVRControllerType.Oculus;
|
||||||
|
|
@ -832,6 +834,8 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
return HVRControllerType.WMR;
|
return HVRControllerType.WMR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nameToLower.Contains(Pico))
|
||||||
|
return HVRControllerType.Pico;
|
||||||
return HVRControllerType.None;
|
return HVRControllerType.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -896,6 +900,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
{
|
{
|
||||||
Debug.LogWarning($"HVR: {OpenVRLoader} active without SteamVR installed or HVR_STEAMVR define set.");
|
Debug.LogWarning($"HVR: {OpenVRLoader} active without SteamVR installed or HVR_STEAMVR define set.");
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentSDK = InputSDK.SteamVR;
|
CurrentSDK = InputSDK.SteamVR;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -906,7 +911,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
}
|
}
|
||||||
|
|
||||||
//legacy vr
|
//legacy vr
|
||||||
if (LeftXRInputSystem == HVRControllerType.Oculus || RightControllerType == HVRControllerType.Oculus)
|
if (LeftControllerType == HVRControllerType.Oculus || RightControllerType == HVRControllerType.Oculus)
|
||||||
{
|
{
|
||||||
CurrentSDK = UseOVRInputs ? InputSDK.Oculus : InputSDK.XRInput;
|
CurrentSDK = UseOVRInputs ? InputSDK.Oculus : InputSDK.XRInput;
|
||||||
return;
|
return;
|
||||||
|
|
@ -926,7 +931,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
#if !OPENVR_DESKTOP && !OPENVR_XR
|
#if !OPENVR_DESKTOP && !OPENVR_XR
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if OPENVR_DESKTOP
|
#if OPENVR_DESKTOP
|
||||||
|
|
||||||
if (!Valve.VR.SteamVR.usingNativeSupport)
|
if (!Valve.VR.SteamVR.usingNativeSupport)
|
||||||
|
|
@ -977,13 +981,12 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
#else
|
#else
|
||||||
loaders = string.Join(",", XRGeneralSettings.Instance.Manager.loaders.Select(e => e.name));
|
loaders = string.Join(",", XRGeneralSettings.Instance.Manager.loaders.Select(e => e.name));
|
||||||
#endif
|
#endif
|
||||||
Debug.Log($"{ XRGeneralSettings.Instance.Manager.automaticLoading}");
|
Debug.Log($"{XRGeneralSettings.Instance.Manager.automaticLoading}");
|
||||||
Debug.Log($"XRGeneralSettings.Instance.Manager.isInitializationComplete { XRGeneralSettings.Instance.Manager.isInitializationComplete}");
|
Debug.Log($"XRGeneralSettings.Instance.Manager.isInitializationComplete {XRGeneralSettings.Instance.Manager.isInitializationComplete}");
|
||||||
Debug.Log($"XRPlugin Detected | XRSettings.enabled {XRSettings.enabled} | Loader : {XRPluginLoader} | Loaders Enabled: {loaders}");
|
Debug.Log($"XRPlugin Detected | XRSettings.enabled {XRSettings.enabled} | Loader : {XRPluginLoader} | Loaders Enabled: {loaders}");
|
||||||
|
|
||||||
XRPluginActive = XRSettings.enabled && XRGeneralSettings.Instance.Manager.isInitializationComplete;
|
XRPluginActive = XRSettings.enabled && XRGeneralSettings.Instance.Manager.isInitializationComplete;
|
||||||
#elif !UNITY_2020_1_OR_NEWER
|
#elif !UNITY_2020_1_OR_NEWER
|
||||||
|
|
||||||
var legacyDevices = "";
|
var legacyDevices = "";
|
||||||
foreach (var t in XRSettings.supportedDevices)
|
foreach (var t in XRSettings.supportedDevices)
|
||||||
{
|
{
|
||||||
|
|
@ -1025,7 +1028,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void StopXR()
|
public void StopXR()
|
||||||
{
|
{
|
||||||
#if USING_XR_MANAGEMENT
|
#if USING_XR_MANAGEMENT
|
||||||
|
|
@ -1059,10 +1061,8 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
Debug.LogWarning($"XR Plugin Management is in use. Cannot load Legacy VR");
|
Debug.LogWarning($"XR Plugin Management is in use. Cannot load Legacy VR");
|
||||||
return;
|
return;
|
||||||
#elif !UNITY_2020_1_OR_NEWER
|
#elif !UNITY_2020_1_OR_NEWER
|
||||||
|
|
||||||
StartCoroutine(LoadLegacy(callback));
|
StartCoroutine(LoadLegacy(callback));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1101,6 +1101,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
{
|
{
|
||||||
callback(false);
|
callback(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
LegacyActive = false;
|
LegacyActive = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1152,7 +1153,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
|
|
||||||
IsSteamVR = true;
|
IsSteamVR = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StopSteamVR()
|
private void StopSteamVR()
|
||||||
|
|
@ -1198,8 +1198,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif !UNITY_2020_1_OR_NEWER
|
#elif !UNITY_2020_1_OR_NEWER
|
||||||
|
|
||||||
|
|
||||||
if (originFlags == TrackingOriginModeFlags.Floor)
|
if (originFlags == TrackingOriginModeFlags.Floor)
|
||||||
{
|
{
|
||||||
#pragma warning disable 0618
|
#pragma warning disable 0618
|
||||||
|
|
@ -1220,7 +1218,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1229,5 +1226,4 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
Legacy,
|
Legacy,
|
||||||
XRPlugin
|
XRPlugin
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -16,6 +16,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
{
|
{
|
||||||
[Header("Grab Settings")]
|
[Header("Grab Settings")]
|
||||||
public bool CanDistanceGrab = true;
|
public bool CanDistanceGrab = true;
|
||||||
|
|
||||||
public bool CanTriggerGrab;
|
public bool CanTriggerGrab;
|
||||||
|
|
||||||
[Tooltip("For non flick style force grabber")]
|
[Tooltip("For non flick style force grabber")]
|
||||||
|
|
@ -26,6 +27,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
|
|
||||||
[Header("Inputs Debugging")]
|
[Header("Inputs Debugging")]
|
||||||
public Vector2 MovementAxis;
|
public Vector2 MovementAxis;
|
||||||
|
|
||||||
public Vector2 TurnAxis;
|
public Vector2 TurnAxis;
|
||||||
|
|
||||||
public bool IsTeleportActivated;
|
public bool IsTeleportActivated;
|
||||||
|
|
@ -88,6 +90,15 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
AfterInputUpdate();
|
AfterInputUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void OnEnable()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnDisable()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected virtual void UpdateInput()
|
protected virtual void UpdateInput()
|
||||||
{
|
{
|
||||||
if (!UpdateInputs)
|
if (!UpdateInputs)
|
||||||
|
|
@ -130,11 +141,9 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
|
|
||||||
protected virtual void AfterInputUpdate()
|
protected virtual void AfterInputUpdate()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void ResetState(ref HVRButtonState buttonState)
|
protected void ResetState(ref HVRButtonState buttonState)
|
||||||
{
|
{
|
||||||
buttonState.JustDeactivated = false;
|
buttonState.JustDeactivated = false;
|
||||||
|
|
@ -172,7 +181,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
{
|
{
|
||||||
if (RightController.ControllerType == HVRControllerType.Vive)
|
if (RightController.ControllerType == HVRControllerType.Vive)
|
||||||
{
|
{
|
||||||
return false;//todo
|
return false; //todo
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -180,10 +189,11 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
|
|
||||||
protected virtual void GetForceGrabActivated(out bool left, out bool right)
|
protected virtual void GetForceGrabActivated(out bool left, out bool right)
|
||||||
{
|
{
|
||||||
|
left = false;
|
||||||
|
right = false;
|
||||||
|
|
||||||
if (!CanDistanceGrab)
|
if (!CanDistanceGrab)
|
||||||
{
|
{
|
||||||
left = false;
|
|
||||||
right = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -192,24 +202,52 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
left = LeftController.GripButtonState.JustActivated;
|
left = LeftController.GripButtonState.JustActivated;
|
||||||
right = RightController.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;
|
left = LeftController.GripButtonState.Active && LeftTriggerGrabState.JustActivated || LeftTriggerGrabState.Active && LeftController.GripButtonState.JustActivated;
|
||||||
right = RightController.GripButtonState.Active && RightController.TriggerButtonState.JustActivated || RightController.TriggerButtonState.Active && RightController.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)
|
protected virtual void GetForceGrabActive(out bool left, out bool right)
|
||||||
{
|
{
|
||||||
|
left = false;
|
||||||
|
right = false;
|
||||||
|
|
||||||
if (!CanDistanceGrab)
|
if (!CanDistanceGrab)
|
||||||
{
|
{
|
||||||
left = false;
|
|
||||||
right = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
left = LeftController.GripButtonState.Active;
|
if (ForceGrabActivation == HVRForceGrabActivation.Grip)
|
||||||
right = RightController.GripButtonState.Active;
|
{
|
||||||
|
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)
|
public bool GetForceGrabActivated(HVRHandSide side)
|
||||||
|
|
@ -237,11 +275,6 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
return side == HVRHandSide.Left ? IsLeftGrabActivated : IsRightGrabActivated;
|
return side == HVRHandSide.Left ? IsLeftGrabActivated : IsRightGrabActivated;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetHoldActive(HVRHandSide side)
|
|
||||||
{
|
|
||||||
return side == HVRHandSide.Left ? IsLeftHoldActive : IsRightHoldActive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool GetGripHoldActive(HVRHandSide side)
|
public bool GetGripHoldActive(HVRHandSide side)
|
||||||
{
|
{
|
||||||
return side == HVRHandSide.Left ? IsLeftGripHoldActive : IsRightGripHoldActive;
|
return side == HVRHandSide.Left ? IsLeftGripHoldActive : IsRightGripHoldActive;
|
||||||
|
|
@ -266,6 +299,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return LeftController.GripButtonState.Active;
|
return LeftController.GripButtonState.Active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -283,6 +317,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return RightController.GripButtonState.Active;
|
return RightController.GripButtonState.Active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -358,6 +393,7 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
{
|
{
|
||||||
return LeftController.TrackpadAxis;
|
return LeftController.TrackpadAxis;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Vector2.zero;
|
return Vector2.zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -371,9 +407,9 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
|
|
||||||
if (RightController.TrackpadButtonState.Active)
|
if (RightController.TrackpadButtonState.Active)
|
||||||
{
|
{
|
||||||
|
|
||||||
return RightController.TrackpadAxis;
|
return RightController.TrackpadAxis;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Vector2.zero;
|
return Vector2.zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -458,6 +494,8 @@ namespace HurricaneVR.Framework.ControllerInput
|
||||||
public enum HVRForceGrabActivation
|
public enum HVRForceGrabActivation
|
||||||
{
|
{
|
||||||
Grip,
|
Grip,
|
||||||
GripHoldTriggerPress
|
GripAndTrigger,
|
||||||
|
Trigger,
|
||||||
|
GripOrTrigger
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
// 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
|
// from Assets/HurricaneVR/Framework/Scripts/ControllerInput/InputSystem/HVRInputActions.inputactions
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// 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;
|
||||||
using UnityEngine.InputSystem.Utilities;
|
using UnityEngine.InputSystem.Utilities;
|
||||||
|
|
||||||
public partial class @HVRInputActions : IInputActionCollection2, IDisposable
|
public partial class @HVRInputActions: IInputActionCollection2, IDisposable
|
||||||
{
|
{
|
||||||
public InputActionAsset asset { get; }
|
public InputActionAsset asset { get; }
|
||||||
public @HVRInputActions()
|
public @HVRInputActions()
|
||||||
|
|
@ -275,6 +275,28 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
|
||||||
""isComposite"": false,
|
""isComposite"": false,
|
||||||
""isPartOfComposite"": 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"": """",
|
""name"": """",
|
||||||
""id"": ""54ac7ab0-8ca9-4cbc-a6d1-da5ee0b055cb"",
|
""id"": ""54ac7ab0-8ca9-4cbc-a6d1-da5ee0b055cb"",
|
||||||
|
|
@ -738,6 +760,17 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
|
||||||
""isComposite"": false,
|
""isComposite"": false,
|
||||||
""isPartOfComposite"": false
|
""isPartOfComposite"": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
""name"": """",
|
||||||
|
""id"": ""0c608bc0-1dda-4d95-8e76-add87e298bcc"",
|
||||||
|
""path"": ""<WMRSpatialController>{LeftHand}/menu"",
|
||||||
|
""interactions"": """",
|
||||||
|
""processors"": """",
|
||||||
|
""groups"": """",
|
||||||
|
""action"": ""Menu"",
|
||||||
|
""isComposite"": false,
|
||||||
|
""isPartOfComposite"": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
""name"": """",
|
""name"": """",
|
||||||
""id"": ""488857b2-965c-486c-b24e-e21628ad2a07"",
|
""id"": ""488857b2-965c-486c-b24e-e21628ad2a07"",
|
||||||
|
|
@ -1167,12 +1200,14 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
|
||||||
{
|
{
|
||||||
asset.Disable();
|
asset.Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<InputBinding> bindings => asset.bindings;
|
public IEnumerable<InputBinding> bindings => asset.bindings;
|
||||||
|
|
||||||
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
|
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
|
||||||
{
|
{
|
||||||
return asset.FindAction(actionNameOrId, throwIfNotFound);
|
return asset.FindAction(actionNameOrId, throwIfNotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int FindBinding(InputBinding bindingMask, out InputAction action)
|
public int FindBinding(InputBinding bindingMask, out InputAction action)
|
||||||
{
|
{
|
||||||
return asset.FindBinding(bindingMask, out action);
|
return asset.FindBinding(bindingMask, out action);
|
||||||
|
|
@ -1180,7 +1215,7 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
|
||||||
|
|
||||||
// LeftHand
|
// LeftHand
|
||||||
private readonly InputActionMap m_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_TriggerPress;
|
||||||
private readonly InputAction m_LeftHand_Trigger;
|
private readonly InputAction m_LeftHand_Trigger;
|
||||||
private readonly InputAction m_LeftHand_PrimaryButton;
|
private readonly InputAction m_LeftHand_PrimaryButton;
|
||||||
|
|
@ -1230,142 +1265,155 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
|
||||||
public void Disable() { Get().Disable(); }
|
public void Disable() { Get().Disable(); }
|
||||||
public bool enabled => Get().enabled;
|
public bool enabled => Get().enabled;
|
||||||
public static implicit operator InputActionMap(LeftHandActions set) { return set.Get(); }
|
public static implicit operator InputActionMap(LeftHandActions set) { return set.Get(); }
|
||||||
|
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;
|
||||||
|
@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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
public void SetCallbacks(ILeftHandActions instance)
|
||||||
{
|
{
|
||||||
if (m_Wrapper.m_LeftHandActionsCallbackInterface != null)
|
foreach (var item in m_Wrapper.m_LeftHandActionsCallbackInterfaces)
|
||||||
{
|
UnregisterCallbacks(item);
|
||||||
@TriggerPress.started -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTriggerPress;
|
m_Wrapper.m_LeftHandActionsCallbackInterfaces.Clear();
|
||||||
@TriggerPress.performed -= m_Wrapper.m_LeftHandActionsCallbackInterface.OnTriggerPress;
|
AddCallbacks(instance);
|
||||||
@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)
|
|
||||||
{
|
|
||||||
@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 LeftHandActions @LeftHand => new LeftHandActions(this);
|
public LeftHandActions @LeftHand => new LeftHandActions(this);
|
||||||
|
|
||||||
// RightHand
|
// RightHand
|
||||||
private readonly InputActionMap m_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_TriggerPress;
|
||||||
private readonly InputAction m_RightHand_Trigger;
|
private readonly InputAction m_RightHand_Trigger;
|
||||||
private readonly InputAction m_RightHand_PrimaryButton;
|
private readonly InputAction m_RightHand_PrimaryButton;
|
||||||
|
|
@ -1415,142 +1463,155 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
|
||||||
public void Disable() { Get().Disable(); }
|
public void Disable() { Get().Disable(); }
|
||||||
public bool enabled => Get().enabled;
|
public bool enabled => Get().enabled;
|
||||||
public static implicit operator InputActionMap(RightHandActions set) { return set.Get(); }
|
public static implicit operator InputActionMap(RightHandActions set) { return set.Get(); }
|
||||||
|
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;
|
||||||
|
@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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
public void SetCallbacks(IRightHandActions instance)
|
||||||
{
|
{
|
||||||
if (m_Wrapper.m_RightHandActionsCallbackInterface != null)
|
foreach (var item in m_Wrapper.m_RightHandActionsCallbackInterfaces)
|
||||||
{
|
UnregisterCallbacks(item);
|
||||||
@TriggerPress.started -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTriggerPress;
|
m_Wrapper.m_RightHandActionsCallbackInterfaces.Clear();
|
||||||
@TriggerPress.performed -= m_Wrapper.m_RightHandActionsCallbackInterface.OnTriggerPress;
|
AddCallbacks(instance);
|
||||||
@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)
|
|
||||||
{
|
|
||||||
@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 RightHandActions @RightHand => new RightHandActions(this);
|
public RightHandActions @RightHand => new RightHandActions(this);
|
||||||
|
|
||||||
// HMD
|
// HMD
|
||||||
private readonly InputActionMap m_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_hmdPosition;
|
||||||
private readonly InputAction m_HMD_hmdRotation;
|
private readonly InputAction m_HMD_hmdRotation;
|
||||||
public struct HMDActions
|
public struct HMDActions
|
||||||
|
|
@ -1564,34 +1625,47 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
|
||||||
public void Disable() { Get().Disable(); }
|
public void Disable() { Get().Disable(); }
|
||||||
public bool enabled => Get().enabled;
|
public bool enabled => Get().enabled;
|
||||||
public static implicit operator InputActionMap(HMDActions set) { return set.Get(); }
|
public static implicit operator InputActionMap(HMDActions set) { return set.Get(); }
|
||||||
|
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;
|
||||||
|
@hmdRotation.started += instance.OnHmdRotation;
|
||||||
|
@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)
|
public void SetCallbacks(IHMDActions instance)
|
||||||
{
|
{
|
||||||
if (m_Wrapper.m_HMDActionsCallbackInterface != null)
|
foreach (var item in m_Wrapper.m_HMDActionsCallbackInterfaces)
|
||||||
{
|
UnregisterCallbacks(item);
|
||||||
@hmdPosition.started -= m_Wrapper.m_HMDActionsCallbackInterface.OnHmdPosition;
|
m_Wrapper.m_HMDActionsCallbackInterfaces.Clear();
|
||||||
@hmdPosition.performed -= m_Wrapper.m_HMDActionsCallbackInterface.OnHmdPosition;
|
AddCallbacks(instance);
|
||||||
@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)
|
|
||||||
{
|
|
||||||
@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 HMDActions @HMD => new HMDActions(this);
|
public HMDActions @HMD => new HMDActions(this);
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
private readonly InputActionMap m_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_Click;
|
||||||
private readonly InputAction m_UI_pointerPosition;
|
private readonly InputAction m_UI_pointerPosition;
|
||||||
private readonly InputAction m_UI_pointerRotation;
|
private readonly InputAction m_UI_pointerRotation;
|
||||||
|
|
@ -1607,33 +1681,46 @@ public partial class @HVRInputActions : IInputActionCollection2, IDisposable
|
||||||
public void Disable() { Get().Disable(); }
|
public void Disable() { Get().Disable(); }
|
||||||
public bool enabled => Get().enabled;
|
public bool enabled => Get().enabled;
|
||||||
public static implicit operator InputActionMap(UIActions set) { return set.Get(); }
|
public static implicit operator InputActionMap(UIActions set) { return set.Get(); }
|
||||||
|
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;
|
||||||
|
@pointerPosition.started += instance.OnPointerPosition;
|
||||||
|
@pointerPosition.performed += instance.OnPointerPosition;
|
||||||
|
@pointerPosition.canceled += instance.OnPointerPosition;
|
||||||
|
@pointerRotation.started += instance.OnPointerRotation;
|
||||||
|
@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)
|
public void SetCallbacks(IUIActions instance)
|
||||||
{
|
{
|
||||||
if (m_Wrapper.m_UIActionsCallbackInterface != null)
|
foreach (var item in m_Wrapper.m_UIActionsCallbackInterfaces)
|
||||||
{
|
UnregisterCallbacks(item);
|
||||||
@Click.started -= m_Wrapper.m_UIActionsCallbackInterface.OnClick;
|
m_Wrapper.m_UIActionsCallbackInterfaces.Clear();
|
||||||
@Click.performed -= m_Wrapper.m_UIActionsCallbackInterface.OnClick;
|
AddCallbacks(instance);
|
||||||
@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)
|
|
||||||
{
|
|
||||||
@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 UIActions @UI => new UIActions(this);
|
public UIActions @UI => new UIActions(this);
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,28 @@
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": 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": "",
|
"name": "",
|
||||||
"id": "54ac7ab0-8ca9-4cbc-a6d1-da5ee0b055cb",
|
"id": "54ac7ab0-8ca9-4cbc-a6d1-da5ee0b055cb",
|
||||||
|
|
@ -676,6 +698,17 @@
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "0c608bc0-1dda-4d95-8e76-add87e298bcc",
|
||||||
|
"path": "<WMRSpatialController>{LeftHand}/menu",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "Menu",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "",
|
"name": "",
|
||||||
"id": "488857b2-965c-486c-b24e-e21628ad2a07",
|
"id": "488857b2-965c-486c-b24e-e21628ad2a07",
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Core.Bags
|
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>
|
public class HVRSocketBag : MonoBehaviour, IComparer<HVRSocket>
|
||||||
{
|
{
|
||||||
private readonly Dictionary<HVRSocket, HashSet<Collider>> _map = new Dictionary<HVRSocket, HashSet<Collider>>();
|
private readonly Dictionary<HVRSocket, HashSet<Collider>> _map = new Dictionary<HVRSocket, HashSet<Collider>>();
|
||||||
|
|
@ -53,6 +56,9 @@ namespace HurricaneVR.Framework.Core.Bags
|
||||||
Calculate();
|
Calculate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Causes the bag to ignore the provided socket when it's trigger collider overlaps ours.
|
||||||
|
/// </summary>
|
||||||
public void IgnoreSocket(HVRSocket socket)
|
public void IgnoreSocket(HVRSocket socket)
|
||||||
{
|
{
|
||||||
if (_ignoredSockets == null)
|
if (_ignoredSockets == null)
|
||||||
|
|
@ -63,6 +69,14 @@ namespace HurricaneVR.Framework.Core.Bags
|
||||||
_ignoredSockets.Add(socket);
|
_ignoredSockets.Add(socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stops ignoring the provided socket
|
||||||
|
/// </summary>
|
||||||
|
public void UnIgnoreSocket(HVRSocket socket)
|
||||||
|
{
|
||||||
|
_ignoredSockets.Remove(socket);
|
||||||
|
}
|
||||||
|
|
||||||
protected void AddSocket(HVRSocket socket)
|
protected void AddSocket(HVRSocket socket)
|
||||||
{
|
{
|
||||||
if (AllSockets.Contains(socket))
|
if (AllSockets.Contains(socket))
|
||||||
|
|
|
||||||
|
|
@ -209,6 +209,9 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
public override bool CanGrab(HVRGrabbable grabbable)
|
public override bool CanGrab(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
|
if (!grabbable.CanHandGrab(HandGrabber))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (grabbable.IsSocketed)
|
if (grabbable.IsSocketed)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -267,6 +270,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args.Grabbable.IsBeingForcedGrabbed = true;
|
||||||
IsForceGrabbing = true;
|
IsForceGrabbing = true;
|
||||||
if (GrabStyle == HVRForceGrabMode.GravityGloves)
|
if (GrabStyle == HVRForceGrabMode.GravityGloves)
|
||||||
{
|
{
|
||||||
|
|
@ -288,6 +292,13 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
OnGrabbedHaptics();
|
OnGrabbedHaptics();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnReleased(HVRGrabbable grabbable)
|
||||||
|
{
|
||||||
|
base.OnReleased(grabbable);
|
||||||
|
|
||||||
|
grabbable.IsBeingForcedGrabbed = false;
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnHoverEnter(HVRGrabbable grabbable)
|
protected override void OnHoverEnter(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
base.OnHoverEnter(grabbable);
|
base.OnHoverEnter(grabbable);
|
||||||
|
|
@ -366,7 +377,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
rb.angularDrag = 0f;
|
rb.angularDrag = 0f;
|
||||||
rb.drag = 0f;
|
rb.drag = 0f;
|
||||||
|
|
||||||
grabbable.IsBeingForcedGrabbed = true;
|
|
||||||
IsHoldActive = true;
|
IsHoldActive = true;
|
||||||
|
|
||||||
var grabPoint = grabbable.GetGrabPointTransform(HandGrabber, GrabpointFilter.ForceGrab);
|
var grabPoint = grabbable.GetGrabPointTransform(HandGrabber, GrabpointFilter.ForceGrab);
|
||||||
|
|
@ -434,7 +444,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
var delta = JointAnchorWorldPosition - grabbableAnchor;
|
var delta = JointAnchorWorldPosition - grabbableAnchor;
|
||||||
distance = delta.magnitude;
|
distance = delta.magnitude;
|
||||||
|
|
||||||
if (isPhysicsGrab && distance < DynamicGrabThreshold && HandGrabber.TryAutoGrab(grabbable, posableGrabPoint))
|
if (isPhysicsGrab && distance < DynamicGrabThreshold && HandGrabber.TryTransferDistanceGrab(grabbable, posableGrabPoint))
|
||||||
{
|
{
|
||||||
rb.angularVelocity = Vector3.zero;
|
rb.angularVelocity = Vector3.zero;
|
||||||
rb.velocity = Vector3.zero;
|
rb.velocity = Vector3.zero;
|
||||||
|
|
@ -514,11 +524,12 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
rb.angularVelocity = Vector3.ClampMagnitude(rb.angularVelocity, settings.MaxMissAngularSpeed);
|
rb.angularVelocity = Vector3.ClampMagnitude(rb.angularVelocity, settings.MaxMissAngularSpeed);
|
||||||
rb.centerOfMass = com;
|
rb.centerOfMass = com;
|
||||||
|
|
||||||
|
|
||||||
if (IsGrabbing)
|
if (IsGrabbing)
|
||||||
{
|
{
|
||||||
if (distance < limit)
|
if (distance < limit)
|
||||||
{
|
{
|
||||||
if (HandGrabber.TryAutoGrab(grabbable, posableGrabPoint))
|
if (HandGrabber.TryTransferDistanceGrab(grabbable, posableGrabPoint))
|
||||||
{
|
{
|
||||||
rb.angularVelocity = Vector3.zero;
|
rb.angularVelocity = Vector3.zero;
|
||||||
rb.velocity = Vector3.zero;
|
rb.velocity = Vector3.zero;
|
||||||
|
|
@ -529,9 +540,14 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
ForceRelease();
|
ForceRelease();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
grabbable.IsBeingForcedGrabbed = false;
|
{
|
||||||
|
HandGrabber.EnableHandCollision(grabbable);
|
||||||
|
ForceRelease();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -558,7 +574,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
_grabbableCollided = false;
|
_grabbableCollided = false;
|
||||||
IsHoldActive = true;
|
IsHoldActive = true;
|
||||||
|
|
||||||
grabbable.IsBeingForcedGrabbed = true;
|
|
||||||
grabbable.Rigidbody.useGravity = false;
|
grabbable.Rigidbody.useGravity = false;
|
||||||
grabbable.Rigidbody.drag = 0f;
|
grabbable.Rigidbody.drag = 0f;
|
||||||
grabbable.Rigidbody.angularDrag = 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;
|
grabbed = true;
|
||||||
IsForceGrabbing = false;
|
IsForceGrabbing = false;
|
||||||
|
|
@ -630,7 +646,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
if (AutoGrab && (JointAnchorWorldPosition - grabPoint.position).magnitude < AutoGrabDistance)
|
if (AutoGrab && (JointAnchorWorldPosition - grabPoint.position).magnitude < AutoGrabDistance)
|
||||||
{
|
{
|
||||||
if (HandGrabber.TryAutoGrab(GrabbedTarget, posableGrabPoint))
|
if (HandGrabber.TryTransferDistanceGrab(GrabbedTarget, posableGrabPoint))
|
||||||
{
|
{
|
||||||
grabbed = true;
|
grabbed = true;
|
||||||
IsForceGrabbing = false;
|
IsForceGrabbing = false;
|
||||||
|
|
@ -697,7 +713,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
rb.useGravity = useGrav;
|
rb.useGravity = useGrav;
|
||||||
rb.drag = drag;
|
rb.drag = drag;
|
||||||
rb.angularDrag = angularDrag;
|
rb.angularDrag = angularDrag;
|
||||||
grabbable.IsBeingForcedGrabbed = false;
|
|
||||||
grabbable.Collided.RemoveListener(OnGrabbableCollided);
|
grabbable.Collided.RemoveListener(OnGrabbableCollided);
|
||||||
grabbable.Grabbed.RemoveListener(OnGrabbableGrabbed);
|
grabbable.Grabbed.RemoveListener(OnGrabbableGrabbed);
|
||||||
}
|
}
|
||||||
|
|
@ -731,7 +746,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
if ((JointAnchorWorldPosition - t.position).magnitude < AutoGrabDistance)
|
if ((JointAnchorWorldPosition - t.position).magnitude < AutoGrabDistance)
|
||||||
{
|
{
|
||||||
if (HandGrabber.TryAutoGrab(grabbable, grabPoint))
|
if (HandGrabber.TryTransferDistanceGrab(grabbable, grabPoint))
|
||||||
{
|
{
|
||||||
grabbable.Rigidbody.angularVelocity = Vector3.zero;
|
grabbable.Rigidbody.angularVelocity = Vector3.zero;
|
||||||
grabbable.Rigidbody.velocity = Vector3.zero;
|
grabbable.Rigidbody.velocity = Vector3.zero;
|
||||||
|
|
@ -761,7 +776,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
private void UpdateGrabIndicator()
|
private void UpdateGrabIndicator()
|
||||||
{
|
{
|
||||||
if (!IsHovering || !_grabIndicator)
|
if (!IsHovering || !_grabIndicator || !HoverTarget.ShowForceGrabIndicator)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_grabIndicator.LookAtCamera && HVRManager.Instance.Camera)
|
if (_grabIndicator.LookAtCamera && HVRManager.Instance.Camera)
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HVRGrabbable HeldObject => GrabbedTarget;
|
||||||
|
|
||||||
public HVRGrabbable GrabbedTarget
|
public HVRGrabbable GrabbedTarget
|
||||||
{
|
{
|
||||||
|
|
@ -453,7 +454,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
|
|
||||||
var closestValid = ClosestValidHover();
|
var closestValid = ClosestValidHover();
|
||||||
if (closestValid == null)
|
if (!closestValid )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
HoverGrabbable(this, closestValid);
|
HoverGrabbable(this, closestValid);
|
||||||
|
|
@ -513,6 +514,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
public virtual bool CanGrab(HVRGrabbable grabbable)
|
public virtual bool CanGrab(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
|
if (grabbable.MasterGrabbable && grabbable.MasterGrabbable.IsSocketed)
|
||||||
|
return false;
|
||||||
return AllowGrabbing && !IsGrabbing;
|
return AllowGrabbing && !IsGrabbing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -553,15 +556,19 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReSharper disable Unity.PerformanceAnalysis
|
||||||
protected virtual void OnHoverEnter(HVRGrabbable grabbable)
|
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);
|
grabbable.Destroyed.AddListener(OnHoverGrabbableDestroyed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReSharper disable Unity.PerformanceAnalysis
|
||||||
protected virtual void OnHoverExit(HVRGrabbable grabbable)
|
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);
|
grabbable.Destroyed.RemoveListener(OnHoverGrabbableDestroyed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -577,6 +584,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
return false;
|
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)
|
private bool CheckLineOfSight(Vector3 rayOrigin, HVRGrabbable grabbable, LayerMask RaycastLayermask, float rayMaxDistance, List<Collider> colliders, QueryTriggerInteraction queryTrigger, bool useClosestPoint = true)
|
||||||
{
|
{
|
||||||
_lineOfSightRay.origin = rayOrigin;
|
_lineOfSightRay.origin = rayOrigin;
|
||||||
|
|
@ -588,7 +596,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
if (!grabbableCollider)
|
if (!grabbableCollider)
|
||||||
continue;
|
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;
|
_lineOfSightRay.direction = grabbableCollider.bounds.center - _lineOfSightRay.origin;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Core.Grabbers
|
namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Example code to grab an object in code on start
|
||||||
|
/// </summary>
|
||||||
public class HVRHandGrabOnStart : MonoBehaviour
|
public class HVRHandGrabOnStart : MonoBehaviour
|
||||||
{
|
{
|
||||||
public HVRHandGrabber Grabber;
|
public HVRHandGrabber Grabber;
|
||||||
|
|
@ -14,14 +17,13 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
if (Grabbable && Grabber)
|
if (Grabbable && Grabber)
|
||||||
{
|
{
|
||||||
if (Grabber.GrabTrigger == HVRGrabTrigger.Active ||
|
Grabber.Grab(Grabbable, HVRGrabTrigger.Toggle);
|
||||||
Grabbable.OverrideGrabTrigger && Grabbable.GrabTrigger == HVRGrabTrigger.Active)
|
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.MainTransform.position = Grabber.transform.position;
|
||||||
|
Grabber.TryGrab(Grabbable, true);
|
||||||
|
Grabber.GrabToggleActive = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Grabbable.transform.position = Grabber.transform.position;
|
|
||||||
Grabber.TryGrab(Grabbable, true);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
public HVRSocketBag SocketBag;
|
public HVRSocketBag SocketBag;
|
||||||
|
|
||||||
[Header("HandSettings")]
|
[Header("HandSettings")]
|
||||||
|
|
||||||
[Tooltip("Set to true if the HandModel is an IK target")]
|
[Tooltip("Set to true if the HandModel is an IK target")]
|
||||||
public bool InverseKinematics;
|
public bool InverseKinematics;
|
||||||
|
|
||||||
|
|
@ -35,7 +34,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
public bool ApplyHandLayer = true;
|
public bool ApplyHandLayer = true;
|
||||||
|
|
||||||
[Header("Grab Settings")]
|
[Header("Grab Settings")]
|
||||||
|
|
||||||
[Tooltip("If true the hand will move to the grabbable instead of pulling the grabbable to the hand")]
|
[Tooltip("If true the hand will move to the grabbable instead of pulling the grabbable to the hand")]
|
||||||
public bool HandGrabs;
|
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" +
|
[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.")]
|
"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.")]
|
[Tooltip("Ignores hand model parenting distance check.")]
|
||||||
public bool IgnoreParentingDistance;
|
public bool IgnoreParentingDistance;
|
||||||
|
|
@ -84,7 +82,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
public float PushoutTime = .1f;
|
public float PushoutTime = .1f;
|
||||||
|
|
||||||
[Header("Pull Settings")]
|
[Header("Pull Settings")]
|
||||||
|
|
||||||
[Tooltip("Lerps between grabbable starting position and final hand posed position over this amount of time")]
|
[Tooltip("Lerps between grabbable starting position and final hand posed position over this amount of time")]
|
||||||
public float PullLerpTime = .06f;
|
public float PullLerpTime = .06f;
|
||||||
|
|
||||||
|
|
@ -92,12 +89,12 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
public float MoveThreshold = 10f;
|
public float MoveThreshold = 10f;
|
||||||
|
|
||||||
[Header("Components")]
|
[Header("Components")]
|
||||||
|
|
||||||
[Tooltip("The hand animator component, loads from children on startup if not supplied.")]
|
[Tooltip("The hand animator component, loads from children on startup if not supplied.")]
|
||||||
public HVRHandAnimator HandAnimator;
|
public HVRHandAnimator HandAnimator;
|
||||||
|
|
||||||
[Tooltip("Component that holds collider information about the hands. Auto populated from children if not set.")]
|
[Tooltip("Component that holds collider information about the hands. Auto populated from children if not set.")]
|
||||||
public HVRHandPhysics HandPhysics;
|
public HVRHandPhysics HandPhysics;
|
||||||
|
|
||||||
public HVRPlayerInputs Inputs;
|
public HVRPlayerInputs Inputs;
|
||||||
public HVRPhysicsPoser PhysicsPoser;
|
public HVRPhysicsPoser PhysicsPoser;
|
||||||
public HVRForceGrabber ForceGrabber;
|
public HVRForceGrabber ForceGrabber;
|
||||||
|
|
@ -110,6 +107,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
[Header("Grab Indicators")]
|
[Header("Grab Indicators")]
|
||||||
public HVRGrabbableHoverBase GrabIndicator;
|
public HVRGrabbableHoverBase GrabIndicator;
|
||||||
|
|
||||||
public HVRGrabbableHoverBase TriggerGrabIndicator;
|
public HVRGrabbableHoverBase TriggerGrabIndicator;
|
||||||
public HVRGrabbableHoverBase DynamicPoseIndicator;
|
public HVRGrabbableHoverBase DynamicPoseIndicator;
|
||||||
public DynamicPoseGrabIndicator DynamicPoseIndicatorMode = DynamicPoseGrabIndicator.Palm;
|
public DynamicPoseGrabIndicator DynamicPoseIndicatorMode = DynamicPoseGrabIndicator.Palm;
|
||||||
|
|
@ -118,7 +116,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
public HVRHandPoser FallbackPoser;
|
public HVRHandPoser FallbackPoser;
|
||||||
|
|
||||||
[Header("Required Transforms")]
|
[Header("Required Transforms")]
|
||||||
|
|
||||||
[Tooltip("Object holding the hand model.")]
|
[Tooltip("Object holding the hand model.")]
|
||||||
public Transform HandModel;
|
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.")]
|
[Tooltip("Sphere collider that checks when collisions should be re-enabled between a released grabbable and this hand.")]
|
||||||
public Transform OverlapSizer;
|
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.")]
|
[Tooltip("Factor to apply to the linear velocity of the throw.")]
|
||||||
public float ReleasedVelocityFactor;
|
public float ReleasedVelocityFactor;
|
||||||
|
|
||||||
|
|
@ -154,6 +153,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
[Tooltip("If true throwing takes only the top peak velocities for throwing.")]
|
[Tooltip("If true throwing takes only the top peak velocities for throwing.")]
|
||||||
public bool TakePeakVelocities;
|
public bool TakePeakVelocities;
|
||||||
|
|
||||||
[DrawIf("TakePeakVelocities", true)]
|
[DrawIf("TakePeakVelocities", true)]
|
||||||
public int CountPeakVelocities = 3;
|
public int CountPeakVelocities = 3;
|
||||||
|
|
||||||
|
|
@ -164,13 +164,16 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
public VRHandGrabberEvent BreakDistanceReached = new VRHandGrabberEvent();
|
public VRHandGrabberEvent BreakDistanceReached = new VRHandGrabberEvent();
|
||||||
|
|
||||||
[Header("Debugging")]
|
[Header("Debugging")]
|
||||||
|
|
||||||
[Tooltip("If enabled displays vectors involved in throwing calculation.")]
|
[Tooltip("If enabled displays vectors involved in throwing calculation.")]
|
||||||
public bool DrawCenterOfMass;
|
public bool DrawCenterOfMass;
|
||||||
|
|
||||||
public bool GrabToggleActive;
|
public bool GrabToggleActive;
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private HVRGrabbable _triggerHoverTarget;
|
private HVRGrabbable _triggerHoverTarget;
|
||||||
|
|
||||||
public HVRSocket HoveredSocket;
|
public HVRSocket HoveredSocket;
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private HVRGrabbable _hoverTarget;
|
private HVRGrabbable _hoverTarget;
|
||||||
|
|
||||||
|
|
@ -182,6 +185,9 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
public override bool IsHandGrabber => true;
|
public override bool IsHandGrabber => true;
|
||||||
|
|
||||||
|
public bool IsLeftHand => HandSide == HVRHandSide.Left;
|
||||||
|
public bool IsRightHand => HandSide == HVRHandSide.Right;
|
||||||
|
|
||||||
public HVRHandStrengthHandler StrengthHandler { get; set; }
|
public HVRHandStrengthHandler StrengthHandler { get; set; }
|
||||||
|
|
||||||
public Transform HandModelParent { get; private set; }
|
public Transform HandModelParent { get; private set; }
|
||||||
|
|
@ -238,6 +244,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
public HVRPosableGrabPoint PosableGrabPoint { get; private set; }
|
public HVRPosableGrabPoint PosableGrabPoint { get; private set; }
|
||||||
|
|
||||||
private Transform _triggerGrabPoint;
|
private Transform _triggerGrabPoint;
|
||||||
|
|
||||||
public Transform TriggerGrabPoint
|
public Transform TriggerGrabPoint
|
||||||
{
|
{
|
||||||
get => _triggerGrabPoint;
|
get => _triggerGrabPoint;
|
||||||
|
|
@ -270,10 +277,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Quaternion PoseWorldRotation
|
public Quaternion PoseWorldRotation
|
||||||
{
|
{
|
||||||
get
|
get { return GrabbedTarget.transform.rotation * PoseLocalRotation; }
|
||||||
{
|
|
||||||
return GrabbedTarget.transform.rotation * PoseLocalRotation;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 PoseWorldPosition
|
public Vector3 PoseWorldPosition
|
||||||
|
|
@ -344,6 +348,12 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
public bool CanRelease { get; set; } = true;
|
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 LineGrabHandVector => transform.rotation * HandModelRotation * _lineGrabHandRelativeDirection;
|
||||||
|
|
||||||
protected Vector3 LineGrabVector => PosableGrabPoint.WorldLine.normalized * (_flippedLinePose ? -1f : 1f);
|
protected Vector3 LineGrabVector => PosableGrabPoint.WorldLine.normalized * (_flippedLinePose ? -1f : 1f);
|
||||||
|
|
@ -370,12 +380,13 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
private bool _socketGrab;
|
private bool _socketGrab;
|
||||||
private HVRPosableHand _posableHand;
|
private HVRPosableHand _posableHand;
|
||||||
private HVRPosableHand _collisionHand;
|
private HVRPosableHand _collisionHand;
|
||||||
private bool _hasForceGrabber;
|
|
||||||
private HVRHandPoseData _physicsPose;
|
private HVRHandPoseData _physicsPose;
|
||||||
private HVRHandPoseData _savedPose;
|
private HVRHandPoseData _savedPose;
|
||||||
private Vector3 _lineGrabHandRelativeDirection;
|
private Vector3 _lineGrabHandRelativeDirection;
|
||||||
private WaitForFixedUpdate _wffu;
|
private WaitForFixedUpdate _wffu;
|
||||||
private bool _moveGrab;
|
private bool _moveGrab;
|
||||||
|
private Vector3 _lastPlayerPos;
|
||||||
|
private Vector3 _playerVel;
|
||||||
protected bool IsGripGrabActivated;
|
protected bool IsGripGrabActivated;
|
||||||
protected bool IsTriggerGrabActivated;
|
protected bool IsTriggerGrabActivated;
|
||||||
protected bool IsGripGrabActive;
|
protected bool IsGripGrabActive;
|
||||||
|
|
@ -396,8 +407,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected override void Awake()
|
protected override void Awake()
|
||||||
{
|
{
|
||||||
base.Awake();
|
base.Awake();
|
||||||
|
|
@ -415,7 +424,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected override void Start()
|
protected override void Start()
|
||||||
{
|
{
|
||||||
base.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
|
//created in awake of the hand components if not exist, snapshot in start
|
||||||
StrengthHandler = GetComponent<HVRHandStrengthHandler>();
|
StrengthHandler = GetComponent<HVRHandStrengthHandler>();
|
||||||
|
|
||||||
if (!Inputs)
|
if (!Inputs && transform.root)
|
||||||
{
|
{
|
||||||
Inputs = GetComponentInParent<HVRPlayerInputs>();
|
Inputs = transform.root.GetComponentInChildren<HVRPlayerInputs>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ForceGrabber)
|
if (!ForceGrabber)
|
||||||
{
|
{
|
||||||
ForceGrabber = GetComponentInChildren<HVRForceGrabber>();
|
ForceGrabber = GetComponentInChildren<HVRForceGrabber>();
|
||||||
_hasForceGrabber = ForceGrabber;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HandAnimator)
|
if (!HandAnimator)
|
||||||
|
|
@ -515,7 +522,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
//removing colliders from the original hand model
|
//removing colliders from the original hand model
|
||||||
foreach (var col in HandModel.GetComponentsInChildren<Collider>())
|
foreach (var col in HandModel.GetComponentsInChildren<Collider>())
|
||||||
{
|
{
|
||||||
Destroy(col);
|
if (!col.isTrigger) Destroy(col);
|
||||||
}
|
}
|
||||||
|
|
||||||
_collisionTransform = handClone.transform;
|
_collisionTransform = handClone.transform;
|
||||||
|
|
@ -605,7 +612,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
protected override void FixedUpdate()
|
protected override void FixedUpdate()
|
||||||
{
|
{
|
||||||
if(PullingGrabbable) UpdatePullGrabbable();
|
if (PullingGrabbable) UpdatePullGrabbable();
|
||||||
UpdateLineGrab();
|
UpdateLineGrab();
|
||||||
UpdatePostMoveGrab();
|
UpdatePostMoveGrab();
|
||||||
UpdatePushing();
|
UpdatePushing();
|
||||||
|
|
@ -814,7 +821,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
|
|
||||||
var closestValid = ClosestValidHover(false);
|
var closestValid = ClosestValidHover(false);
|
||||||
if (closestValid == null)
|
if (!closestValid)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
HoverGrabbable(this, closestValid);
|
HoverGrabbable(this, closestValid);
|
||||||
|
|
@ -850,7 +857,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
|
|
||||||
var closestValid = ClosestValidHover(true);
|
var closestValid = ClosestValidHover(true);
|
||||||
if (closestValid == null)
|
if (!closestValid)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
OnTriggerHoverEnter(this, closestValid);
|
OnTriggerHoverEnter(this, closestValid);
|
||||||
|
|
@ -858,7 +865,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void CheckUntoggleGrab()
|
private void CheckUntoggleGrab()
|
||||||
{
|
{
|
||||||
if (GrabToggleActive && !_checkingSwap)
|
if (GrabToggleActive && !_checkingSwap)
|
||||||
|
|
@ -913,37 +919,37 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
switch (grabTrigger)
|
switch (grabTrigger)
|
||||||
{
|
{
|
||||||
case HVRGrabTrigger.Active:
|
case HVRGrabTrigger.Active:
|
||||||
|
{
|
||||||
|
if (GrabToggleActive)
|
||||||
{
|
{
|
||||||
if (GrabToggleActive)
|
return true;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsLineGrab)
|
|
||||||
{
|
|
||||||
return IsGripGrabActive || IsTriggerGrabActive;
|
|
||||||
}
|
|
||||||
|
|
||||||
var grabActive = false;
|
|
||||||
switch (_currentGrabControl)
|
|
||||||
{
|
|
||||||
case HVRGrabControls.GripOrTrigger:
|
|
||||||
grabActive = IsGripGrabActive || (IsTriggerGrabActive && Inputs.CanTriggerGrab);
|
|
||||||
break;
|
|
||||||
case HVRGrabControls.GripOnly:
|
|
||||||
grabActive = IsGripGrabActive;
|
|
||||||
break;
|
|
||||||
case HVRGrabControls.TriggerOnly:
|
|
||||||
grabActive = IsTriggerGrabActive;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return grabActive;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsLineGrab)
|
||||||
|
{
|
||||||
|
return IsGripGrabActive || IsTriggerGrabActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
var grabActive = false;
|
||||||
|
switch (_currentGrabControl)
|
||||||
|
{
|
||||||
|
case HVRGrabControls.GripOrTrigger:
|
||||||
|
grabActive = IsGripGrabActive || (IsTriggerGrabActive && Inputs.CanTriggerGrab);
|
||||||
|
break;
|
||||||
|
case HVRGrabControls.GripOnly:
|
||||||
|
grabActive = IsGripGrabActive;
|
||||||
|
break;
|
||||||
|
case HVRGrabControls.TriggerOnly:
|
||||||
|
grabActive = IsTriggerGrabActive;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return grabActive;
|
||||||
|
}
|
||||||
case HVRGrabTrigger.Toggle:
|
case HVRGrabTrigger.Toggle:
|
||||||
{
|
{
|
||||||
return GrabToggleActive;
|
return GrabToggleActive;
|
||||||
}
|
}
|
||||||
case HVRGrabTrigger.ManualRelease:
|
case HVRGrabTrigger.ManualRelease:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -953,7 +959,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
protected override void CheckGrab()
|
protected override void CheckGrab()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!AllowGrabbing || IsGrabbing || GrabbedTarget)
|
if (!AllowGrabbing || IsGrabbing || GrabbedTarget)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
@ -999,7 +1004,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
GrabPoint = null;
|
GrabPoint = null;
|
||||||
|
|
||||||
var gp = HoveredSocket.GrabbedTarget.GetGrabPointTransform(this, GrabpointFilter.Socket);
|
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);
|
gp = HoveredSocket.GrabbedTarget.GetGrabPointTransform(this, GrabpointFilter.Normal);
|
||||||
|
|
||||||
GrabPoint = gp;
|
GrabPoint = gp;
|
||||||
|
|
@ -1072,7 +1077,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
protected virtual void UpdateGrabIndicator()
|
protected virtual void UpdateGrabIndicator()
|
||||||
{
|
{
|
||||||
if (!IsHovering || !_grabIndicator)
|
if (!IsHovering || !_grabIndicator || !HoverTarget.ShowGrabIndicator)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_grabIndicator.LookAtCamera && HVRManager.Instance.Camera)
|
if (_grabIndicator.LookAtCamera && HVRManager.Instance.Camera)
|
||||||
|
|
@ -1146,7 +1151,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
protected virtual void UpdateTriggerGrabIndicator()
|
protected virtual void UpdateTriggerGrabIndicator()
|
||||||
{
|
{
|
||||||
if (!IsTriggerHovering || !_triggerIndicator || IsGrabbing || TriggerHoverTarget == HoverTarget)
|
if (!IsTriggerHovering || !_triggerIndicator || IsGrabbing || TriggerHoverTarget == HoverTarget || !TriggerHoverTarget.ShowTriggerGrabIndicator)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_triggerIndicator.LookAtCamera && HVRManager.Instance.Camera)
|
if (_triggerIndicator.LookAtCamera && HVRManager.Instance.Camera)
|
||||||
|
|
@ -1185,7 +1190,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
if (grabPoint.IsLineGrab && !useGrabPoint && grabPoint.LineInitialCanReposition)
|
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)
|
if (grabPoint.GrabIndicatorPosition)
|
||||||
|
|
@ -1243,6 +1248,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
ResetAnimator();
|
ResetAnimator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnableGrabIndicator()
|
private void EnableGrabIndicator()
|
||||||
{
|
{
|
||||||
if (_grabIndicatorEnabled) return;
|
if (_grabIndicatorEnabled) return;
|
||||||
|
|
@ -1324,6 +1330,10 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
private void TrackVelocities()
|
private void TrackVelocities()
|
||||||
{
|
{
|
||||||
|
_playerVel = Vector3.zero;
|
||||||
|
if (PlayerController)
|
||||||
|
_playerVel = (PlayerController.position - _lastPlayerPos) / Time.deltaTime;
|
||||||
|
|
||||||
var deltaRotation = transform.rotation * Quaternion.Inverse(_previousRotation);
|
var deltaRotation = transform.rotation * Quaternion.Inverse(_previousRotation);
|
||||||
deltaRotation.ToAngleAxis(out var angle, out var axis);
|
deltaRotation.ToAngleAxis(out var angle, out var axis);
|
||||||
angle *= Mathf.Deg2Rad;
|
angle *= Mathf.Deg2Rad;
|
||||||
|
|
@ -1331,6 +1341,9 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
RecentVelocities.Enqueue(Rigidbody.velocity);
|
RecentVelocities.Enqueue(Rigidbody.velocity);
|
||||||
RecentAngularVelocities.Enqueue(angularVelocity);
|
RecentAngularVelocities.Enqueue(angularVelocity);
|
||||||
|
|
||||||
|
if (PlayerController)
|
||||||
|
_lastPlayerPos = PlayerController.position;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void CheckSocketUnhover()
|
protected virtual void CheckSocketUnhover()
|
||||||
|
|
@ -1352,7 +1365,12 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
protected virtual bool CanGrabFromSocket(HVRSocket socket)
|
protected virtual bool CanGrabFromSocket(HVRSocket socket)
|
||||||
{
|
{
|
||||||
if (!socket)
|
if (!socket || !socket.GrabbedTarget)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!socket.GrabbedTarget.CanHandGrab(this))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -1362,7 +1380,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return socket.GrabDetectionType == HVRGrabDetection.Socket && socket.GrabbedTarget;
|
return socket.GrabDetectionType == HVRGrabDetection.Socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void CheckSocketHover()
|
protected virtual void CheckSocketHover()
|
||||||
|
|
@ -1520,7 +1538,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
else if (_distanceComplete && !_posJoint)
|
else if (_distanceComplete && !_posJoint)
|
||||||
{
|
{
|
||||||
_posJoint = grabbable.gameObject.AddComponent<ConfigurableJoint>();
|
_posJoint = grabbable.Rigidbody.gameObject.AddComponent<ConfigurableJoint>();
|
||||||
_posJoint.LockLinearMotion();
|
_posJoint.LockLinearMotion();
|
||||||
_posJoint.connectedBody = Rigidbody;
|
_posJoint.connectedBody = Rigidbody;
|
||||||
_posJoint.autoConfigureConnectedAnchor = false;
|
_posJoint.autoConfigureConnectedAnchor = false;
|
||||||
|
|
@ -1529,13 +1547,14 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
_posJoint.anchor = BaseLineGrabAnchor + _lineOffset;
|
_posJoint.anchor = BaseLineGrabAnchor + _lineOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
_posJoint.connectedAnchor = HandAnchorLocal;
|
_posJoint.connectedAnchor = HandAnchorLocal;
|
||||||
PullJoint.SetLinearDrive(0f, 0f, 0f);
|
PullJoint.SetLinearDrive(0f, 0f, 0f);
|
||||||
}
|
}
|
||||||
else if (angleComplete && !_rotJoint)
|
else if (angleComplete && !_rotJoint)
|
||||||
{
|
{
|
||||||
grabbable.transform.rotation = deltaRot * grabbable.transform.rotation;
|
grabbable.transform.rotation = deltaRot * grabbable.transform.rotation;
|
||||||
_rotJoint = grabbable.gameObject.AddComponent<ConfigurableJoint>();
|
_rotJoint = grabbable.Rigidbody.gameObject.AddComponent<ConfigurableJoint>();
|
||||||
_rotJoint.LockAllAngularMotion();
|
_rotJoint.LockAllAngularMotion();
|
||||||
_rotJoint.connectedBody = Rigidbody;
|
_rotJoint.connectedBody = Rigidbody;
|
||||||
_rotJoint.autoConfigureConnectedAnchor = false;
|
_rotJoint.autoConfigureConnectedAnchor = false;
|
||||||
|
|
@ -1544,6 +1563,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
_posJoint.anchor = BaseLineGrabAnchor + _lineOffset;
|
_posJoint.anchor = BaseLineGrabAnchor + _lineOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
_rotJoint.connectedAnchor = HandAnchorLocal;
|
_rotJoint.connectedAnchor = HandAnchorLocal;
|
||||||
PullJoint.SetSlerpDrive(0f, 0f, 0f);
|
PullJoint.SetSlerpDrive(0f, 0f, 0f);
|
||||||
}
|
}
|
||||||
|
|
@ -1579,13 +1599,14 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
Debug.Log($"{name} break distance reached on {GrabbedTarget.name}.");
|
Debug.Log($"{name} break distance reached on {GrabbedTarget.name}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
BreakDistanceReached.Invoke(this, GrabbedTarget);
|
BreakDistanceReached.Invoke(this, GrabbedTarget);
|
||||||
ForceRelease();
|
ForceRelease();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool CheckBreakDistanceReached(HVRGrabbable grabbable)
|
protected virtual bool CheckBreakDistanceReached(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
if(grabbable.BreakDistanceSource == BreakDistanceSource.Hand)
|
if (grabbable.BreakDistanceSource == BreakDistanceSource.Hand)
|
||||||
return Vector3.Distance(GrabAnchorWorld, JointAnchorWorldPosition) > grabbable.BreakDistance;
|
return Vector3.Distance(GrabAnchorWorld, JointAnchorWorldPosition) > grabbable.BreakDistance;
|
||||||
if (grabbable.BreakDistanceSource == BreakDistanceSource.Controller)
|
if (grabbable.BreakDistanceSource == BreakDistanceSource.Controller)
|
||||||
return Vector3.Distance(GrabAnchorWorld, TrackedController.position) > grabbable.BreakDistance;
|
return Vector3.Distance(GrabAnchorWorld, TrackedController.position) > grabbable.BreakDistance;
|
||||||
|
|
@ -1651,7 +1672,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
ParentHandModel(GrabPoint);
|
ParentHandModel(GrabPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetAnimatorPose(poser, parent);
|
if (CloneHandModel && _collisionAnimator) _collisionAnimator.SetHeldPoser(poser);
|
||||||
|
if (HandAnimator) HandAnimator.SetHeldPoser(poser);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ParentHandModel(Transform parent)
|
private void ParentHandModel(Transform parent)
|
||||||
|
|
@ -1672,9 +1694,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
HandModel.parent = parent;
|
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);
|
var pose = PosableGrabPoint.HandPoser.PrimaryPose.Pose.GetPose(HandSide);
|
||||||
HandModel.localRotation = pose.Rotation;
|
HandModel.localRotation = pose.Rotation;
|
||||||
HandModel.localPosition = pose.Position;
|
HandModel.localPosition = pose.Position;
|
||||||
|
|
@ -1682,14 +1703,20 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
_hasPosed = true;
|
_hasPosed = true;
|
||||||
|
|
||||||
var listener = parent.gameObject.AddComponent<HVRDestroyListener>();
|
var listener = parent.gameObject.EnsureComponent<HVRDestroyListener>();
|
||||||
listener.Destroyed.AddListener(OnGrabPointDestroyed);
|
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 (CloneHandModel && _collisionAnimator) _collisionAnimator.SetCurrentPoser(poser);
|
||||||
if (HandAnimator) HandAnimator.SetCurrentPoser(poser, poseHand);
|
if (HandAnimator) HandAnimator.SetCurrentPoser(poser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetAnimatorOverridePose(HVRHandPoser poser)
|
||||||
|
{
|
||||||
|
if (CloneHandModel && _collisionAnimator) _collisionAnimator.SetOverridePoser(poser);
|
||||||
|
if (HandAnimator) HandAnimator.SetOverridePoser(poser);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetAnimator()
|
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)
|
public override bool CanHover(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
if (IsForceGrabbing || (IsGripGrabActive && (!HoverTarget || HoverTarget != grabbable)))
|
if (IsForceGrabbing || (IsGripGrabActive && (!HoverTarget || HoverTarget != grabbable)))
|
||||||
|
|
@ -1731,13 +1753,16 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
return CanGrab(grabbable);
|
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)
|
public override bool CanGrab(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
if (!base.CanGrab(grabbable))
|
if (!base.CanGrab(grabbable))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!grabbable.CanHandGrab(this))
|
||||||
|
return false;
|
||||||
|
|
||||||
if ((!AllowMultiplayerSwap && !grabbable.AllowMultiplayerSwap) && grabbable.HoldType != HVRHoldType.ManyHands && grabbable.AnyGrabberNotMine())
|
if ((!AllowMultiplayerSwap && !grabbable.AllowMultiplayerSwap) && grabbable.HoldType != HVRHoldType.ManyHands && grabbable.AnyGrabberNotMine())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1752,7 +1777,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GrabbedTarget != null && GrabbedTarget != grabbable)
|
if (GrabbedTarget && GrabbedTarget != grabbable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (grabbable.IsSocketed && grabbable.Socket.GrabDetectionType == HVRGrabDetection.Socket)
|
if (grabbable.IsSocketed && grabbable.Socket.GrabDetectionType == HVRGrabDetection.Socket)
|
||||||
|
|
@ -1808,9 +1833,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
if (_socketGrab)
|
if (_socketGrab)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1933,9 +1955,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var isStatic = grabbable.Stationary ||
|
var isStatic = grabbable.Stationary || (grabbable.IsJointGrab && (!grabbable.Rigidbody || grabbable.Rigidbody.isKinematic));
|
||||||
(grabbable.IsJointGrab && (!grabbable.Rigidbody || (grabbable.RemainsKinematic && grabbable.Rigidbody.isKinematic)));
|
|
||||||
|
|
||||||
|
|
||||||
var linkedHeld = grabbable.MasterGrabbable && grabbable.MasterGrabbable.IsHandGrabbed || grabbable.AnyLinkedHandHeld();
|
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)
|
public static bool IsV1Closest(Vector3 v, Vector3 v1, Vector3 v2)
|
||||||
{
|
{
|
||||||
var vNorm = v.normalized;
|
var vNorm = v.normalized;
|
||||||
|
|
@ -1993,7 +2012,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
var mid = grabbable.transform.InverseTransformPoint(PosableGrabPoint.WorldLineMiddle);
|
var mid = grabbable.transform.InverseTransformPoint(PosableGrabPoint.WorldLineMiddle);
|
||||||
var point = IsInitialLineGrab ? transform.TransformPoint(GetLineGrabHandAnchor(PosableGrabPoint)) : GrabPoint.position;
|
var point = IsInitialLineGrab ? transform.TransformPoint(GetLineGrabHandAnchor(PosableGrabPoint)) : GrabPoint.position;
|
||||||
_lineOffset = GetLocalLineGrabPoint(grabbable, point) - mid;
|
_lineOffset = GetLocalLineGrabPoint(grabbable, point, PosableGrabPoint) - mid;
|
||||||
|
|
||||||
if (PosableGrabPoint.CanLineFlip)
|
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 start = grabbable.transform.InverseTransformPoint(grabPoint.LineStart.position);
|
||||||
var end = grabbable.transform.InverseTransformPoint(PosableGrabPoint.LineEnd.position);
|
var end = grabbable.transform.InverseTransformPoint(grabPoint.LineEnd.position);
|
||||||
var testPoint = grabbable.transform.InverseTransformPoint(point);
|
var testPoint = grabbable.transform.InverseTransformPoint(point);
|
||||||
return HVRUtilities.FindNearestPointOnLine(start, end, testPoint);
|
return HVRUtilities.FindNearestPointOnLine(start, end, testPoint);
|
||||||
}
|
}
|
||||||
|
|
@ -2038,12 +2057,13 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
for (var i = 0; i < grabbable.Colliders.Count; i++)
|
for (var i = 0; i < grabbable.Colliders.Count; i++)
|
||||||
{
|
{
|
||||||
var gc = grabbable.Colliders[i];
|
var gc = grabbable.Colliders[i];
|
||||||
if (!gc.enabled || !gc.gameObject.activeInHierarchy || gc.isTrigger)
|
if (!gc || !gc.enabled || !gc.gameObject.activeInHierarchy || gc.isTrigger)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var anchor = Palm.transform.position;
|
var anchor = Palm.transform.position;
|
||||||
Vector3 point;
|
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))
|
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 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()
|
private IEnumerator MoveGrab()
|
||||||
|
|
@ -2177,7 +2197,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
SetupGrab(grabbable);
|
SetupGrab(grabbable);
|
||||||
IsClimbing = grabbable.GetComponent<HVRClimbable>();
|
IsClimbing = grabbable.GetComponent<HVRClimbable>();
|
||||||
if (grabbable.HandGrabbedClip)
|
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)
|
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
|
//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 ||
|
final = grabbable.PoseType == PoseType.Offset || grabbable.Stationary ||
|
||||||
(grabbable.RemainsKinematic && grabbable.Rigidbody.isKinematic)
|
grabbable.Rigidbody.isKinematic ||
|
||||||
|| _moveGrab || _forceFullyGrabbed
|
_moveGrab || _forceFullyGrabbed
|
||||||
|| _socketGrab && HoveredSocket.InstantHandPose;
|
|| _socketGrab && HoveredSocket.InstantHandPose;
|
||||||
_moveGrab = false;
|
_moveGrab = false;
|
||||||
}
|
}
|
||||||
|
|
@ -2209,12 +2230,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
StartPull();
|
StartPull();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (grabbable.Rigidbody && (!grabbable.Rigidbody.isKinematic || !grabbable.RemainsKinematic))
|
|
||||||
{
|
|
||||||
grabbable.Rigidbody.isKinematic = false;
|
|
||||||
grabbable.Rigidbody.collisionDetectionMode = grabbable.CollisionDetection;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GrabPoint)
|
if (GrabPoint)
|
||||||
|
|
@ -2335,18 +2350,12 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
public Quaternion JointRotation
|
public Quaternion JointRotation
|
||||||
{
|
{
|
||||||
get
|
get { return Quaternion.Inverse(GrabbedTarget.transform.rotation) * CachedWorldRotation * Quaternion.Inverse(PoseLocalRotation); }
|
||||||
{
|
|
||||||
return Quaternion.Inverse(GrabbedTarget.transform.rotation) * CachedWorldRotation * Quaternion.Inverse(PoseLocalRotation);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void SetupConfigurableJoint(HVRGrabbable grabbable)
|
private void SetupConfigurableJoint(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
var axis = Vector3.right;
|
var axis = Vector3.right;
|
||||||
var secondaryAxis = Vector3.up;
|
var secondaryAxis = Vector3.up;
|
||||||
|
|
||||||
|
|
@ -2453,7 +2462,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateGrabbableCOM(grabbable);
|
|
||||||
OnHandAttached();
|
OnHandAttached();
|
||||||
BreakDistanceCooldown(2f);
|
BreakDistanceCooldown(2f);
|
||||||
_finalJointCreated = true;
|
_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()
|
private void UpdateLineGrab()
|
||||||
{
|
{
|
||||||
if (!IsLineGrab || PullingGrabbable || !_finalJointCreated || !Joint)
|
if (!IsLineGrab || PullingGrabbable || !_finalJointCreated || !Joint)
|
||||||
|
|
@ -2516,7 +2505,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
(GrabTrigger == HVRGrabTrigger.Toggle || GrabToggleActive || !CanRelease) && !IsTriggerGrabActive;
|
(GrabTrigger == HVRGrabTrigger.Toggle || GrabToggleActive || !CanRelease) && !IsTriggerGrabActive;
|
||||||
|
|
||||||
loosen = GrabTrigger == HVRGrabTrigger.Active && !IsGripGrabActive && !GrabToggleActive && CanRelease ||
|
loosen = GrabTrigger == HVRGrabTrigger.Active && !IsGripGrabActive && !GrabToggleActive && CanRelease ||
|
||||||
(GrabTrigger == HVRGrabTrigger.Toggle || GrabToggleActive || !CanRelease) && IsTriggerGrabActive;
|
(GrabTrigger == HVRGrabTrigger.Toggle || GrabToggleActive || !CanRelease) && IsTriggerGrabActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PosableGrabPoint.LineCanReposition || PosableGrabPoint.LineCanRotate)
|
if (PosableGrabPoint.LineCanReposition || PosableGrabPoint.LineCanRotate)
|
||||||
|
|
@ -2533,10 +2522,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
|
|
||||||
var mid = GrabbedTarget.transform.InverseTransformPoint(PosableGrabPoint.WorldLineMiddle);
|
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;
|
Joint.anchor = BaseLineGrabAnchor + _lineOffset;
|
||||||
|
|
||||||
UpdateGrabbableCOM(GrabbedTarget);
|
|
||||||
}
|
}
|
||||||
else if (_tightlyHeld && loosen)
|
else if (_tightlyHeld && loosen)
|
||||||
{
|
{
|
||||||
|
|
@ -2561,7 +2548,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
xDrive.positionDamper = PosableGrabPoint.LooseDamper;
|
xDrive.positionDamper = PosableGrabPoint.LooseDamper;
|
||||||
xDrive.maximumForce = 100000f;
|
xDrive.maximumForce = 100000f;
|
||||||
Joint.xDrive = xDrive;
|
Joint.xDrive = xDrive;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PosableGrabPoint.LineCanRotate || PosableGrabPoint.LineFreeRotation)
|
if (PosableGrabPoint.LineCanRotate || PosableGrabPoint.LineFreeRotation)
|
||||||
|
|
@ -2575,15 +2561,16 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
xDrive.maximumForce = 100000f;
|
xDrive.maximumForce = 100000f;
|
||||||
Joint.angularXDrive = xDrive;
|
Joint.angularXDrive = xDrive;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReSharper disable Unity.PerformanceAnalysis
|
||||||
protected override void OnReleased(HVRGrabbable grabbable)
|
protected override void OnReleased(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
if (HVRSettings.Instance.VerboseHandGrabberEvents)
|
if (HVRSettings.Instance.VerboseHandGrabberEvents)
|
||||||
{
|
{
|
||||||
Debug.Log($"{name}:OnReleased");
|
Debug.Log($"{name}:OnReleased");
|
||||||
}
|
}
|
||||||
|
|
||||||
base.OnReleased(grabbable);
|
base.OnReleased(grabbable);
|
||||||
|
|
||||||
if (ControllerOffset)
|
if (ControllerOffset)
|
||||||
|
|
@ -2597,6 +2584,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
StartPushing();
|
StartPushing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_checkingEnableCollision = false;
|
_checkingEnableCollision = false;
|
||||||
_primaryGrabPointGrab = false;
|
_primaryGrabPointGrab = false;
|
||||||
_socketGrab = false;
|
_socketGrab = false;
|
||||||
|
|
@ -2606,7 +2594,17 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
IsLineGrab = false;
|
IsLineGrab = false;
|
||||||
|
|
||||||
TriggerGrabPoint = null;
|
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;
|
IsPhysicsPose = false;
|
||||||
_physicsPose = null;
|
_physicsPose = null;
|
||||||
|
|
@ -2623,26 +2621,33 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
if (grabbable.Rigidbody && !grabbable.Rigidbody.isKinematic)
|
if (grabbable.Rigidbody && !grabbable.Rigidbody.isKinematic)
|
||||||
{
|
{
|
||||||
var throwVelocity = ComputeThrowVelocity(grabbable, out var angularVelocity, true);
|
var throwVelocity = ComputeThrowVelocity(grabbable, out var angularVelocity);
|
||||||
grabbable.Rigidbody.velocity = throwVelocity;
|
if(!throwVelocity.IsInvalid())
|
||||||
grabbable.Rigidbody.angularVelocity = angularVelocity;
|
grabbable.Rigidbody.velocity = throwVelocity;
|
||||||
|
if(!throwVelocity.IsInvalid())
|
||||||
|
grabbable.Rigidbody.angularVelocity = angularVelocity;
|
||||||
//prevent clipping on throw
|
//prevent clipping on throw
|
||||||
if (timeout < .2f && grabbable.Rigidbody.velocity.magnitude > 2f) timeout = .2f;
|
if (timeout < .2f && grabbable.Rigidbody.velocity.magnitude > 2f) timeout = .2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (grabbable.Rigidbody && !grabbable.Rigidbody.isKinematic && (grabbable.RequireOverlapClearance || timeout > 0f))
|
if (!IgnoreNextCollisionCheck)
|
||||||
{
|
{
|
||||||
var routine = StartCoroutine(CheckReleasedOverlap(grabbable, timeout));
|
if (grabbable.Rigidbody && !grabbable.Rigidbody.isKinematic && (grabbable.RequireOverlapClearance || timeout > 0f))
|
||||||
OverlappingGrabbables[grabbable] = routine;
|
{
|
||||||
}
|
var routine = StartCoroutine(CheckReleasedOverlap(grabbable, timeout));
|
||||||
else
|
OverlappingGrabbables[grabbable] = routine;
|
||||||
{
|
}
|
||||||
EnableHandCollision(grabbable);
|
else
|
||||||
|
{
|
||||||
|
EnableHandCollision(grabbable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
grabbable.HeldGrabPoints.Remove(GrabPoint);
|
grabbable.HeldGrabPoints.Remove(GrabPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IgnoreNextCollisionCheck = false;
|
||||||
|
|
||||||
GrabToggleActive = false;
|
GrabToggleActive = false;
|
||||||
GrabPoint = null;
|
GrabPoint = null;
|
||||||
Released.Invoke(this, grabbable);
|
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)
|
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;
|
var sum = Vector3.zero;
|
||||||
for (var i = start; i < start + frames; i++)
|
for (var i = start; i < start + frames; i++)
|
||||||
{
|
{
|
||||||
sum += recentVelocities[i];
|
sum += recentVelocities[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Mathf.Approximately(frames, 0f))
|
|
||||||
return Vector3.zero;
|
|
||||||
|
|
||||||
var average = sum / frames;
|
var average = sum / frames;
|
||||||
|
|
||||||
|
|
@ -2695,7 +2701,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
for (var i = start; i < start + frames; i++)
|
for (var i = start; i < start + frames; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
//removing any vectors not going in the direction of the average vector
|
//removing any vectors not going in the direction of the average vector
|
||||||
var dot = Vector3.Dot(average.normalized, recentVelocities[i].normalized);
|
var dot = Vector3.Dot(average.normalized, recentVelocities[i].normalized);
|
||||||
if (dot < .2)
|
if (dot < .2)
|
||||||
|
|
@ -2736,8 +2741,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Vector3 ComputeThrowVelocity(HVRGrabbable grabbable, out Vector3 angularVelocity, bool playerRelative = false)
|
||||||
public Vector3 ComputeThrowVelocity(HVRGrabbable grabbable, out Vector3 angularVelocity, bool isThrowing = false)
|
|
||||||
{
|
{
|
||||||
if (!grabbable.Rigidbody)
|
if (!grabbable.Rigidbody)
|
||||||
{
|
{
|
||||||
|
|
@ -2749,8 +2753,16 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
var grabbableAngular = grabbable.GetAverageAngularVelocity(ThrowLookback, ThrowLookbackStart);
|
var grabbableAngular = grabbable.GetAverageAngularVelocity(ThrowLookback, ThrowLookbackStart);
|
||||||
|
|
||||||
var handVelocity = GetAverageVelocity(ThrowLookback, ThrowLookbackStart);
|
var handVelocity = GetAverageVelocity(ThrowLookback, ThrowLookbackStart);
|
||||||
|
|
||||||
|
if (playerRelative)
|
||||||
|
{
|
||||||
|
handVelocity -= _playerVel;
|
||||||
|
grabbableVelocity -= _playerVel;
|
||||||
|
}
|
||||||
|
|
||||||
var handAngularVelocity = GetAverageAngularVelocity(ThrowLookback, ThrowLookbackStart);
|
var handAngularVelocity = GetAverageAngularVelocity(ThrowLookback, ThrowLookbackStart);
|
||||||
|
|
||||||
|
//var throwVelocity = handVelocity * (ReleasedVelocityFactor * grabbable.ReleasedVelocityFactor);
|
||||||
var throwVelocity = ReleasedVelocityFactor * handVelocity + grabbableVelocity * grabbable.ReleasedVelocityFactor;
|
var throwVelocity = ReleasedVelocityFactor * handVelocity + grabbableVelocity * grabbable.ReleasedVelocityFactor;
|
||||||
|
|
||||||
//Debug.Log($"{handAngularVelocity.magnitude}");
|
//Debug.Log($"{handAngularVelocity.magnitude}");
|
||||||
|
|
@ -2758,7 +2770,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
if (handAngularVelocity.magnitude > ReleasedAngularThreshold)
|
if (handAngularVelocity.magnitude > ReleasedAngularThreshold)
|
||||||
{
|
{
|
||||||
//compute linear velocity from wrist rotation
|
//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;
|
Vector3 centerOfMass;
|
||||||
if (ThrowingCenterOfMass && ThrowingCenterOfMass.CenterOfMass)
|
if (ThrowingCenterOfMass && ThrowingCenterOfMass.CenterOfMass)
|
||||||
|
|
@ -2770,12 +2782,14 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
centerOfMass = Rigidbody.worldCenterOfMass;
|
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;
|
throwVelocity += cross;
|
||||||
}
|
}
|
||||||
|
|
||||||
angularVelocity = grabbableAngular * grabbable.ReleasedAngularFactor;
|
angularVelocity = grabbableAngular * grabbable.ReleasedAngularFactor;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return throwVelocity;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -2956,7 +2970,24 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
//if (grabPoint) OrientGrabbable(grabbable, grabPoint, true, false);
|
//if (grabPoint) OrientGrabbable(grabbable, grabPoint, true, false);
|
||||||
if (TryGrab(grabbable))
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2964,6 +2995,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
_isForceAutoGrab = false;
|
_isForceAutoGrab = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2975,36 +3007,18 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
if (!HandModel)
|
if (!HandModel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (HandModel.parent)
|
ResetHandTransform(HandModel);
|
||||||
{
|
if (HandAnimator) HandAnimator.ResetToDefault();
|
||||||
var listener = HandModel.parent.GetComponent<HVRDestroyListener>();
|
|
||||||
if (listener)
|
|
||||||
{
|
|
||||||
listener.Destroyed.RemoveListener(OnGrabPointDestroyed);
|
|
||||||
Destroy(listener);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ResetHand(HandModel, HandAnimator);
|
|
||||||
if (_collisionTransform)
|
if (_collisionTransform)
|
||||||
{
|
{
|
||||||
ResetHand(_collisionTransform, _collisionAnimator);
|
ResetHandTransform(_collisionTransform);
|
||||||
}
|
if (_collisionAnimator) _collisionAnimator.ResetToDefault();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void ResetHand(Transform hand, HVRHandAnimator animator)
|
|
||||||
{
|
|
||||||
ResetHandTransform(hand);
|
|
||||||
if (animator)
|
|
||||||
{
|
|
||||||
animator.ResetToDefault();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResetHandTransform(Transform hand)
|
private void ResetHandTransform(Transform hand)
|
||||||
{
|
{
|
||||||
|
if (!hand) return;
|
||||||
hand.parent = HandModelParent;
|
hand.parent = HandModelParent;
|
||||||
hand.localPosition = HandModelPosition;
|
hand.localPosition = HandModelPosition;
|
||||||
hand.localRotation = HandModelRotation;
|
hand.localRotation = HandModelRotation;
|
||||||
|
|
@ -3036,6 +3050,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
_collisionHand.Pose(HVRHandPoseData.FromByteArray(data, HandSide), GrabbedTarget.ParentHandModel);
|
_collisionHand.Pose(HVRHandPoseData.FromByteArray(data, HandSide), GrabbedTarget.ParentHandModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
_posableHand.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)
|
protected virtual IEnumerator SwapGrabPoint(HVRPosableGrabPoint grabPoint, float time, HVRAxis axis)
|
||||||
{
|
{
|
||||||
var grabbable = GrabbedTarget;
|
var grabbable = GrabbedTarget;
|
||||||
|
|
@ -3136,7 +3150,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <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.
|
/// 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.
|
/// 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)
|
public void OrientGrabbable(HVRGrabbable grabbable, HVRPosableGrabPoint grabPoint, bool position = true, bool rotation = true)
|
||||||
{
|
{
|
||||||
var deltaRot = CachedWorldRotation * Quaternion.Inverse(grabPoint.GetPoseWorldRotation(HandSide));
|
var deltaRot = CachedWorldRotation * Quaternion.Inverse(grabPoint.GetPoseWorldRotation(HandSide));
|
||||||
if (rotation) grabbable.transform.rotation = deltaRot * grabbable.transform.rotation;
|
if (rotation) grabbable.MainTransform.rotation = deltaRot * grabbable.MainTransform.rotation;
|
||||||
if (position) grabbable.transform.position += (HandModel.position - grabPoint.GetPoseWorldPosition(HandSide));
|
if (position) grabbable.MainTransform.position += (HandModel.position - grabPoint.GetPoseWorldPosition(HandSide));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ForceRelease()
|
public override void ForceRelease()
|
||||||
|
|
@ -3197,7 +3210,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
private void OnDrawGizmos()
|
private void OnDrawGizmos()
|
||||||
{
|
{
|
||||||
|
|
@ -3244,6 +3256,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
public enum DynamicPoseGrabIndicator
|
public enum DynamicPoseGrabIndicator
|
||||||
{
|
{
|
||||||
Transform, Palm, None
|
Transform,
|
||||||
|
Palm,
|
||||||
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -15,7 +15,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
{
|
{
|
||||||
public class HVRSocket : HVRGrabberBase
|
public class HVRSocket : HVRGrabberBase
|
||||||
{
|
{
|
||||||
|
|
||||||
[Header("Grab Settings")]
|
[Header("Grab Settings")]
|
||||||
public HVRGrabControls GrabControl = HVRGrabControls.GripOrTrigger;
|
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.")]
|
[Tooltip("Fallback grabbed sfx to play if the socketable doesn't have one.")]
|
||||||
public AudioClip AudioGrabbedFallback;
|
public AudioClip AudioGrabbedFallback;
|
||||||
|
|
||||||
[Tooltip("Fallback released sfx to play if the socketable doesn't have one.")]
|
[Tooltip("Fallback released sfx to play if the socketable doesn't have one.")]
|
||||||
public AudioClip AudioReleasedFallback;
|
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")]
|
[Tooltip("If supplied the hand will use this point when sorting distance to the closest socket instead of the socket position")]
|
||||||
public Transform DistanceSource;
|
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.")]
|
[Tooltip("If false, the socketed object colliders remain active, only works for static or kinematic rb sockets.")]
|
||||||
public bool DisableCollision = true;
|
public bool DisableCollision = true;
|
||||||
|
|
@ -105,16 +107,23 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
protected Transform _previousParent;
|
protected Transform _previousParent;
|
||||||
protected Vector3 _previousScale;
|
protected Vector3 _previousScale;
|
||||||
protected Bounds _modelBounds;
|
|
||||||
protected bool _appQuitting;
|
protected bool _appQuitting;
|
||||||
protected HVRGrabbable _timeoutGrabbable;
|
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 _hadRigidBody;
|
||||||
protected bool _ignoreGrabSFX;
|
protected bool _ignoreGrabSFX;
|
||||||
protected Coroutine _fixPositionRoutine;
|
protected Coroutine _fixPositionRoutine;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
public HVRGrabbable LinkedGrabbable { get; internal set; }
|
/// If assigned only this grabbable can enter this socket.
|
||||||
|
/// </summary>
|
||||||
|
public HVRGrabbable LinkedGrabbable { get; set; }
|
||||||
|
|
||||||
public override bool IsGrabActivated => !IsGrabbing;
|
public override bool IsGrabActivated => !IsGrabbing;
|
||||||
public override bool IsHoldActive => IsGrabbing;
|
public override bool IsHoldActive => IsGrabbing;
|
||||||
|
|
@ -125,6 +134,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
public override bool IsSocket => true;
|
public override bool IsSocket => true;
|
||||||
|
|
||||||
|
public int? PoseHash { get; set; }
|
||||||
|
|
||||||
public bool CanAddGrabbable
|
public bool CanAddGrabbable
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -151,6 +162,9 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
Debug.LogWarning($"Sockets with a non kinematic rigidbody should not disable DisableCollision");
|
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)
|
//if (!Rigidbody && HoldType == SocketHoldType.RemoveRigidbody)
|
||||||
//{
|
//{
|
||||||
// HoldType = SocketHoldType.Kinematic;
|
// HoldType = SocketHoldType.Kinematic;
|
||||||
|
|
@ -166,7 +180,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
SetupParentDisablesGrab();
|
SetupParentDisablesGrab();
|
||||||
|
|
||||||
SocketFilters = GetComponents<HVRSocketFilter>();
|
if (SocketFilters == null || SocketFilters.Length == 0)
|
||||||
|
SocketFilters = GetComponents<HVRSocketFilter>();
|
||||||
if (HoverActions == null || HoverActions.Length == 0)
|
if (HoverActions == null || HoverActions.Length == 0)
|
||||||
HoverActions = GetComponents<HVRSocketHoverAction>();
|
HoverActions = GetComponents<HVRSocketHoverAction>();
|
||||||
|
|
||||||
|
|
@ -201,7 +216,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
var cloneGrabbable = clone.GetComponent<HVRGrabbable>();
|
var cloneGrabbable = clone.GetComponent<HVRGrabbable>();
|
||||||
if (cloneGrabbable)
|
if (cloneGrabbable)
|
||||||
{
|
{
|
||||||
var t = TryGrab(cloneGrabbable, true, true);
|
TryGrab(cloneGrabbable, true, true);
|
||||||
SpawnedPrefab.Invoke(this, clone);
|
SpawnedPrefab.Invoke(this, clone);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -270,7 +285,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
if (GrabbableMustBeHeld && grabbable.GrabberCount != 1)
|
if (GrabbableMustBeHeld && grabbable.GrabberCount != 1)
|
||||||
return false;
|
return false;
|
||||||
var handGrabber = grabbable.PrimaryGrabber as HVRHandGrabber;
|
var handGrabber = grabbable.PrimaryGrabber as HVRHandGrabber;
|
||||||
if (handGrabber == null)
|
if (!handGrabber)
|
||||||
return false;
|
return false;
|
||||||
if (_timeoutGrabbable && _timeoutGrabbable == grabbable)
|
if (_timeoutGrabbable && _timeoutGrabbable == grabbable)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -282,6 +297,7 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.CanHover(grabbable);
|
return base.CanHover(grabbable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -309,7 +325,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
grabbable.Released.AddListener(OnHoverGrabbableReleased);
|
grabbable.Released.AddListener(OnHoverGrabbableReleased);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
base.OnHoverEnter(grabbable);
|
base.OnHoverEnter(grabbable);
|
||||||
if (HoverActions != null)
|
if (HoverActions != null)
|
||||||
{
|
{
|
||||||
|
|
@ -359,7 +374,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
if (CanAddGrabbable && TryGrab(grabbable))
|
if (CanAddGrabbable && TryGrab(grabbable))
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -429,6 +443,11 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
|
|
||||||
public virtual bool IsValid(HVRGrabbable grabbable)
|
public virtual bool IsValid(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
|
if (LinkedGrabbable)
|
||||||
|
{
|
||||||
|
return LinkedGrabbable == grabbable;
|
||||||
|
}
|
||||||
|
|
||||||
if (grabbable.IsStabbing && !CanGrabStabbingGrabbable || grabbable.IsStabbed || !grabbable.Socketable)
|
if (grabbable.IsStabbing && !CanGrabStabbingGrabbable || grabbable.IsStabbed || !grabbable.Socketable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -476,30 +495,8 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
_previousParent = grabbable.transform.parent;
|
_previousParent = grabbable.transform.parent;
|
||||||
_previousScale = grabbable.transform.localScale;
|
_previousScale = grabbable.transform.localScale;
|
||||||
|
|
||||||
if (grabbable.Socketable && grabbable.Socketable.ScaleOverride)
|
|
||||||
{
|
|
||||||
var scaleBox = grabbable.Socketable.ScaleOverride;
|
|
||||||
|
|
||||||
var temp = scaleBox.enabled;
|
AttachGrabbable(grabbable);
|
||||||
|
|
||||||
if (!scaleBox.enabled)
|
|
||||||
{
|
|
||||||
scaleBox.enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
_modelBounds = scaleBox.bounds;
|
|
||||||
|
|
||||||
if (!temp)
|
|
||||||
{
|
|
||||||
scaleBox.enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_modelBounds = grabbable.ModelBounds;
|
|
||||||
}
|
|
||||||
|
|
||||||
grabbable.transform.parent = transform;
|
|
||||||
OnGrabbableParented(grabbable);
|
OnGrabbableParented(grabbable);
|
||||||
HandleRigidBodyGrab(grabbable);
|
HandleRigidBodyGrab(grabbable);
|
||||||
PlaySocketedSFX(grabbable.Socketable);
|
PlaySocketedSFX(grabbable.Socketable);
|
||||||
|
|
@ -510,44 +507,51 @@ 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;
|
||||||
return Vector3.zero;
|
|
||||||
return grabbable.Socketable.SocketOrientation.localPosition;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual Quaternion GetRotationOffset(HVRGrabbable grabbable)
|
/// <summary>
|
||||||
{
|
/// Returns the socketed local position
|
||||||
if (!grabbable || !grabbable.Socketable || !grabbable.Socketable.SocketOrientation)
|
/// </summary>
|
||||||
return Quaternion.identity;
|
public virtual Vector3 GetTargetPosition(HVRGrabbable grabbable)
|
||||||
return grabbable.Socketable.SocketOrientation.localRotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual Vector3 GetTargetPosition(HVRGrabbable grabbable)
|
|
||||||
{
|
|
||||||
var offSet = -GetPositionOffset(grabbable);
|
|
||||||
var delta = Quaternion.Inverse(GetRotationOffset(grabbable));
|
|
||||||
offSet = delta * offSet;
|
|
||||||
|
|
||||||
offSet.x *= grabbable.transform.localScale.x;
|
|
||||||
offSet.y *= grabbable.transform.localScale.y;
|
|
||||||
offSet.z *= grabbable.transform.localScale.z;
|
|
||||||
|
|
||||||
return offSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual Quaternion GetTargetRotation(HVRGrabbable grabbable)
|
|
||||||
{
|
{
|
||||||
var socketable = grabbable.Socketable;
|
var socketable = grabbable.Socketable;
|
||||||
|
if (!grabbable || !socketable)
|
||||||
|
return Vector3.zero;
|
||||||
|
|
||||||
if (socketable.SocketOrientation)
|
if (socketable.SocketOrientation)
|
||||||
{
|
{
|
||||||
var rotationOffset = GetRotationOffset(grabbable);
|
var offSet = -socketable.SocketOrientation.localPosition;
|
||||||
return Quaternion.Inverse(rotationOffset);
|
var delta = Quaternion.Inverse(socketable.SocketOrientation.localRotation);
|
||||||
|
offSet = delta * offSet;
|
||||||
|
|
||||||
|
offSet.x *= grabbable.transform.localScale.x;
|
||||||
|
offSet.y *= grabbable.transform.localScale.y;
|
||||||
|
offSet.z *= grabbable.transform.localScale.z;
|
||||||
|
|
||||||
|
return offSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Quaternion.identity;
|
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)
|
||||||
|
{
|
||||||
|
return Quaternion.Inverse(socketable.SocketOrientation.localRotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
return socketable.GetRotationOffset(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnGrabbableParented(HVRGrabbable grabbable)
|
protected virtual void OnGrabbableParented(HVRGrabbable grabbable)
|
||||||
|
|
@ -572,55 +576,71 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
if (!grabbable.Rigidbody)
|
if (!grabbable.Rigidbody)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
_rbKinematic = grabbable.Rigidbody.isKinematic;
|
||||||
|
_rbInterpolation = grabbable.Rigidbody.interpolation;
|
||||||
|
|
||||||
|
|
||||||
switch (HoldType)
|
switch (HoldType)
|
||||||
{
|
{
|
||||||
case SocketHoldType.Kinematic:
|
case SocketHoldType.Kinematic:
|
||||||
{
|
{
|
||||||
grabbable.Rigidbody.useGravity = false;
|
grabbable.Rigidbody.velocity = Vector3.zero;
|
||||||
grabbable.Rigidbody.velocity = Vector3.zero;
|
grabbable.Rigidbody.angularVelocity = Vector3.zero;
|
||||||
grabbable.Rigidbody.angularVelocity = Vector3.zero;
|
grabbable.Rigidbody.collisionDetectionMode = CollisionDetectionMode.ContinuousSpeculative;
|
||||||
grabbable.Rigidbody.collisionDetectionMode = CollisionDetectionMode.ContinuousSpeculative;
|
grabbable.Rigidbody.isKinematic = true;
|
||||||
grabbable.Rigidbody.isKinematic = true;
|
grabbable.Rigidbody.interpolation = RigidbodyInterpolation.None;
|
||||||
grabbable.Rigidbody.interpolation = RigidbodyInterpolation.None;
|
if (DisableCollision) grabbable.SetAllToTrigger();
|
||||||
if (DisableCollision) grabbable.SetAllToTrigger();
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case SocketHoldType.RemoveRigidbody:
|
case SocketHoldType.RemoveRigidbody:
|
||||||
|
{
|
||||||
|
_hadRigidBody = true;
|
||||||
|
_rbMass = grabbable.Rigidbody.mass;
|
||||||
|
_rbGravity = grabbable.Rigidbody.useGravity;
|
||||||
|
_rbDrag = grabbable.Rigidbody.drag;
|
||||||
|
_rbAngularDrag = grabbable.Rigidbody.angularDrag;
|
||||||
|
|
||||||
|
if (Rigidbody)
|
||||||
{
|
{
|
||||||
_hadRigidBody = true;
|
_socketMass = Rigidbody.mass;
|
||||||
|
Rigidbody.mass += _rbMass;
|
||||||
if (Rigidbody)
|
|
||||||
{
|
|
||||||
_mass = Rigidbody.mass;
|
|
||||||
Rigidbody.mass += grabbable.Rigidbody.mass;
|
|
||||||
}
|
|
||||||
|
|
||||||
Destroy(grabbable.Rigidbody);
|
|
||||||
if (_fixPositionRoutine != null)
|
|
||||||
{
|
|
||||||
StopCoroutine(_fixPositionRoutine);
|
|
||||||
}
|
|
||||||
_fixPositionRoutine = StartCoroutine(SetPositionNextFrame(grabbable));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Destroy(grabbable.Rigidbody);
|
||||||
|
if (_fixPositionRoutine != null)
|
||||||
|
{
|
||||||
|
StopCoroutine(_fixPositionRoutine);
|
||||||
|
}
|
||||||
|
|
||||||
|
_fixPositionRoutine = StartCoroutine(SetPositionNextFrame(grabbable));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void CleanupRigidBody(HVRGrabbable grabbable)
|
protected virtual void CleanupRigidBody(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
|
var rb = grabbable.Rigidbody;
|
||||||
if (HoldType == SocketHoldType.RemoveRigidbody && _hadRigidBody)
|
if (HoldType == SocketHoldType.RemoveRigidbody && _hadRigidBody)
|
||||||
{
|
{
|
||||||
grabbable.Rigidbody = grabbable.gameObject.AddComponent<Rigidbody>();
|
rb = grabbable.Rigidbody = grabbable.gameObject.AddComponent<Rigidbody>();
|
||||||
if (Rigidbody)
|
if (Rigidbody)
|
||||||
{
|
{
|
||||||
Rigidbody.mass = _mass;
|
Rigidbody.mass = _socketMass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rb.useGravity = _rbGravity;
|
||||||
|
rb.mass = _rbMass;
|
||||||
|
rb.drag = _rbDrag;
|
||||||
|
rb.angularDrag = _rbAngularDrag;
|
||||||
}
|
}
|
||||||
|
|
||||||
grabbable.ResetRigidBody();
|
if (rb)
|
||||||
|
{
|
||||||
|
rb.collisionDetectionMode = grabbable.OriginalCollisionMode;
|
||||||
|
rb.isKinematic = _rbKinematic;
|
||||||
|
rb.interpolation = _rbInterpolation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator SetPositionNextFrame(HVRGrabbable grabbable)
|
private IEnumerator SetPositionNextFrame(HVRGrabbable grabbable)
|
||||||
|
|
@ -677,21 +697,27 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
if (SFXPlayer.Instance) SFXPlayer.Instance.PlaySFX(clip, transform.position);
|
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)
|
protected virtual void UpdateScale(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
if (!grabbable || !ScaleGrabbable)
|
if (!grabbable || !ScaleGrabbable)
|
||||||
return;
|
return;
|
||||||
var extents = _modelBounds.extents;
|
|
||||||
var axis = extents.x;
|
var finalScale = ComputeScale(grabbable.Socketable);
|
||||||
if (extents.y > axis) axis = extents.y;
|
grabbable.transform.localScale = finalScale;
|
||||||
if (extents.z > axis) axis = extents.z;
|
}
|
||||||
axis *= 2;
|
|
||||||
|
public virtual Vector3 ComputeScale(HVRSocketable socketable)
|
||||||
|
{
|
||||||
|
var axis = GetSocketableScaleSize(socketable);
|
||||||
var ratio = Size / axis;
|
var ratio = Size / axis;
|
||||||
ratio *= grabbable.Socketable.SocketScale;
|
ratio *= socketable.SocketScale;
|
||||||
var counterScale = grabbable.Socketable.CounterScale;
|
var counterScale = socketable.CounterScale;
|
||||||
grabbable.transform.localScale = new Vector3(ratio * counterScale.x, ratio * counterScale.y, ratio * counterScale.z);
|
return new Vector3(ratio * counterScale.x, ratio * counterScale.y, ratio * counterScale.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnReleased(HVRGrabbable grabbable)
|
protected override void OnReleased(HVRGrabbable grabbable)
|
||||||
|
|
@ -744,8 +770,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected virtual IEnumerator GrabTimeoutRoutine(HVRGrabbable grabbable)
|
protected virtual IEnumerator GrabTimeoutRoutine(HVRGrabbable grabbable)
|
||||||
{
|
{
|
||||||
_timeoutGrabbable = grabbable;
|
_timeoutGrabbable = grabbable;
|
||||||
|
|
@ -790,7 +814,6 @@ namespace HurricaneVR.Framework.Core.Grabbers
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class SocketSpawnEvent : UnityEvent<HVRSocket, GameObject>
|
public class SocketSpawnEvent : UnityEvent<HVRSocket, GameObject>
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum SocketCondition
|
public enum SocketCondition
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HurricaneVR.Framework.Core.Grabbers
|
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 class HVRSocketContainerGrabber : HVRGrabberBase
|
||||||
{
|
{
|
||||||
public HVRSocketContainer SocketContainer;
|
public HVRSocketContainer SocketContainer;
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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
Loading…
Reference in New Issue