예제 #1
0
        protected void RenderCorner(OverlayData overlayData, Data data)
        {
            var cornerDelta = data.GetCornerDelta(Mathf.Min(BorderOverlayWidth / 2, data.halfWidth));
            var line        = new StraightTrajectory(data.leftPos + cornerDelta, data.rightPos - cornerDelta);

            line.Render(overlayData);
        }
예제 #2
0
        public virtual bool Contains(Segment3 ray, out float t)
        {
            var line     = new StraightTrajectory(GetHitPosition(ray, out t), Center);
            var contains = !BorderLines.Any(b => Intersection.Intersect(line, b));

            return(contains);
        }
예제 #3
0
        public void Divide(out ITrajectory trajectory1, out ITrajectory trajectory2)
        {
            var middle = (Trajectory.a + Trajectory.b) / 2;

            trajectory1 = new StraightTrajectory(Trajectory.a, middle);
            trajectory2 = new StraightTrajectory(middle, Trajectory.b);
        }
예제 #4
0
 public bool Equals(StraightTrajectory other)
 {
     if (other is null)
     {
         return(false);
     }
     else if (ReferenceEquals(this, other))
     {
         return(true);
     }
     else
     {
         return(Equal(Trajectory, other.Trajectory));
     }
 }