Package net.commoble.exmachina.api.content

# Record Class RawNode

java.lang.Object
java.lang.Record
net.commoble.exmachina.api.content.RawNode

Record Components:
  `shape` - NodeShape of this node
  `torque` - double value of active torque provided by this node in Newton-Meters. Torque is signed using a right-hand rule, where the fingers of the hand point in the direction of rotation; if the right thumb points toward the positive end of the axis of rotation (up/south/east), torque is positive; if the right thumb points toward the negative end of the axis (down/north/west), torque is negative
  `positiveCounterTorque` - double value of passive torque (e.g. from friction) to subtract when total active torque greater than 0 (right-hand's thumb is pointing toward positive end of axis)
  `negativeCounterTorque` - double value of passive torque to add when total active torque less than 0 (right thumb points toward negative axis)
  `inertia` - double value of inertia of this node (in kg-meters^2)
  `connections` - List of RawConnection objects indicating adjacent nodes this node can connect to, if those targets are present

public record RawNode(NodeShape shape, double torque, double positiveCounterTorque, double negativeCounterTorque, double inertia, List<RawNode.RawConnection> connections) extends Record
Relative node definition used by `VariantsMechanicalComponent` and `MultipartMechanicalComponent`

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final record`
`RawNode.RawConnection`
Relative connection from a RawNode to a neighbor node

## Field Summary

Fields
Modifier and Type
Field
Description
`static final com.mojang.serialization.Codec<RawNode>`
`CODEC`
{ "shape": e.g.

## Constructor Summary

Constructors
Constructor
Description
`RawNode(NodeShape shape, double torque, double positiveCounterTorque, double negativeCounterTorque, double inertia, List<RawNode.RawConnection> connections)`
Creates an instance of a `RawNode` record class.

## Method Summary

Modifier and Type
Method
Description
`List<RawNode.RawConnection>`
`connections()`
Returns the value of the `connections` 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`
`inertia()`
Returns the value of the `inertia` record component.
`double`
`negativeCounterTorque()`
Returns the value of the `negativeCounterTorque` record component.
`double`
`positiveCounterTorque()`
Returns the value of the `positiveCounterTorque` record component.
`NodeShape`
`shape()`
Returns the value of the `shape` record component.
`double`
`torque()`
Returns the value of the `torque` 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

### CODEC

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

     {
       "shape": e.g. "cube", "north", {"face": "north", "side": "down"},
       "torque": 100, // a positive torque indicates right-hand thumb points in + direction
       "positive_counter_torque": 10, // must be positive, subtracted from torque when total active torque is positive
       "negative_counter_torque": 10, // must be positive, added to torque when total active torque is negative
       "inertia": 0.01, // must be positive
       "connections": [
            // see RawConnection definition
       ]
     }

## Constructor Details

### RawNode

public RawNode(NodeShape shape, double torque, double positiveCounterTorque, double negativeCounterTorque, double inertia, List<RawNode.RawConnection> connections)
Creates an instance of a `RawNode` record class.

Parameters:
  `shape` - the value for the `shape` record component
  `torque` - the value for the `torque` record component
  `positiveCounterTorque` - the value for the `positiveCounterTorque` record component
  `negativeCounterTorque` - the value for the `negativeCounterTorque` record component
  `inertia` - the value for the `inertia` record component
  `connections` - the value for the `connections` 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. Reference components are compared with `Objects::equals(Object,Object)`; primitive components 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.

### shape

public NodeShape shape()
Returns the value of the `shape` record component.

Returns:
  the value of the `shape` record component

### torque

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

Returns:
  the value of the `torque` record component

### positiveCounterTorque

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

Returns:
  the value of the `positiveCounterTorque` record component

### negativeCounterTorque

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

Returns:
  the value of the `negativeCounterTorque` record component

### inertia

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

Returns:
  the value of the `inertia` record component

### connections

public List<RawNode.RawConnection> connections()
Returns the value of the `connections` record component.

Returns:
  the value of the `connections` record component