Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/org/vivecraft/gui/settings/GuiMainVRSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ protected void loadDefaults() {
minecraft.vrSettings.vrWorldRotation = 0;
MCOpenVR.seatedRot = 0;
minecraft.vrSettings.vrWorldScale = 1;
minecraft.vrSettings.vrWorldRotationIncrement = 45f;
minecraft.vrSettings.vrWorldRotationIncrement = 45f;
minecraft.vrSettings.vrWorldRotationIncrementMultiplier = 10;
minecraft.vrSettings.seated = false;
MCOpenVR.clearOffset();
}
Expand Down
3 changes: 3 additions & 0 deletions src/org/vivecraft/gui/settings/GuiSeatedOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class GuiSeatedOptions extends GuiVROptionsBase
new VROptionEntry(VRSettings.VrOptions.SEATED_HUD_XHAIR),
new VROptionEntry(VRSettings.VrOptions.WALK_UP_BLOCKS),
new VROptionEntry(VRSettings.VrOptions.WORLD_ROTATION_INCREMENT),
new VROptionEntry(VRSettings.VrOptions.DUMMY),
new VROptionEntry(VRSettings.VrOptions.WORLD_ROTATION_INCREMENT_MULTIPLIER),
new VROptionEntry(VRSettings.VrOptions.SEATED_FREE_MOVE, true),
new VROptionEntry(VRSettings.VrOptions.DUMMY, true),
new VROptionEntry("Teleport Settings...", (button, mousePos) -> {
Expand Down Expand Up @@ -52,6 +54,7 @@ protected void loadDefaults() {
vrSettings.ySensitivity=1;
vrSettings.seatedHudAltMode = false;
vrSettings.vrWorldRotationIncrement = 45f;
vrSettings.vrWorldRotationIncrementMultiplier = 10;
vrSettings.seatedFreeMove = false;
}

Expand Down
3 changes: 3 additions & 0 deletions src/org/vivecraft/gui/settings/GuiStandingSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class GuiStandingSettings extends GuiVROptionsBase
new VROptionEntry(VRSettings.VrOptions.VEHICLE_ROTATION),
new VROptionEntry(VRSettings.VrOptions.WALK_MULTIPLIER),
new VROptionEntry(VRSettings.VrOptions.WORLD_ROTATION_INCREMENT),
new VROptionEntry(VRSettings.VrOptions.DUMMY),
new VROptionEntry(VRSettings.VrOptions.WORLD_ROTATION_INCREMENT_MULTIPLIER),
new VROptionEntry(VRSettings.VrOptions.BCB_ON),
new VROptionEntry(VRSettings.VrOptions.ALLOW_STANDING_ORIGIN_OFFSET),
new VROptionEntry(VRSettings.VrOptions.FORCE_STANDING_FREE_MOVE, true),
Expand Down Expand Up @@ -51,6 +53,7 @@ protected void loadDefaults() {
vr.vehicleRotation = true;
vr.walkUpBlocks = true;
vr.vrWorldRotationIncrement = 45f;
vr.vrWorldRotationIncrementMultiplier = 10;
vr.allowStandingOriginOffset = false;
vr.forceStandingFreeMove = false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/org/vivecraft/provider/MCOpenVR.java
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ public static void processBindings() {
float ax = getAxis2D(getInputAction(keyRotateAxis)).getX();
if (ax == 0) ax = getAxis2D(getInputAction(keyFreeMoveRotate)).getX();
if (ax != 0) {
float analogRotSpeed = 10 * ax;
float analogRotSpeed = mc.vrSettings.vrWorldRotationIncrementMultiplier * ax;
mc.vrSettings.vrWorldRotation -= analogRotSpeed;
mc.vrSettings.vrWorldRotation = mc.vrSettings.vrWorldRotation % 360;
}
Expand All @@ -1613,7 +1613,7 @@ public static void processBindings() {
float ax = VivecraftMovementInput.getMovementAxisValue(keyRotateLeft);
if(ax > 0){
float analogRotSpeed = 5;
if(ax > 0) analogRotSpeed= 10 * ax;
if(ax > 0) analogRotSpeed= mc.vrSettings.vrWorldRotationIncrementMultiplier * ax;
mc.vrSettings.vrWorldRotation+=analogRotSpeed;
mc.vrSettings.vrWorldRotation = mc.vrSettings.vrWorldRotation % 360;
}
Expand All @@ -1628,7 +1628,7 @@ public static void processBindings() {
float ax = VivecraftMovementInput.getMovementAxisValue(keyRotateRight);
if(ax > 0){
float analogRotSpeed = 5;
if(ax > 0) analogRotSpeed = 10 * ax;
if(ax > 0) analogRotSpeed = mc.vrSettings.vrWorldRotationIncrementMultiplier * ax;
mc.vrSettings.vrWorldRotation-=analogRotSpeed;
mc.vrSettings.vrWorldRotation = mc.vrSettings.vrWorldRotation % 360;
}
Expand Down
21 changes: 19 additions & 2 deletions src/org/vivecraft/settings/VRSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public class VRSettings
public float vrWorldRotation = 0f;
public float vrWorldRotationCached;
public float vrWorldRotationIncrement = 45f;
public int vrWorldRotationIncrementMultiplier = 10;
public float xSensitivity=1f;
public float ySensitivity=1f;
public float keyholeX=15;
Expand Down Expand Up @@ -532,6 +533,10 @@ public void loadOptions(JSONObject theProfiles)
{
this.vrWorldRotationIncrement = this.parseFloat(optionTokens[1]);
}
if (optionTokens[0].equals("vrWorldRotationIncrementMultiplier"))
{
this.vrWorldRotationIncrementMultiplier = Integer.parseInt(optionTokens[1]);
}
if (optionTokens[0].equals("vrFixedCamposX"))
{
this.vrFixedCamposX = this.parseFloat(optionTokens[1]);
Expand Down Expand Up @@ -1072,7 +1077,9 @@ else if(this.weaponCollision == 2)
case WORLD_ROTATION:
return var4 + String.format("%.0f", this.vrWorldRotation);
case WORLD_ROTATION_INCREMENT:
return var4 + (this.vrWorldRotationIncrement == 0 ? "Smooth" : String.format("%.0f", this.vrWorldRotationIncrement));
return var4 + (this.vrWorldRotationIncrement == 0 ? "Smooth" : String.format("%.0f", this.vrWorldRotationIncrement));
case WORLD_ROTATION_INCREMENT_MULTIPLIER:
return var4 + this.vrWorldRotationIncrementMultiplier;
case TOUCH_HOTBAR:
return this.vrTouchHotbar ? var4 + "ON" : var4 + "OFF";
case PLAY_MODE_SEATED:
Expand Down Expand Up @@ -1261,7 +1268,9 @@ public float getOptionFloatValue(VRSettings.VrOptions par1EnumOptions)
if(vrWorldRotationIncrement == 45f) return 2;
if(vrWorldRotationIncrement == 90f) return 3;
if(vrWorldRotationIncrement == 180f) return 4;
return 0;
return 0;
case WORLD_ROTATION_INCREMENT_MULTIPLIER:
return vrWorldRotationIncrementMultiplier;
case MONO_FOV:
return (float) this.mc.gameSettings.fov;
case MIXED_REALITY_FOV:
Expand Down Expand Up @@ -1658,6 +1667,8 @@ public void setOptionFloatValue(VRSettings.VrOptions par1EnumOptions, float par2
if(par2 == 3f) this.vrWorldRotationIncrement = 90f;
if(par2 == 4f) this.vrWorldRotationIncrement = 180f;
break;
case WORLD_ROTATION_INCREMENT_MULTIPLIER:
this.vrWorldRotationIncrementMultiplier=(int)par2;
case X_SENSITIVITY:
this.xSensitivity=par2;
break;
Expand Down Expand Up @@ -1777,6 +1788,7 @@ private void saveOptions(JSONObject theProfiles)
var5.println("worldScale:" + this.vrWorldScale);
var5.println("worldRotation:" + this.vrWorldRotation);
var5.println("vrWorldRotationIncrement:" + this.vrWorldRotationIncrement);
var5.println("vrWorldRotationIncrementMultiplier:" + this.vrWorldRotationIncrementMultiplier);
var5.println("vrFixedCamposX:" + this.vrFixedCamposX);
var5.println("vrFixedCamposY:" + this.vrFixedCamposY);
var5.println("vrFixedCamposZ:" + this.vrFixedCamposZ);
Expand Down Expand Up @@ -2214,6 +2226,11 @@ public static enum VrOptions
"How many degrees to rotate when",
"rotating the world."
}),
WORLD_ROTATION_INCREMENT_MULTIPLIER("Smooth Multiplier", true, false, 1, 50, 1, new String[] {
"A smooth rotation multiplier that",
"applies to Smooth Rotation Increment.",
"The default is 10."
}),
TOUCH_HOTBAR("Touch Hotbar Enabled", false, true,new String[] {
"If enabled allow you to touch the hotbar with",
"your main hand to select an item."
Expand Down