void Start() { HandStateSource[] sources = sourceGameObject.GetComponents <HandStateSource>(); Debug.Assert(sources.Length == 1); source = sources[0]; reprs = new GameObject[2, HandState.NUM_CAPSULEPARTS * 3]; system = FindObjectOfType <TrueHandlingPhysics>(); }
void Start() { //configure collision matrix: no intercollision and otherwise inherit default handCollisionLayerCollideMask = 0; for (int i = 0; i < 32; i++) { if (i == handCollisionLayer) { Physics.IgnoreLayerCollision(handCollisionLayer, i, true); } else { if (Physics.GetIgnoreLayerCollision(0, i)) { Physics.IgnoreLayerCollision(handCollisionLayer, i, true); } else { Physics.IgnoreLayerCollision(handCollisionLayer, i, false); handCollisionLayerCollideMask |= 1 << i; } } } HandStateSource[] sources = sourceGameObject.GetComponents <HandStateSource>(); Debug.Assert(sources.Length == 1); source = sources[0]; source.FixedUpdateDone += FixedUpdatePropagation; triggerBuffer = new Collider[32]; raycastBuffer = new RaycastHit[32]; boneMaterialOverride = new Material[2, HandState.NUM_BONES]; boneManager = new PhysicsBoneManager[2, HandState.NUM_BONES]; objectCarriers = new Dictionary <GameObject, GameObject>(); //objectCarrierProxies = new Dictionary<GameObject, GameObject>(); noCollided = new List <KeyValuePair <CapsuleCollider, Collider> >(); }