I use a lot of 2D vectors in my Flash games - basically all velocities, positions etc I store in this way. My Vector2D class has lots of built in functions for rotation, dotproduct, projectOnto etc. The native Vector2 class doesn't seem to have half of this stuff, but it is used in a lot of places. The Vector3 has all this stuff, but has an extra dimension I don't need. So should I use either of the built in ones or port my AS3 class? Or should I try to extend Vector2 and add the extra functionality I need. Could that cause any problems?
I believe you're mistaken; Vector2 and Vector3 both have extensive functionality. Note that this functionality is exposed as static methods to the Vector2/Vector3 class, rather than of the form
Here is the list of Vector2 Members and Vector3 Members from Microsoft. The pages default to the latest XNA version, but you can view prior versions by clicking on the "Other Versions" dropdown at the top of the page, right under the title.
You will see, though, that the class does not implement rotation and projection. Of course, the projection operation is simply
Overall, I recommend using the built-in Vector2 class, and I think you'll find it suits most of your needs. The rest, like I said, are very short functions which you can port. But no need to duplicate the entire class, right? But if you feel the need to rewrite it, I don't see a strong reason why you shouldn't, as I can't see how XNA may somehow implement it better than you can.
The XNA Vector classes also have a hell of a lot of functionality, and the Matrix functions take in Vector classes specific to XNA, so personally, I'd probably use the XNA ones. Why reinvent the wheel?