Example #1
0
        public override void TryCollide(InfinitePlaneCollider other)
        {
            if (!other.GameObject.Enabled)
            {
                return;
            }
            var position      = GameObject.Transform.Position;
            var otherPosition = other.GameObject.Transform.Position;

            if (position.Y > otherPosition.Y)
            {
                return;
            }

            GameObject.Transform.Position = GameObject.Transform.Position.WithY(otherPosition.Y);
            if (GameObject.RigidBody != null)
            {
                GameObject.RigidBody.Velocity = Vec3.Zero;
            }
            OnCollision(other, position, Vec3.Up);
        }
Example #2
0
 public virtual void TryCollide(InfinitePlaneCollider plane)
 {
 }