Forum Discussion
maximusthegreatest
5 months agoHonored Guest
JointDistanceActiveState
Hi, I'm trying to make a distance check on both hands using the JointDistanceActiveState.cs script and it looks like it only accepts a threshhold within a distance. I propose there be a Boolean added something like "checkGreaterThanThreshold" and then have the logic change if greater than for that operation.
Example:
private bool JointDistanceWithinThreshold()
{
if (HandA.GetJointPose(JointIdA, out Pose poseA) &&
HandB.GetJointPose(JointIdB, out Pose poseB))
{
float threshold = _internalState ?
_distance + _thresholdWidth * 0.5f :
_distance - _thresholdWidth * 0.5f;
if(checkGreaterThanThreshold)
{
return Vector3.Distance(poseA.position, poseB.position) >= threshold;
} else
{
return Vector3.Distance(poseA.position, poseB.position) <= threshold;
}
}
else
{
return false;
}
}
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device