VR Interaction Framework  1.0
A vr framework for the Oculus Quest
BNG.Grabbable Class Reference

An object that can be picked up by a Grabber More...

Inheritance diagram for BNG.Grabbable:
BNG.Climbable

Public Member Functions

void AddValidGrabber (Grabber grabber)
 
void RemoveValidGrabber (Grabber grabber)
 
virtual void GrabItem (Grabber grabbedBy)
 
virtual void GrabRemoteItem (Grabber grabbedBy)
 
void ResetGrabbing ()
 
virtual void DropItem (bool resetVelocity, bool resetParent)
 
virtual void DropItem ()
 
ControllerHand GetControllerHand ()
 
Grabber GetGrabber ()
 
virtual bool IsValidCollision (Collision collision)
 

Public Attributes

bool BeingHeld = false
 
bool RemoteGrabbable = false
 Can the object be picked up from far away. More...
 
float RemoteGrabDistance = 2f
 
GrabButton GrabButton = GrabButton.Grip
 Configure which button is used to initiate the grab More...
 
HoldType Grabtype = HoldType.HoldDown
 Should the Grab Button be held down, or can it be toggle on and off More...
 
GrabPhysics GrabPhysics = GrabPhysics.PhysicsJoint
 Kinematic Physics locks the object in place on the hand / grabber. More...
 
GrabType GrabMechanic = GrabType.Snap
 Snap to a location or grab anywhere on the object More...
 
float GrabSpeed = 7.5f
 How fast to Lerp the object to the hand More...
 
float ThrowForceMultiplier = 2f
 Multiply controller's velocity times this when throwing More...
 
float ThrowForceMultiplierAngular = 1.5f
 Multiply controller's angular velocity times this when throwing More...
 
bool HideHandGraphics = false
 Enabling this will hide the Transform specified in the Grabber's HandGraphics property More...
 
bool ParentToHands = true
 Parent this object to the hands for better stability. More...
 
bool ParentHandModel = false
 If true, the hand model will be attached to the grabbed object More...
 
Grabbable OtherGrabbableMustBeGrabbed = null
 The Grabbable can only be grabbed if this grabbable is being held. More...
 
float CollisionSpring = 3000
 How much Spring Force to apply to the joint when something comes in contact with the grabbable A higher Spring Force will make the Grabbable more rigid More...
 
float CollisionSlerp = 500
 How much Slerp Force to apply to the joint when something is in contact with the grabbable A higher Slerp value More...
 
Vector3 GrabPositionOffset = Vector3.zero
 If GrabMechanic is set to Snap, offset local position by this amount More...
 
Vector3 GrabRotationOffset = Vector3.zero
 If GrabMechanic is set to Snap, offset local rotation by this amount More...
 
bool MirrorOffsetForOtherHand = true
 

Protected Attributes

Grabber heldBy
 The grabber that is currently holding us. More...
 
float grabTime
 
InputBridge input
 
GrabbableEvents events
 

Properties

bool IsGrabbable [get]
 
Transform grabTransform [get]
 

Detailed Description

An object that can be picked up by a Grabber

Member Function Documentation

◆ AddValidGrabber()

void BNG.Grabbable.AddValidGrabber ( Grabber  grabber)

◆ DropItem() [1/2]

virtual void BNG.Grabbable.DropItem ( )
virtual

Reimplemented in BNG.Climbable.

◆ DropItem() [2/2]

virtual void BNG.Grabbable.DropItem ( bool  resetVelocity,
bool  resetParent 
)
virtual

◆ GetControllerHand()

ControllerHand BNG.Grabbable.GetControllerHand ( )

◆ GetGrabber()

Grabber BNG.Grabbable.GetGrabber ( )

◆ GrabItem()

virtual void BNG.Grabbable.GrabItem ( Grabber  grabbedBy)
virtual

Reimplemented in BNG.Climbable.

◆ GrabRemoteItem()

virtual void BNG.Grabbable.GrabRemoteItem ( Grabber  grabbedBy)
virtual

◆ IsValidCollision()

virtual bool BNG.Grabbable.IsValidCollision ( Collision  collision)
virtual

◆ RemoveValidGrabber()

void BNG.Grabbable.RemoveValidGrabber ( Grabber  grabber)

◆ ResetGrabbing()

void BNG.Grabbable.ResetGrabbing ( )

Member Data Documentation

◆ BeingHeld

bool BNG.Grabbable.BeingHeld = false

◆ CollisionSlerp

float BNG.Grabbable.CollisionSlerp = 500

How much Slerp Force to apply to the joint when something is in contact with the grabbable A higher Slerp value

◆ CollisionSpring

float BNG.Grabbable.CollisionSpring = 3000

How much Spring Force to apply to the joint when something comes in contact with the grabbable A higher Spring Force will make the Grabbable more rigid

◆ events

GrabbableEvents BNG.Grabbable.events
protected

◆ GrabButton

GrabButton BNG.Grabbable.GrabButton = GrabButton.Grip

Configure which button is used to initiate the grab

◆ GrabMechanic

GrabType BNG.Grabbable.GrabMechanic = GrabType.Snap

Snap to a location or grab anywhere on the object

◆ GrabPhysics

GrabPhysics BNG.Grabbable.GrabPhysics = GrabPhysics.PhysicsJoint

Kinematic Physics locks the object in place on the hand / grabber.

PhysicsJoint allows collisions with the environment.

◆ GrabPositionOffset

Vector3 BNG.Grabbable.GrabPositionOffset = Vector3.zero

If GrabMechanic is set to Snap, offset local position by this amount

◆ GrabRotationOffset

Vector3 BNG.Grabbable.GrabRotationOffset = Vector3.zero

If GrabMechanic is set to Snap, offset local rotation by this amount

◆ GrabSpeed

float BNG.Grabbable.GrabSpeed = 7.5f

How fast to Lerp the object to the hand

◆ grabTime

float BNG.Grabbable.grabTime
protected

◆ Grabtype

HoldType BNG.Grabbable.Grabtype = HoldType.HoldDown

Should the Grab Button be held down, or can it be toggle on and off

◆ heldBy

Grabber BNG.Grabbable.heldBy
protected

The grabber that is currently holding us.

Null if not being held

◆ HideHandGraphics

bool BNG.Grabbable.HideHandGraphics = false

Enabling this will hide the Transform specified in the Grabber's HandGraphics property

◆ input

InputBridge BNG.Grabbable.input
protected

◆ MirrorOffsetForOtherHand

bool BNG.Grabbable.MirrorOffsetForOtherHand = true

◆ OtherGrabbableMustBeGrabbed

Grabbable BNG.Grabbable.OtherGrabbableMustBeGrabbed = null

The Grabbable can only be grabbed if this grabbable is being held.

Example : If you only want a weapon part to be grabbable if the weapon itself is being held.

◆ ParentHandModel

bool BNG.Grabbable.ParentHandModel = false

If true, the hand model will be attached to the grabbed object

◆ ParentToHands

bool BNG.Grabbable.ParentToHands = true

Parent this object to the hands for better stability.

Not recommended for child grabbers

◆ RemoteGrabbable

bool BNG.Grabbable.RemoteGrabbable = false

Can the object be picked up from far away.

Must be within RemoteGrabber Trigger

◆ RemoteGrabDistance

float BNG.Grabbable.RemoteGrabDistance = 2f

◆ ThrowForceMultiplier

float BNG.Grabbable.ThrowForceMultiplier = 2f

Multiply controller's velocity times this when throwing

◆ ThrowForceMultiplierAngular

float BNG.Grabbable.ThrowForceMultiplierAngular = 1.5f

Multiply controller's angular velocity times this when throwing

Property Documentation

◆ grabTransform

Transform BNG.Grabbable.grabTransform
getprotected

◆ IsGrabbable

bool BNG.Grabbable.IsGrabbable
get

The documentation for this class was generated from the following file: