Unity-Technologies / Unity-Technologies/Unity.Mathematics

[Feature Request] Add angle and signed angle?

Aperta
#84 16 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
1.4k
Fork
159
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The greetings.

I have forked this master-branch and from this master-branch I have edited math.cs of which you can see here:

https://github.com/quakeulf/Unity.Mathematics/blob/master/src/Unity.Mathematics/math.cs

Specificially from line 98 to line 111 are my additions. I am also including them below this text so you can see in this field of text what I have proposed to add, but cannot, since I cannot seem to figure out how to do a request for pull:

        /// <summary>Returns the angle in degrees from 0 to 180 between two float3s.</summary>
        public static float angle(float3 from, float3 to)
        {
            return math.degrees(math.acos(math.dot(math.normalize(from), math.normalize(to))));
        }
        
        /// <summary>Returns the signed angle in degrees from 180 to -180 between two float3s.</summary>
        public static float anglesigned(float3 from, float3 to)
        {
            float angle = math.acos(math.dot(math.normalize(from), math.normalize(to)));
            float3 cross = math.cross(from, to);
            angle *= math.sign(math.dot(math.up(), cross));
            return math.degrees(angle);
        }

If they are already in there, let me know where. Preferably through documentation on your webcite.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da src/Unity.Mathematics/math.cs, in particolare dalle righe 98-111, e leggi le API math circostanti insieme alla discussione per individuare eventuali decisioni dei maintainer. Il lavoro è completato quando la funzionalità per gli angoli richiesta dispone di un’API concordata ed è integrata con una verifica adeguata al progetto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp, unity
Ambito
computer-graphics, game-dev
Tipo di issue
Funzionalità
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.