Triangle2d class

Пакет: com.hypixel.hytale.math.shape

Файл: com/hypixel/hytale/math/shape/Triangle2d.java

Поля (17)

МодификаторыТипИмя
private Vector2d a
double var1
var1
var1
double var1
var1
var1
double var1
var1
var1
double var1
var1
var1
double var3
var3
double var5
var5

Методы (21)

МодификаторыВозвратСигнатура
public Vector2d getAVector2d getA()
public Vector2d getBVector2d getB()
public Vector2d getCVector2d getC()
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.b.y)
if if(var1 > this.c.y)
if if(var1 < this.b.x)
if if(var1 < this.c.x)
if if(var1 < this.b.y)
if if(var1 < this.c.y)
if if(var3 + var5 > 1.0)
public void setAvoid setA(Vector2d var1)
public void setBvoid setB(Vector2d var1)
public void setCvoid setC(Vector2d var1)
abstract this this(var1, 0, 1, 2)
abstract this this(var1[var2], var1[var3], var1[var4])

Исходный код

Показать/скрыть
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 Triangle2d {
   class="kw">private Vector2d a;
   class="kw">private Vector2d b;
   class="kw">private Vector2d c;

   class="kw">public Triangle2d(Vector2d var1, Vector2d var2, Vector2d var3) {
      this.a = var1;
      this.b = var2;
      this.c = var3;
   }

   class="kw">public Triangle2d() {
      this(new Vector2d(), new Vector2d(), new Vector2d());
   }

   class="kw">public Triangle2d(@Nonnull Vector2d[] var1) {
      this(var1, 0, 1, 2);
   }

   class="kw">public Triangle2d(@Nonnull Vector2d[] var1, int var2, int var3, int var4) {
      this(var1[var2], var1[var3], var1[var4]);
   }

   class="kw">public Vector2d getA() {
      class="kw">return this.a;
   }

   class="kw">public void setA(Vector2d var1) {
      this.a = var1;
   }

   class="kw">public Vector2d getB() {
      class="kw">return this.b;
   }

   class="kw">public void setB(Vector2d var1) {
      this.b = var1;
   }

   class="kw">public Vector2d getC() {
      class="kw">return this.c;
   }

   class="kw">public void setC(Vector2d var1) {
      this.c = var1;
   }

   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;
      }

      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;
      }

      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;
      }

      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;
      }

      class="kw">return var1;
   }

   @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;
      }

      var2.set(this.a.x * (1.0 - var3 - var5) + this.b.x * var3 + this.c.x * var5, this.a.y * (1.0 - var3 - var5) + this.b.y * var3 + this.c.y * var5);
      class="kw">return var2;
   }
}