Discussions

Ask a Question
Back to All

How are the NVRHand colliders duplicated?

I'm trying to get a LeapMotion working with pinch-to-grab. At some point this is also going to move into using data gloves, so this is code I'd really love to be able to keep, or at least port fairly easily.

I've derived NVRInputDevice to create a new class that maps a pinch gesture to the Grip button, and wired things up so that it creates an appropriate new input device when the LeapMotion detects a hand. I've also derived NVRHand because the LeapMotion's hierarchy is a little wonky. The one thing I can't seem to figure out is how to get the NVRHand collider methods to trigger.

From what I can tell -- correct me if I'm wrong -- there are copies of the NVRHands that get created, marked [Physical]. These copies have the colliders attached that are fetched via NVRInputDevice::SetupDefaultPhysicalColliders(). But I can't seem to figure out where those colliders are actually attached to the cloned hands. My derived NVRHands are cloning fine - they just don't have the colliders correctly attached, and I think that's what's causing my issues with pinch to grab.

I've verified that my derived SetupDefaultPhysicalColliders() and SetupDefaultColliders() are returning the proper colliders. They're just not being applied to the cloned hands, and I can't seem to find where in the NVR code that happens.

Thanks!