You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something like this which allows to make (UI stuff especially) abstract over yaw, pitch, and roll. These are often the gizmo handles or how you want to tell the chest to yaw, pitch, roll, etc..
public enum YawPitchRollAxis
{
YAW(Axis3D.Z), PITCH(Axis3D.Y), ROLL(Axis3D.X);
private final Axis3D axis3D;
private final String lowerCasedName;
private final String pascalCasedName;
YawPitchRollAxis(Axis3D axis3D)
{
this.axis3D = axis3D;
lowerCasedName = name().toLowerCase();
pascalCasedName = StringUtils.capitalize(lowerCasedName);
}
public YawPitchRoll createYawPitchRoll(double angle)
{
YawPitchRoll yawPitchRoll = new YawPitchRoll();
switch (this)
{
case YAW -> yawPitchRoll.setYaw(angle);
case PITCH -> yawPitchRoll.setPitch(angle);
case ROLL -> yawPitchRoll.setRoll(angle);
}
return yawPitchRoll;
}
private double getFromYawPitchRoll(YawPitchRollReadOnly yawPitchRollReadOnly)
{
return switch (this)
{
case YAW -> yawPitchRollReadOnly.getYaw();
case PITCH -> yawPitchRollReadOnly.getPitch();
case ROLL -> yawPitchRollReadOnly.getRoll();
};
}
public Axis3D getAxis3D()
{
return axis3D;
}
public String getLowerCasedName()
{
return lowerCasedName;
}
public String getPascalCasedName()
{
return pascalCasedName;
}
}
The text was updated successfully, but these errors were encountered:
Something like this which allows to make (UI stuff especially) abstract over yaw, pitch, and roll. These are often the gizmo handles or how you want to tell the chest to yaw, pitch, roll, etc..
The text was updated successfully, but these errors were encountered: