Esempio n. 1
0
        private void ExternalTouch_EndCollision(object sender, CollisionInfo3D info)
        {
            var otherEntity = this.UnregisterCollidedEntity(info);

            this.externalTouchCollisionEntities.Remove(otherEntity);
            this.RemoveFocusableInteraction(otherEntity);
        }
Esempio n. 2
0
        private void Cursor_UpdateCollision(object sender, CollisionInfo3D info)
        {
            var cursorEntity     = info.ThisBody.Owner;
            var interactedEntity = info.OtherBody.Owner;

            this.RunTouchHandlers(cursorEntity, interactedEntity, (h, e) => h?.OnTouchUpdated(e));
        }
Esempio n. 3
0
 private void InternalTouch_UpdateCollision(object sender, CollisionInfo3D info)
 {
     if (this.collisionEntitiesByCollisionId.TryGetValue(info.Id, out var interactedEntity) &&
         this.nearTouchCollisionEntities.Contains(interactedEntity))
     {
         this.RunTouchHandlers(interactedEntity, (h, e) => h?.OnTouchUpdated(e));
     }
 }
Esempio n. 4
0
        private Entity RegisterCollidedEntity(CollisionInfo3D info)
        {
            this.UnregisterCollidedEntity(info);

            var otherEntity = info.OtherBody.Owner;

            this.collisionEntitiesByCollisionId.Add(info.Id, otherEntity);
            return(otherEntity);
        }
        private void Cursor_EndCollision(object sender, CollisionInfo3D info)
        {
            var cursorEntity     = info.ThisBody.Owner;
            var interactedEntity = info.OtherBody.Owner;

            this.RunTouchHandlers(cursorEntity, interactedEntity, (h, e) => h?.OnTouchCompleted(e));

            this.cursorCollisions.Remove(cursorEntity);
        }
Esempio n. 6
0
        private Entity UnregisterCollidedEntity(CollisionInfo3D info)
        {
            if (this.collisionEntitiesByCollisionId.TryGetValue(info.Id, out var otherEntity))
            {
                this.collisionEntitiesByCollisionId.Remove(info.Id);
                return(otherEntity);
            }

            return(null);
        }
Esempio n. 7
0
        private void InternalTouch_EndCollision(object sender, CollisionInfo3D info)
        {
            var interactedEntity = this.UnregisterCollidedEntity(info);

            this.RemovePointerInteraction(interactedEntity);

            if (this.nearTouchCollisionEntities.Remove(interactedEntity))
            {
                this.RunTouchHandlers(interactedEntity, (h, e) => h?.OnTouchCompleted(e));
            }
        }
Esempio n. 8
0
        private void InternalTouch_BeginCollision(object sender, CollisionInfo3D info)
        {
            var interactedEntity = this.RegisterCollidedEntity(info);

            this.AddPointerInteraction(interactedEntity);

            this.RunTouchHandlers(interactedEntity, (h, e) =>
            {
                this.nearTouchCollisionEntities.Add(interactedEntity);
                h?.OnTouchStarted(e);
            });
        }
        private void Cursor_BeginCollision(object sender, CollisionInfo3D info)
        {
            var cursorEntity     = info.ThisBody.Owner;
            var interactedEntity = info.OtherBody.Owner;

            this.RunTouchHandlers(cursorEntity, interactedEntity, (h, e) => h?.OnTouchStarted(e));

            if (!this.cursorCollisions.ContainsKey(cursorEntity))
            {
                this.cursorCollisions[cursorEntity] = interactedEntity;
            }
        }
Esempio n. 10
0
        private void ExternalTouch_BeginCollision(object sender, CollisionInfo3D info)
        {
            var otherEntity = this.RegisterCollidedEntity(info);

            var hasHandler = otherEntity.HasEventHandlers <IMixedRealityTouchHandler, IMixedRealityPointerHandler>();

            if (hasHandler)
            {
                this.externalTouchCollisionEntities.Add(otherEntity);
            }

            this.AddFocusableInteraction(otherEntity);
        }
Esempio n. 11
0
        private void PhysicBody_BeginCollision(object sender, CollisionInfo3D e)
        {
            var otherBodyEntity = e.OtherBody.Owner;

            Debug.WriteLine($"Ship collided with {otherBodyEntity.Name}");
            if (otherBodyEntity.Name.StartsWith("asteroid"))
            {
                if (otherBodyEntity.IsVisible)
                {
                    this.GameOver();
                }
            }
        }
Esempio n. 12
0
 private void Body_BeginCollision(object sender, CollisionInfo3D e)
 {
     this.bodyCollision = true;
 }
Esempio n. 13
0
 private void Body_EndCollision(object sender, CollisionInfo3D e)
 {
     this.bodyCollision = false;
 }
Esempio n. 14
0
 private void FootRightBody_BeginCollision(object sender, CollisionInfo3D e)
 {
     this.footRCollision = true;
 }
Esempio n. 15
0
 private void FootRightBody_EndCollision(object sender, CollisionInfo3D e)
 {
     this.footRCollision = false;
 }