VR Game: unexpected collider reaction

Issue:

I am getting unexpected or no collisions between an object controlled by VR peripherals and a basic primitive shape with a collider in my scene

Context:

I’m currently building a VR game that uses peripherals to control my hands in VR.

Peripherals:

  • Worldviz’s PPT cameras for position tracking (vrpn)
  • CyberGloveSystems’s cg3 gloves for finger joint angle tracking (serial com)
  • Intersense’s InertiaCube4 for orientation tracking (serial com)

I currently have all these peripherals accurately controlling a hand model in my scene. I’ve created collision boxes for all the portions of the hand model so that they can interact with other collider objects. For the hand model collisions I am using the following rigidbody settings:

  • not using Gravity
  • not isKinematic
  • Collision Detection set to Continuous Dynamic
  • all position and rotation constraints enabled to prevent drifting and since the physics object isn’t being influenced by external forces (controlled directly by the position tracking cameras)

The colliders have all been sized appropriately and are not isTrigger:

2877965--211105--upload_2016-12-7_14-34-34.png

The object I am trying to interact with is simply a cube on a table. These are its settings:

When I attempt to move the box using my hand, I don’t get any collision OR I get unexpected collisions around the wrist area of the model.

I’ve been having a hard time figuring out why this might be happening. At first I thought this might be b/c of the multiple smaller collision boxes on the hand model so I replaced the controlled object with another cube with a basic box collider, but I was still getting the same unexpected reaction. Then I thought it might be the way the vrpn plugin is controlling the position of the gameobject, so I tried controlling an empty gameobject with the vrpn pluging for the position tracking cameras; then used the position of that gameobject as a reference to position my hand model. Still the same unexpected reaction.

Would there be any reason for the collision boxes to be offset during run-time?

If anyone has any ideas it would be GREATLY appreciated!

What I’ve noticed recently while debugging:

  • I noticed that I can click “apply” to the hand model prefab during run-time. When I click on it, it improves the collisions, but still isn’t consistent; and I lose the orientation tracking.

That sounds very weird to me. If the rigidbodies are being controlled by the position tracking cameras then all them should be kinematic, and their position/rotation set via rigidbody.MovePosition and rigidbody.MoveRotation on each FixedUpdate. Do not modify the Transform directly. Disable all those constraints as well.

Thanks for the tips Edy,

I implemented your recommendation and the collisions are working now. However one thing I noticed when controlling the hand with Rigidbody.MovePosition and .MoveRotation, the movement is visually more laggy than when I controlled it directly through the transform even though the drag and angular drag are set to zero. Do you know why this might be?

Maybe for the interpolation? (Rigidbody.interpolation) When interpolation is disabled then the kinematic rigidbodies should move at almost the same rate as if modifying the transform. You might also try reducing the fixed timestep to 0.01 (Edit > Project Settings > Time) so the physics updates at 100Hz (default is 50Hz).