Is there a reason b2Vec2 (or just V2 if you're using the recent alchemy port) isn't derived from as3's own Point? I imagine it's because there is too much overhead involved in that class? I ask because it seems silly constantly instantiating new objects just to convert between two datatypes whose only really important members are x and y. If I want to use a point on the stage from some canonical as3 function that spits out a Point object pt I then have to stuff it into a new b2Vec2( pt.x, pt.y ) just to use it in Box2D. Wouldn't it just be easier to have b2Vec2 inherit from Point and avoid the explicit conversions?
It's especially sloppy when I'm trying to develop my own common interfaces to reuse in my projects. Say I want to create a common entity interface with properties such as position and velocity. I would like to use the basic as3 Point class to describe these as I'm sure I won't be using Box2D in every single project. But then if my project does use Box2D I'll then have all of the overhead of converting between types.
Is there a better way to go about this?
It's especially sloppy when I'm trying to develop my own common interfaces to reuse in my projects. Say I want to create a common entity interface with properties such as position and velocity. I would like to use the basic as3 Point class to describe these as I'm sure I won't be using Box2D in every single project. But then if my project does use Box2D I'll then have all of the overhead of converting between types.
Is there a better way to go about this?