Reformatted MechanicalNode.class
This commit is contained in:
parent
af32448001
commit
9bbc8e4d2c
2 changed files with 220 additions and 231 deletions
|
@ -15,8 +15,7 @@ import resonantinduction.core.ResonantInduction;
|
||||||
import universalelectricity.api.vector.Vector3;
|
import universalelectricity.api.vector.Vector3;
|
||||||
import codechicken.multipart.TMultiPart;
|
import codechicken.multipart.TMultiPart;
|
||||||
|
|
||||||
/**
|
/** A mechanical node for mechanical energy.
|
||||||
* A mechanical node for mechanical energy.
|
|
||||||
* <p/>
|
* <p/>
|
||||||
* Useful Formula:
|
* Useful Formula:
|
||||||
* <p/>
|
* <p/>
|
||||||
|
@ -26,19 +25,15 @@ import codechicken.multipart.TMultiPart;
|
||||||
* Torque = r (Radius) * F (Force) * sin0 (Direction/Angle of the force applied. 90 degrees if
|
* Torque = r (Radius) * F (Force) * sin0 (Direction/Angle of the force applied. 90 degrees if
|
||||||
* optimal.)
|
* optimal.)
|
||||||
*
|
*
|
||||||
* @author Calclavia
|
* @author Calclavia */
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public class MechanicalNode extends Node<INodeProvider, TickingGrid, MechanicalNode>
|
public class MechanicalNode extends Node<INodeProvider, TickingGrid, MechanicalNode> implements IMechanicalNode
|
||||||
implements IMechanicalNode
|
|
||||||
{
|
{
|
||||||
public double torque = 0;
|
public double torque = 0;
|
||||||
public double prevAngularVelocity, angularVelocity = 0;
|
public double prevAngularVelocity, angularVelocity = 0;
|
||||||
public float acceleration = 2f;
|
public float acceleration = 2f;
|
||||||
|
|
||||||
/**
|
/** The current rotation of the mechanical node. */
|
||||||
* The current rotation of the mechanical node.
|
|
||||||
*/
|
|
||||||
public double angle = 0;
|
public double angle = 0;
|
||||||
public double prev_angle = 0;
|
public double prev_angle = 0;
|
||||||
protected double maxDeltaAngle = Math.toRadians(180);
|
protected double maxDeltaAngle = Math.toRadians(180);
|
||||||
|
@ -179,9 +174,7 @@ public class MechanicalNode extends Node<INodeProvider, TickingGrid, MechanicalN
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Called when one revolution is made. */
|
||||||
* Called when one revolution is made.
|
|
||||||
*/
|
|
||||||
protected void revolve()
|
protected void revolve()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -218,9 +211,7 @@ public class MechanicalNode extends Node<INodeProvider, TickingGrid, MechanicalN
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The energy percentage loss due to resistance in seconds. */
|
||||||
* The energy percentage loss due to resistance in seconds.
|
|
||||||
*/
|
|
||||||
public double getTorqueLoad()
|
public double getTorqueLoad()
|
||||||
{
|
{
|
||||||
return load;
|
return load;
|
||||||
|
@ -231,9 +222,7 @@ public class MechanicalNode extends Node<INodeProvider, TickingGrid, MechanicalN
|
||||||
return load;
|
return load;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Recache the connections. This is the default connection implementation. */
|
||||||
* Recache the connections. This is the default connection implementation.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void doRecache()
|
public void doRecache()
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,6 +45,7 @@ public class NodeGear implements INode, IConnector<GearNetwork>
|
||||||
public void deconstruct()
|
public void deconstruct()
|
||||||
{
|
{
|
||||||
this.rotationEffectMap.clear();
|
this.rotationEffectMap.clear();
|
||||||
|
this.connections.clear();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,8 +69,7 @@ public class NodeGear implements INode, IConnector<GearNetwork>
|
||||||
@Override
|
@Override
|
||||||
public void setNetwork(GearNetwork network)
|
public void setNetwork(GearNetwork network)
|
||||||
{
|
{
|
||||||
// TODO Auto-generated method stub
|
this.network = network;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue