VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
AVR.Phys.AVR_BasicGrabProvider Class Reference

Simplest GrabProvider. Grabbed objects will move their center (obj.transform.position) towards the respective grabpoint. More...

Inheritance diagram for AVR.Phys.AVR_BasicGrabProvider:
AVR.Core.AVR_ControllerComponent AVR.Core.AVR_Component AVR.Core.AVR_Behaviour AVR.Phys.AVR_OffsetGrabProvider AVR.Phys.AVR_AdvancedOffsetGrabProvider

Public Member Functions

AVR_Grabbable getGrabbedObject ()
 Object that is currently being grabbed. Null if no object is being grabbed More...
 
virtual Vector3 getLocalGrabLocation ()
 Offset at which an object is being grabbed. Meaning: grab-position in local coordiantes relative to the grabbed object. For instance: If we grab a Pan by its handle, this value will correspond to the pans handle in local coordiantes. If no object is grabbed, returns Vector3.zero. More...
 
virtual Vector3 getWorldGrabLocation ()
 Location at which the object is being grabbed in world coordinates. Example: If we grab a pan by its handle, the handles world coordinates will correspond to this. Returns Vector3.zero if no object is being grabbed. More...
 
virtual Vector3 getTargetPosition ()
 Target position the grabbed object should "strive" towards in world coordiantes. There will be force pulling getWorldGrabPosition and getTargetPosition together. More...
 
virtual Quaternion getTargetRotation ()
 Target rotation the grabbed object should "strive" towards in world space. There will be force trying to make the objects rotation and this rotation equal. More...
 
virtual Transform getTargetTransform ()
 getTargetPosition() and getTargetRotation() combined into one transform. The grabbed objects transform will strive to adopt these values over time. More...
 
virtual void makeGrab ()
 Performs a grab on whichever object the GrabbableFinder returns. Is called when the respective "grabEvent" is true. More...
 
virtual void makeGrab (GrabLocation location)
 Perform a grab on with parameters given in a GrabLocation struct More...
 
virtual void makeRelease ()
 Ends a grab. Is called when the respective "releaseEvent" is true. More...
 
- Public Member Functions inherited from AVR.Core.AVR_Behaviour
virtual void OnDestroy ()
 

Public Attributes

UnityEvent OnGrab
 Executed when an object is (successfully) grabbed. More...
 
UnityEvent OnRelease
 Executed when a grabbed object is released. More...
 
bool isGrabbing => grabbedObject != null
 Returns true if this provider is currently grabbing an object. More...
 
AVR_ControllerInputManager.BoolEvent grabEvent
 Event that commences a grab. (Such as ONTRIGGERDOWN) More...
 
AVR_ControllerInputManager.BoolEvent releaseEvent
 Event that ends a grab. (Such as ONTRIGGERUP) More...
 
Transform grabPoint
 Transform of the location an object is grabbed towards (Typically the palm of your hand). Will be set automatically to the local transfrom if null. More...
 
AVR_GrabbableFinder grabbableFinder
 Area from which the player may grab an object. Required for the grabprovider to work. More...
 
- Public Attributes inherited from AVR.Core.AVR_Component
UnityEngine.Events.UnityEvent onAwake
 Events called when this component awakes. More...
 
UnityEngine.Events.UnityEvent onStart
 Events called when this component starts. More...
 
UnityEngine.Events.UnityEvent onEnable
 Events called when this component is enabled. More...
 
UnityEngine.Events.UnityEvent onDisable
 Events called when this component is disabled. More...
 

Protected Member Functions

override void Start ()
 
virtual void Update ()
 
- Protected Member Functions inherited from AVR.Core.AVR_ControllerComponent
override void Awake ()
 
- Protected Member Functions inherited from AVR.Core.AVR_Component
virtual void OnEnable ()
 
virtual void OnDisable ()
 

Protected Attributes

AVR_Grabbable grabbedObject => grabLocation!=null ? grabLocation.grabbable : null
 Object that is currently being grabbed. Null if no object is being grabbed More...
 
GrabLocation grabLocation
 
- Protected Attributes inherited from AVR.Core.AVR_Behaviour
AVR_PlayerRig playerRig => AVR_PlayerRig.Instance
 The current AVR_PlayerRig instance in the scene More...
 
AVR_Root root => AVR_Root.Instance
 The current AVR_Root instance in the scene More...
 
bool vrEnabled => UnityEngine.XR.XRSettings.enabled
 True if the application is running as a VR/XR application More...
 

Additional Inherited Members

- Properties inherited from AVR.Core.AVR_ControllerComponent
AVR_Controller controller [get, set]
 

Detailed Description

Simplest GrabProvider. Grabbed objects will move their center (obj.transform.position) towards the respective grabpoint.

Definition at line 13 of file AVR_BasicGrabProvider.cs.