Hi everybody! First time poster and rookie programmer over here. I guess I have a silly question because I haven´t found much info googeling it.
I´ve been reading up on vectors for a while and I´m getting more and more ideas for their uses. I just finished a SAT implementation an hour ago, and this raised a few questions about how to distinguish between mathematical vectors and ”line” vectors, the kind you actually draw on screen or use for collision detection? I´m having a hard time realising how to actually think about this. What classes to have, how they should be designed and relate… When I started out with game programming, I never thought this would be a problem.
So, if you do separate the vector types, how do you organize your classes and how do you create polygon shapes? Do you save a ”math” vector for every line in a rect for use in collision detection, do you create rects by using lines (for easier conversion to a vector), do you extract vectors by using the points in a rect? Am I overthinking this…? ???
Do you have separate classes for math vectors and ”lines”, or do you bundel a ”line” class with a render() method and a dotProduct() method?
A mathematical vector is supposed to have only magnitude and direction? Is this concept of any use in game programming or do you keep an origin with your vector?
So to sum up: what´s a good approach to 1) managing ”math” vector and pure ”lines” and 2) a good object orienteted approach to managing polygons. I´m mostly after ”concept”, but if it helps I´m starting out 2d-style with LWJGL.
Thank you!