public static bool IsCollidedPointHLine(SPoint Point_, SHLine HLine_, SPoint Dir_, SCollisionInfo CollisionInfo_) { if (Dir_.Y == 0.0) { return(false); } if (Dir_.Y < 0.0 && Point_.Y < HLine_.Y) { return(false); } if (Dir_.Y > 0.0 && Point_.Y > HLine_.Y) { return(false); } var ContactX = (Dir_.X / Dir_.Y) * (HLine_.Y - Point_.Y) + Point_.X; CollisionInfo_.Time = (HLine_.Y - Point_.Y) / Dir_.Y; if (CollisionInfo_.Time < 0.0) { return(false); } CollisionInfo_.Point.X = ContactX; CollisionInfo_.Point.Y = HLine_.Y; CollisionInfo_.Normal.X = 0.0f; CollisionInfo_.Normal.Y = -Dir_.Y; return(true); }
public SHSegment(SHLine Super_, Single Left_, Single Right_) : base(Super_) { Left = Left_; Right = Right_; }
public void Set(SHLine Obj_) { Y = Obj_.Y; }
public SHLine(SHLine Obj_) { Y = Obj_.Y; }