15 ref Collider[][] collidingCandidates,
16 ref
int[] numberOfColliders,
17 bool ignoreTemporal =
false) {
25 for (
int j = 0; j < classifier.
probes.Length; j++) {
32 bool collidingWithObject =
false;
33 for (
int i = 0; i < numberOfColliders[j]; i++) {
34 if (collidingCandidates[j][i].attachedRigidbody !=
null && collidingCandidates[j][i].attachedRigidbody == classifier.
body) {
35 collidingWithObject =
true;
41 float conditionalMaxCurlVelocity = (classifier.
isGrabbed ?
44 collidingWithObject = collidingWithObject
48 || curlVelocity < conditionalMaxCurlVelocity);
82 bool nearObject =
false;
84 for (
int i = 0; i < numberOfColliders[5]; i++) {
85 if (collidingCandidates[5][i].attachedRigidbody !=
null && collidingCandidates[5][i].attachedRigidbody == classifier.
body) {
106 for (
int i = 0; i < 5; i++) {
107 numberOfColliders[i] =
Physics.OverlapCapsuleNonAlloc(
108 point0: aPositions[i],
109 point1: bPositions[i],
111 results: collidingCandidates[i],
135 body = behaviour.GetComponent<Rigidbody>();
165 public ClassifierParameters(
float fingerStickiness = 0f,
float thumbStickiness = 0.05f,
float maxCurl = 0.65f,
float minCurl = -0.1f,
float fingerRadius = 0.01f,
float thumbRadius = 0.015f,
float grabCooldown = 0.2f,
float maxCurlVel = 0.0f,
float grabbedMaxCurlVel = -0.05f,
float maxHandDist = 0.1f,
int layerMask = 0, QueryTriggerInteraction queryTriggers = QueryTriggerInteraction.UseGlobal) {
GrabClassifier(GameObject behaviour)
bool isThisControllerGrabbing
bool prevThisControllerGrabbing
static void UpdateAllProbeColliders(Vector3[] aPositions, Vector3[] bPositions, ref Collider[][] collidingCandidates, ref int[] numberOfColliders, ClassifierParameters grabParameters)
static void UpdateClassifier(GrabClassifier classifier, ClassifierParameters grabParameters, ref Collider[][] collidingCandidates, ref int[] numberOfColliders, bool ignoreTemporal=false)
ClassifierParameters(float fingerStickiness=0f, float thumbStickiness=0.05f, float maxCurl=0.65f, float minCurl=-0.1f, float fingerRadius=0.01f, float thumbRadius=0.015f, float grabCooldown=0.2f, float maxCurlVel=0.0f, float grabbedMaxCurlVel=-0.05f, float maxHandDist=0.1f, int layerMask=0, QueryTriggerInteraction queryTriggers=QueryTriggerInteraction.UseGlobal)
QueryTriggerInteraction GRAB_TRIGGERS
float MAXIMUM_CURL
The minimum and maximum curl values fingers are allowed to "Grab" within
float MAXIMUM_CURL_VELOCITY
The maximum rate that the fingers are extending where grabs are considered.
float FINGERTIP_RADIUS
The radius considered for intersection around the fingertips
float GRAB_COOLDOWN
The minimum amount of time between repeated grabs of a single object
float MAXIMUM_DISTANCE_FROM_HAND
float GRABBED_MAXIMUM_CURL_VELOCITY
float FINGER_STICKINESS
The amount of curl hysteresis on each finger type