Timeline for Generic shape design
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 23, 2017 at 12:37 | history | edited | CommunityBot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Feb 9, 2017 at 10:56 | vote | accept | Peter Gruden | ||
Feb 9, 2017 at 10:56 | comment | added | Peter Gruden | I've up-voted your answer (twice), however it doesn't show due to my lack of reputation on gamedev stack. Thanks again for your help. | |
Feb 8, 2017 at 7:47 | comment | added | Theraot | @PeterGruden upvote what helped you, accept what best solved your problem. You may even post your an answer explaining your own solution and accept that. If a better answer comes alone you can change your accepted answer. If you want to wait for more answers, that's up to you. | |
Feb 7, 2017 at 12:13 | comment | added | Peter Gruden | Thank you @Theraot for your very detailed and insightful answer. <br/> I've edited my original post with the new structure. <br/> Should i mark your answer as accepted or leave it for a few days to maybe get some other peoples perspective on the matter? | |
Feb 5, 2017 at 21:32 | history | edited | Theraot | CC BY-SA 3.0 |
Fixing grammar and spelling
|
Feb 5, 2017 at 21:29 | comment | added | Theraot | @PeterGruden see updated answer | |
Feb 5, 2017 at 21:25 | history | edited | Theraot | CC BY-SA 3.0 |
Expanded answer
|
Feb 5, 2017 at 14:38 | comment | added | Peter Gruden |
I've tried a few ways of initializing your suggestion of static class Intersection<T,U>, however i have only been successful by putting something like Intersection<ShapeA, ShapeA>.Action = new IntersectAction<ShapeA, ShapeA>(MathCol.AIntersectsA); in the ShapeA's constructor, which will be executed for every instance of the shape
|
|
Feb 5, 2017 at 13:56 | comment | added | Peter Gruden | Regarding two levels of shape inheritance: i would still have to check for other shape's specific type/subtype (via a giant switch statement, which would also have to be inclusive of all the possible subtypes - problems with extensions) because all the intersection methods are optimized for every two specific shapes. So except the polygon intersection methods (which use Separating Axis Theorem) they don't really have that much in common to make them accept anything less than the specific subtype of shape they were designed to handle. | |
Feb 5, 2017 at 0:17 | history | answered | Theraot | CC BY-SA 3.0 |