Quad2d class
Пакет: com.hypixel.hytale.math.shape
Файл: com/hypixel/hytale/math/shape/Quad2d.java
Поля (22)
| Модификаторы | Тип | Имя |
|---|---|---|
private |
Vector2d |
a |
|
double |
var1 |
|
|
var1 |
|
|
var1 |
|
|
var1 |
|
double |
var1 |
|
|
var1 |
|
|
var1 |
|
|
var1 |
|
double |
var1 |
|
|
var1 |
|
|
var1 |
|
|
var1 |
|
double |
var1 |
|
|
var1 |
|
|
var1 |
|
|
var1 |
|
double |
var3 |
|
|
var3 |
|
double |
var5 |
|
|
var5 |
|
double |
var7 |
Методы (23)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
Vector2d |
getAVector2d getA() |
public |
Vector2d |
getBVector2d getB() |
public |
Vector2d |
getCVector2d getC() |
public |
Vector2d |
getDVector2d getD() |
public |
double |
getMaxXdouble getMaxX() |
public |
double |
getMaxYdouble getMaxY() |
public |
double |
getMinXdouble getMinX() |
public |
double |
getMinYdouble getMinY() |
|
|
if if(var1 > this.b.x) |
|
|
if if(var1 > this.c.x) |
|
|
if if(var1 > this.d.x) |
|
|
if if(var1 > this.b.y) |
|
|
if if(var1 > this.c.y) |
|
|
if if(var1 > this.d.y) |
|
|
if if(var1 < this.b.x) |
|
|
if if(var1 < this.c.x) |
|
|
if if(var1 < this.d.x) |
|
|
if if(var1 < this.b.y) |
|
|
if if(var1 < this.c.y) |
|
|
if if(var1 < this.d.y) |
|
|
if if(var3 + var5 > 1.0) |
abstract |
|
this this(var1, 0, 1, 2, 3) |
abstract |
|
this this(var1[var2], var1[var3], var1[var4], var1[var5]) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.math.shape;
class="kw">import java.util.Random;
class="kw">import javax.annotation.Nonnull;
class="kw">import org.joml.Vector2d;
class="kw">public class Quad2d {
class="kw">private Vector2d a;
class="kw">private Vector2d b;
class="kw">private Vector2d c;
class="kw">private Vector2d d;
class="kw">public Quad2d(Vector2d var1, Vector2d var2, Vector2d var3, Vector2d var4) {
this.a = var1;
this.b = var2;
this.c = var3;
this.d = var4;
}
class="kw">public Quad2d() {
this(new Vector2d(), new Vector2d(), new Vector2d(), new Vector2d());
}
class="kw">public Quad2d(@Nonnull Vector2d[] var1) {
this(var1, 0, 1, 2, 3);
}
class="kw">public Quad2d(@Nonnull Vector2d[] var1, int var2, int var3, int var4, int var5) {
this(var1[var2], var1[var3], var1[var4], var1[var5]);
}
class="kw">public Vector2d getA() {
class="kw">return this.a;
}
class="kw">public Vector2d getB() {
class="kw">return this.b;
}
class="kw">public Vector2d getC() {
class="kw">return this.c;
}
class="kw">public Vector2d getD() {
class="kw">return this.d;
}
class="kw">public double getMinX() {
double var1 = this.a.x;
if (var1 > this.b.x) {
var1 = this.b.x;
}
if (var1 > this.c.x) {
var1 = this.c.x;
}
if (var1 > this.d.x) {
var1 = this.d.x;
}
class="kw">return var1;
}
class="kw">public double getMinY() {
double var1 = this.a.y;
if (var1 > this.b.y) {
var1 = this.b.y;
}
if (var1 > this.c.y) {
var1 = this.c.y;
}
if (var1 > this.d.y) {
var1 = this.d.y;
}
class="kw">return var1;
}
class="kw">public double getMaxX() {
double var1 = this.a.x;
if (var1 < this.b.x) {
var1 = this.b.x;
}
if (var1 < this.c.x) {
var1 = this.c.x;
}
if (var1 < this.d.x) {
var1 = this.d.x;
}
class="kw">return var1;
}
class="kw">public double getMaxY() {
double var1 = this.a.y;
if (var1 < this.b.y) {
var1 = this.b.y;
}
if (var1 < this.c.y) {
var1 = this.c.y;
}
if (var1 < this.d.y) {
var1 = this.d.y;
}
class="kw">return var1;
}
@Nonnull
class="kw">public Vector2d getCenter() {
class="kw">return this.getCenter(new Vector2d());
}
@Nonnull
class="kw">public Vector2d getCenter(@Nonnull Vector2d var1) {
class="kw">return var1.set((this.a.x + this.b.x + this.c.x + this.d.x) * 0.25, (this.a.y + this.b.y + this.c.y + this.d.y) * 0.25);
}
@Nonnull
class="kw">public Vector2d getRandom(@Nonnull Random var1) {
class="kw">return this.getRandom(var1, new Vector2d());
}
@Nonnull
class="kw">public Vector2d getRandom(@Nonnull Random var1, @Nonnull Vector2d var2) {
double var3 = var1.nextDouble();
double var5 = var1.nextDouble();
if (var3 + var5 > 1.0) {
var3 = 1.0 - var3;
var5 = 1.0 - var5;
}
double var7 = 1.0 - var3 - var5;
if (var1.nextBoolean()) {
var2.set(this.a.x * var7 + this.b.x * var3 + this.c.x * var5, this.a.y * var7 + this.b.y * var3 + this.c.y * var5);
} else {
var2.set(this.a.x * var7 + this.c.x * var3 + this.d.x * var5, this.a.y * var7 + this.c.y * var3 + this.d.y * var5);
}
class="kw">return var2;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "Quad2d{a=" + this.a + ", b=" + this.b + ", c=" + this.c + ", d=" + this.d + "}";
}
}