Unity-Technologies / Unity-Technologies/Unity.Mathematics

math.up() / math.forward() / etc. methods should be properties

Open
#180 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1.4k
Forks
159
PR merge metrics
No merged PRs in 30d

Description

Currently the cardinal axes are defined like so:

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static float3 forward() { return new float3(0.0f, 0.0f, 1.0f); }

Please consider converting these into properties, ex:

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static float3 forward => new float3(0.0f, 0.0f, 1.0f);

It is expected within the context of C# that such things should be properties rather than methods.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for math.up(), math.forward(), and the other cardinal-axis methods, then inspect their call sites and related tests. The work is done when those axis values are exposed as properties consistently and existing usages and tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
computer-graphics
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.