You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
the testShapeXXX collision functions all use instanceof which is slow, if we make the shape classes use a type tag enum and then use dispatch tables, it will be much faster.
all of the testLineXXX functions use the exact same algorithms as the raycasting code, since raycasting is basically testing for intersection with the ray
all of the testPointXXX functions are the same as containment so we could just move them to the method implementations of the contains() methods and then have testPointShape just call shape.contains(point.pt)
clipLineToCircle and clipLineToRect are once again basically just raycasting from both ends of the line, and using the resultant points
we could get rid of clipLineToCircle and clipLineToRect and make a generalized clipLineToShape helper that just does that (raycasts from both directions of the line and uses the hit points), that way we could clip lines to polygons and ellipses too
Is your feature request related to a problem? Please describe.
testShapeXXXcollision functions all useinstanceofwhich is slow, if we make the shape classes use atypetag enum and then use dispatch tables, it will be much faster.testLineXXXfunctions use the exact same algorithms as the raycasting code, since raycasting is basically testing for intersection with the raytestPointXXXfunctions are the same as containment so we could just move them to the method implementations of thecontains()methods and then havetestPointShapejust callshape.contains(point.pt)clipLineToCircleandclipLineToRectare once again basically just raycasting from both ends of the line, and using the resultant pointsclipLineToCircleandclipLineToRectand make a generalizedclipLineToShapehelper that just does that (raycasts from both directions of the line and uses the hit points), that way we could clip lines to polygons and ellipses tooAny more information?
No response