Class PhysicsConfig

java.lang.Object
com.hypixel.hytale.protocol.PhysicsConfig

public class PhysicsConfig extends Object
  • Field Details

    • NULLABLE_BIT_FIELD_SIZE

      public static final int NULLABLE_BIT_FIELD_SIZE
      See Also:
    • FIXED_BLOCK_SIZE

      public static final int FIXED_BLOCK_SIZE
      See Also:
    • VARIABLE_FIELD_COUNT

      public static final int VARIABLE_FIELD_COUNT
      See Also:
    • VARIABLE_BLOCK_START

      public static final int VARIABLE_BLOCK_START
      See Also:
    • MAX_SIZE

      public static final int MAX_SIZE
      See Also:
    • type

      @Nonnull public PhysicsType type
    • density

      public double density
    • gravity

      public double gravity
    • bounciness

      public double bounciness
    • bounceCount

      public int bounceCount
    • bounceLimit

      public double bounceLimit
    • sticksVertically

      public boolean sticksVertically
    • computeYaw

      public boolean computeYaw
    • computePitch

      public boolean computePitch
    • rotationMode

      @Nonnull public RotationMode rotationMode
    • moveOutOfSolidSpeed

      public double moveOutOfSolidSpeed
    • terminalVelocityAir

      public double terminalVelocityAir
    • densityAir

      public double densityAir
    • terminalVelocityWater

      public double terminalVelocityWater
    • densityWater

      public double densityWater
    • hitWaterImpulseLoss

      public double hitWaterImpulseLoss
    • rotationForce

      public double rotationForce
    • speedRotationFactor

      public float speedRotationFactor
    • swimmingDampingFactor

      public double swimmingDampingFactor
    • allowRolling

      public boolean allowRolling
    • rollingFrictionFactor

      public double rollingFrictionFactor
    • rollingSpeed

      public float rollingSpeed
  • Constructor Details

    • PhysicsConfig

      public PhysicsConfig()
    • PhysicsConfig

      public PhysicsConfig(@Nonnull PhysicsType type, double density, double gravity, double bounciness, int bounceCount, double bounceLimit, boolean sticksVertically, boolean computeYaw, boolean computePitch, @Nonnull RotationMode rotationMode, double moveOutOfSolidSpeed, double terminalVelocityAir, double densityAir, double terminalVelocityWater, double densityWater, double hitWaterImpulseLoss, double rotationForce, float speedRotationFactor, double swimmingDampingFactor, boolean allowRolling, double rollingFrictionFactor, float rollingSpeed)
    • PhysicsConfig

      public PhysicsConfig(@Nonnull PhysicsConfig other)
  • Method Details

    • requireBounds

      public static void requireBounds(MemorySegment mem, int offset)
      Checks that the fixed block fits. The per-field getters read without their own bound check, so call this once before reading fields out of an untrusted segment.
    • getType

      public static PhysicsType getType(MemorySegment mem)
    • getType

      public static PhysicsType getType(MemorySegment mem, int offset)
    • getDensity

      public static double getDensity(MemorySegment mem)
    • getDensity

      public static double getDensity(MemorySegment mem, int offset)
    • getGravity

      public static double getGravity(MemorySegment mem)
    • getGravity

      public static double getGravity(MemorySegment mem, int offset)
    • getBounciness

      public static double getBounciness(MemorySegment mem)
    • getBounciness

      public static double getBounciness(MemorySegment mem, int offset)
    • getBounceCount

      public static int getBounceCount(MemorySegment mem)
    • getBounceCount

      public static int getBounceCount(MemorySegment mem, int offset)
    • getBounceLimit

      public static double getBounceLimit(MemorySegment mem)
    • getBounceLimit

      public static double getBounceLimit(MemorySegment mem, int offset)
    • getSticksVertically

      public static boolean getSticksVertically(MemorySegment mem)
    • getSticksVertically

      public static boolean getSticksVertically(MemorySegment mem, int offset)
    • getComputeYaw

      public static boolean getComputeYaw(MemorySegment mem)
    • getComputeYaw

      public static boolean getComputeYaw(MemorySegment mem, int offset)
    • getComputePitch

      public static boolean getComputePitch(MemorySegment mem)
    • getComputePitch

      public static boolean getComputePitch(MemorySegment mem, int offset)
    • getRotationMode

      public static RotationMode getRotationMode(MemorySegment mem)
    • getRotationMode

      public static RotationMode getRotationMode(MemorySegment mem, int offset)
    • getMoveOutOfSolidSpeed

      public static double getMoveOutOfSolidSpeed(MemorySegment mem)
    • getMoveOutOfSolidSpeed

      public static double getMoveOutOfSolidSpeed(MemorySegment mem, int offset)
    • getTerminalVelocityAir

      public static double getTerminalVelocityAir(MemorySegment mem)
    • getTerminalVelocityAir

      public static double getTerminalVelocityAir(MemorySegment mem, int offset)
    • getDensityAir

      public static double getDensityAir(MemorySegment mem)
    • getDensityAir

      public static double getDensityAir(MemorySegment mem, int offset)
    • getTerminalVelocityWater

      public static double getTerminalVelocityWater(MemorySegment mem)
    • getTerminalVelocityWater

      public static double getTerminalVelocityWater(MemorySegment mem, int offset)
    • getDensityWater

      public static double getDensityWater(MemorySegment mem)
    • getDensityWater

      public static double getDensityWater(MemorySegment mem, int offset)
    • getHitWaterImpulseLoss

      public static double getHitWaterImpulseLoss(MemorySegment mem)
    • getHitWaterImpulseLoss

      public static double getHitWaterImpulseLoss(MemorySegment mem, int offset)
    • getRotationForce

      public static double getRotationForce(MemorySegment mem)
    • getRotationForce

      public static double getRotationForce(MemorySegment mem, int offset)
    • getSpeedRotationFactor

      public static float getSpeedRotationFactor(MemorySegment mem)
    • getSpeedRotationFactor

      public static float getSpeedRotationFactor(MemorySegment mem, int offset)
    • getSwimmingDampingFactor

      public static double getSwimmingDampingFactor(MemorySegment mem)
    • getSwimmingDampingFactor

      public static double getSwimmingDampingFactor(MemorySegment mem, int offset)
    • getAllowRolling

      public static boolean getAllowRolling(MemorySegment mem)
    • getAllowRolling

      public static boolean getAllowRolling(MemorySegment mem, int offset)
    • getRollingFrictionFactor

      public static double getRollingFrictionFactor(MemorySegment mem)
    • getRollingFrictionFactor

      public static double getRollingFrictionFactor(MemorySegment mem, int offset)
    • getRollingSpeed

      public static float getRollingSpeed(MemorySegment mem)
    • getRollingSpeed

      public static float getRollingSpeed(MemorySegment mem, int offset)
    • toObject

      public static PhysicsConfig toObject(MemorySegment mem)
    • toObject

      public static PhysicsConfig toObject(MemorySegment mem, int offset)
    • toObject

      public static PhysicsConfig toObject(MemorySegment mem, int offset, @Nullable ReadCursor cursor)
      Decodes one PhysicsConfig and reports the end of its encoding through the cursor. The variable block is decoded in field order against a running position, and each offset slot must name that position, so the fields decoded are the bytes walked.
    • serialize

      public int serialize(@Nonnull MemorySegment mem, int offset)
    • computeSize

      public int computeSize()
    • clone

      public PhysicsConfig clone()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object