Facepunch / sbox-issues

161 stars 10 forks source link

Add Vector2Int, Vector3Int to main library #4995

Open drongood12 opened 2 months ago

drongood12 commented 2 months ago

For?

S&Box

What can't you do?

I'm tired of moving the same Utils files from project to project to work with int vectors; I would like to see this added to the main s&box library.

How would you like it to work?

Add Vector2Int, Vector3Int structure and corresponding mathematical operations for them https://docs.unity3d.com/ScriptReference/Vector2Int.html

What have you tried?

I drag the same file from project to project to make it more convenient to work with integer vectors

Additional context

No response

chrisspieler commented 2 months ago

This will eventually be very useful, I feel. I already use a custom Vector2Int for my world streaming stuff, and it will become even more useful when 2D support is added brought up to the standard of 3D, and we use it for things like tilemaps.

handsomematt commented 2 months ago

https://github.com/Facepunch/sbox-voxels/blob/main/code/IntVector3.cs

I think we've reimplemented this in enough different projects that this is justified, should be named Vector3Int

xezno commented 1 month ago

Added now, same with Vector2Int

drongood12 commented 3 weeks ago

I checked, so far everything seems to be working well, thanks!