Methods
Vector3 on kaksinkertaisen tarkkuuden 3-komponenttinen vektori, jossa x, y, ja z komponenttia. Sitä käytetään laajasti Aspose.3D:ssä sijainteihin, suuntiin, normaalivektoreihin ja skaalausarvoihin. Kaikki aritmeettiset operaatiot palauttavat uusia Vector3 instansseja; alkuperäistä ei muuteta.
Methods
| Methods | Methods |
|---|
Vector3() | Luo nollavektorin (0, 0, 0) |
Vector3(double x, double y, double z) | Rakenteet kolmesta komponentista |
Vector3(Vector3 other) | Kopiokonstruktori |
Julkiset kentät
Vector3 käyttää julkiset kentät komponenttien käyttöön (ei getter-/setter-metodeja):
| Methods | Methods | Methods | Methods |
|---|
x | double | v.x | X-komponentti |
y | double | v.y | Y-komponentti |
z | double | v.z | Z-komponentti |
Lasketut ominaisuudet
| Methods | Methods | Methods | Methods |
|---|
length | double | getLength() | Euklidinen pituus (sqrt(x^2+y^2+z^2)), vain luku |
length2 | double | getLength2() | Neliöpituus, vain luku; halvempi kuin getLength() kun tarvitaan vain vertailua |
Staattiset kentät
| Methods | Methods | Methods |
|---|
ZERO | Vector3 | Vector3(0, 0, 0) |
ONE | Vector3 | Vector3(1, 1, 1) |
UNIT_X | Vector3 | Vector3(1, 0, 0) |
UNIT_Y | Vector3 | Vector3(0, 1, 0) |
UNIT_Z | Vector3 | Vector3(0, 0, 1) |
Methods
| Methods | Paluutyyppi | Methods |
|---|
set(double x, double y, double z) | void | Asettaa kaikki kolme komponenttia paikallisesti |
dot(Vector3 rhs) | double | Pistetulo toisen kanssa Vector3 |
cross(Vector3 rhs) | Vector3 | Ristitulo – palauttaa vektorin, joka on kohtisuorassa molempiin operandeihin |
normalize() | Vector3 | Palauttaa yksikköpituuden kopion; palauttaa nollavektorin, jos pituus on nolla |
angleBetween(Vector3 dir) | double | Kulma radiaaneina tämän vektorin ja dir |
angleBetween(Vector3 dir, Vector3 up) | double | Allekirjoitettu kulma radiaaneina projektattuna tasoon, jonka määrittelee up |
sin() | Vector3 | Komponenttikohtainen sini |
cos() | Vector3 | Komponenttikohtainen kosini |
compareTo(Vector3 other) | int | Lexikografinen vertailu: palauttaa -1, 0 tai 1 |
Vector3.parse(String s) | Vector3 | Staattinen. Jäsentää "x y z" merkkijonon esitys |
Methods
Katso myös