I vehemently disagree.
We actually had a fairly lengthy discussion about this in another post.
There was a post that I'd made a long time ago where I discussed that you CAN VIEW......a point as a vector offset from "some origin" ....wherever that is. Apparently some light bulbs ticked on and it spread like wild fire. This, however, does not mean you SHOULD VIEW.....a point as a vector. Despite their mathematical representation (in affine systems they actually do NOT have the same representation) being similar, they're different ideas conceptually.
Without going into much detail, I'll answer the following:
-How to you conceptually understand vector+point?
The origin is also a point in space (location, no direction), when added to a vector (a direction, no location) yeilds.....
-In vector+point, does it return a vector? or a point? and vice versa?
... a point. (In both cases...with technicalities)
-Do you really want to rewrite almost the exact same code for two classes (vector & point)?
Alot of implementations (including a few of mine) do so there is a DISTINCT difference in concept. There will be FAR more operations you'll do later down the line that are pretty "wack-tastic" that will bring out this VERY distinct difference.
Though you CAN do it however you want. Mooball just typedefs both types as float constants. Then again, I know what the difference in operations on points and vectors are....perhaps some beginners do not. This will prevent undefined mistakes.
-Don't these questions really support a point being a vector typedef?
No...not particularly.
The OBB thing works because a point minus a point is DEFINED....as is a vector minus a vector, a vector plus a vector, a point plus a vector, a point minus a vector and so on and so forth. All of these relationships are very clearly defined.
Represent it how you wish. Again, you will *NOT* and I do stress.....not......be sacrificing any code speed representing it one way or the other. If it assists you in keeping the concepts straight then do so.
Ginto8 wrote:short wrote:Whoops!
I edited my first post, my bad!
this one works
error:
note: I already understand why I'm getting the error, I am just wondering if it necessary to rewrite the operator again with vector first and point second, if that makes sense.
Perhaps later on I will take your suggestion about using just one class, but this is certainly something that could be applied in other situations!
yes, it's necessary to have another operator. But doing it like that would bring up some nasty stuff:
-How to you conceptually understand vector+point?
-In vector+point, does it return a vector? or a point? and vice versa?
-Do you really want to rewrite almost the
exact same code for two classes (vector & point)?
-Don't these questions really support a point being a vector typedef?
Oh, almost forgot. If you want to use any OBB collision detection, points and vectors really should be synonymous because you are projecting the vectors from the origin to the point (in value, the point itself) onto an axis that was determined by using vector subtraction on two of the vertices (points). You really should reconsider your insistence to make point & vector separate.