This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
Gestus/src/main/java/com/thebrokenrail/gestus/emote/EmoteFrame.java

26 lines
842 B
Java

package com.thebrokenrail.gestus.emote;
import net.minecraft.util.math.EulerAngle;
import java.util.HashMap;
import java.util.Map;
public class EmoteFrame {
public final Map<EmotePart, EulerAngle> normal;
public final Map<EmotePart, EulerAngle> mirrored;
public EmoteFrame(Map<EmotePart, EulerAngle> data) {
normal = data;
mirrored = mirror(data);
}
private static Map<EmotePart, EulerAngle> mirror(Map<EmotePart, EulerAngle> data) {
Map<EmotePart, EulerAngle> result = new HashMap<>();
for (Map.Entry<EmotePart, EulerAngle> entry : data.entrySet()) {
EmotePart newPart = entry.getKey().mirror();
result.put(newPart, new EulerAngle(entry.getValue().getPitch(), -entry.getValue().getYaw(), -entry.getValue().getRoll()));
}
return result;
}
}