Unity-Technologies / Unity-Technologies/Unity.Mathematics

devide int3 by float

Open
#61 0 comments 1 reaction 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

Not really a biggy, but currently I can't devide an int3 by a float directly, without explicitly casting the int3 to a float3 first. (Is true for int2 and int4 aswell).

So basically, what I would like is this operator.

public static float3 operator / (int3 lhs, float rhs)
{ return new float3 (lhs.x / rhs, lhs.y / rhs, lhs.z / rhs); }

So that when I want to devide my int3 by a float, I don't have to explicitly cast my int3 to a float3 first.

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

Locate the C# definitions and existing division operators for int2, int3, and int4 in the Unity.Mathematics repository. Compare their current conversion and operator behavior, then verify that division by a float produces the corresponding float vector types for all three integer vector types.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
game-dev
Issue type
Feature
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.