Unity-Technologies / Unity-Technologies/Unity.Mathematics
More implicit conversion
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1.4k
- Forks
- 159
- PR merge metrics
- No merged PRs in 30d
Description
I would like to see implicit casting for:
- int2 <=> Vector2Int
- int3 <=> Vector3Int
(I have no idea why those don't exist)
- Vector3 <=> float2
(usefull when using vector functions like Camera.WorldToScreenPoint in 2D)
Second one will make my code a lot easier to read, instead of
(Vector2)camera.WorldToScreenPoint(float3(currentWorldspaceAimCentre, 0));
I will be able to just do
camera.WorldToScreenPoint(currentWorldspaceAimCentre)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the definitions of int2, int3, Vector2Int, Vector3Int, Vector3, and float2, then inspect how existing conversions are declared. Verify that the requested conversions support the code examples in the issue without explicit casts and that the project still builds and tests successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100