Intial Commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package localmods.mtkviewpoint;
|
||||
|
||||
import me.zed_0xff.zombie_buddy.Exposer.LuaClass;
|
||||
import viewpoint.core.View;
|
||||
import viewpoint.input.FreeCam;
|
||||
import viewpoint.input.Look;
|
||||
|
||||
/** Read-only bridge to Viewpoint 0.1.6.1; never changes capture or camera state. */
|
||||
@LuaClass(name = "MTKViewpointCamera")
|
||||
public final class CameraBridge {
|
||||
private CameraBridge() {}
|
||||
|
||||
public static boolean enabled() {
|
||||
return View.enabled;
|
||||
}
|
||||
|
||||
public static boolean captured() {
|
||||
return View.enabled && Look.captured && !FreeCam.active;
|
||||
}
|
||||
|
||||
public static Double heading() {
|
||||
float yaw = Look.yaw;
|
||||
if (!captured() || !Float.isFinite(yaw)) return null;
|
||||
// Viewpoint Controls.face uses cos(yaw), sin(yaw) in game-world XY.
|
||||
return (Math.toDegrees(yaw) % 360.0 + 360.0) % 360.0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user