Bedrock-OSS / bedrock-boost

MIT License
9 stars 3 forks source link

Add Wrapper for Vector2 and VectorXZ #3

Open theaddonn opened 5 days ago

theaddonn commented 5 days ago

Both type Vector2 and VectorXZ from @minecraft/server should get their own wrappers in @bedrock-oss/bedrockboost. The extra methods on Vec3 are already extremely useful, implementing such features for the prior mentioned types is a necessity in my eyes.

If this is determined as something worth looking into, I would be devoted to implement such.

stirante commented 5 days ago

I think it's a great idea! I did a quick find and replace job with Vec3 here https://github.com/Bedrock-OSS/bedrock-boost/commit/086661c81688aa93d46daeec5690ccad7542bae5 I implemented Vector2 into Vec2, cause it's used in more places, but VectorXZ is also accepted as an input (and probably should get its own toVectorXZ() method).

It definitely needs more love, but I think this would be a start. I had to remove some methods:

Feel free to improve it, I just did the boring work to start it.