Package net.commoble.exmachina.api

# Record Class MechanicalState

java.lang.Object
java.lang.Record
net.commoble.exmachina.api.MechanicalState

Record Components:
  `power` - double value of the power being consumed by this node in Watts (Joules per second). Always non-negative. Equal to the square of the node's (angular velocity)^2 * inertia
  `angularVelocity` - double value of the anvular velocity at this node, in radians per second. This value is signed with a right-hand rule; if positive, the node is rotating in the direction a right hand's fingers are pointing while the thumb points to the positive direction of the axis of rotation (up, south, east). If negative, the node points to the negative direction of the axis (down, north, west).

public record MechanicalState(double power, double angularVelocity) extends Record
Representation of a mechanical update provided to a node in the mechanical graph

## Field Summary

Fields
Modifier and Type
Field
Description
`static final com.mojang.serialization.Codec<MechanicalState>`
`CODEC`
{ "power": 10.0, "angular_velocity": -1.0 }
`static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,MechanicalState>`
`STREAM_CODEC`
codec but stream
`static final MechanicalState`
`ZERO`
MechanicalState constant for zero power and velocity

## Constructor Summary

Constructors
Constructor
Description
`MechanicalState(double power, double angularVelocity)`
Creates an instance of a `MechanicalState` record class.

## Method Summary

Modifier and Type
Method
Description
`double`
`angularVelocity()`
Returns the value of the `angularVelocity` record component.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`final int`
`hashCode()`
Returns a hash code value for this object.
`double`
`power()`
Returns the value of the `power` record component.
`final String`
`toString()`
Returns a string representation of this record class.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### ZERO

public static final MechanicalState ZERO
MechanicalState constant for zero power and velocity

### CODEC

public static final com.mojang.serialization.Codec<MechanicalState> CODEC

     {
       "power": 10.0,
       "angular_velocity": -1.0
     }

### STREAM_CODEC

public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,MechanicalState> STREAM_CODEC
codec but stream

## Constructor Details

### MechanicalState

public MechanicalState(double power, double angularVelocity)
Creates an instance of a `MechanicalState` record class.

Parameters:
  `power` - the value for the `power` record component
  `angularVelocity` - the value for the `angularVelocity` record component

## Method Details

### toString

public final String toString()
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.

Specified by:
  `toString` in class `Record`
Returns:
  a string representation of this object

### hashCode

public final int hashCode()
Returns a hash code value for this object. The value is derived from the hash code of each of the record components.

Specified by:
  `hashCode` in class `Record`
Returns:
  a hash code value for this object

### equals

public final boolean equals(Object o)
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### power

public double power()
Returns the value of the `power` record component.

Returns:
  the value of the `power` record component

### angularVelocity

public double angularVelocity()
Returns the value of the `angularVelocity` record component.

Returns:
  the value of the `angularVelocity` record component