HyCodeYourTale
classpublicPriority 3

RotateNoiseProperty

com.hypixel.hytale.procedurallib.property.RotateNoiseProperty

implements NoiseProperty

3

Methods

3

Public Methods

2

Fields

1

Constructors

Constructors

public
RotateNoiseProperty(NoiseProperty noise, CoordinateRotator rotation)

Methods

Public Methods (3)

public
double get(int seed, double x, double y)
@Override
public
double get(int seed, double x, double y, double z)
@Override
public
String toString()
@Nonnull@Override

Fields

Protected Fields (2)

protectedNoiseProperty noise
protectedCoordinateRotator rotation

Inheritance

Parent
Current
Interface
Child

Use mouse wheel to zoom, drag to pan. Click nodes to navigate.

Related Classes

Source Code

package com.hypixel.hytale.procedurallib.property;

import com.hypixel.hytale.procedurallib.random.CoordinateRotator;
import javax.annotation.Nonnull;

public class RotateNoiseProperty implements NoiseProperty {
   protected final NoiseProperty noise;
   protected final CoordinateRotator rotation;

   public RotateNoiseProperty(NoiseProperty noise, CoordinateRotator rotation) {
      this.noise = noise;
      this.rotation = rotation;
   }

   @Override
   public double get(int seed, double x, double y) {
      double px = this.rotation.rotateX(x, y);
      double py = this.rotation.rotateY(x, y);
      return this.noise.get(seed, px, py);
   }

   @Override
   public double get(int seed, double x, double y, double z) {
      double px = this.rotation.rotateX(x, y, z);
      double py = this.rotation.rotateY(x, y, z);
      double pz = this.rotation.rotateZ(x, y, z);
      return this.noise.get(seed, px, py, pz);
   }

   @Nonnull
   @Override
   public String toString() {
      return "RotateNoiseProperty{noise=" + this.noise + ", rotation=" + this.rotation + "}";
   }
}