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

            this.externalTouchCollisionEntities.Remove(otherEntity);
            this.RemoveFocusableInteraction(otherEntity);
        }
Example #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));
        }
Example #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));
     }
 }
Example #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);
        }
Example #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);
        }
Example #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));
            }
        }
Example #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;
            }
        }
Example #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);
        }
Example #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();
                }
            }
        }
Example #12
0
 private void Body_BeginCollision(object sender, CollisionInfo3D e)
 {
     this.bodyCollision = true;
 }
Example #13
0
 private void Body_EndCollision(object sender, CollisionInfo3D e)
 {
     this.bodyCollision = false;
 }
Example #14
0
 private void FootRightBody_BeginCollision(object sender, CollisionInfo3D e)
 {
     this.footRCollision = true;
 }
Example #15
0
 private void FootRightBody_EndCollision(object sender, CollisionInfo3D e)
 {
     this.footRCollision = false;
 }