Skip to content

Commit

Permalink
32pre
Browse files Browse the repository at this point in the history
Roomscale and seated changes
  • Loading branch information
jrbudda committed Nov 29, 2016
1 parent 0511059 commit 218eb3c
Show file tree
Hide file tree
Showing 36 changed files with 2,264 additions and 1,714 deletions.
2 changes: 1 addition & 1 deletion installer/vivecraft-1.7.10-forge-shadersmod.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
},
{
"name": "com.sun:jna:4.2.1",
"url": "http://automat-gh.github.io/minecrift/"
"url": "http://vivecraft.org/jar/"
},
{
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1",
Expand Down
2 changes: 1 addition & 1 deletion installer/vivecraft-1.7.10-forge.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
},
{
"name": "com.sun:jna:4.2.1",
"url": "http://automat-gh.github.io/minecrift/"
"url": "http://vivecraft.org/jar/"
},
{
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1",
Expand Down
2 changes: 1 addition & 1 deletion installer/vivecraft-1.7.10-shadersmod.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"name": "net.minecraft:launchwrapper:1.12"
},
{
"url": "http://automat-gh.github.io/minecrift/",
"url": "http://vivecraft.org/jar/",
"name": "com.sun:jna:4.2.1"
},
{
Expand Down
2 changes: 1 addition & 1 deletion installer/vivecraft-1.7.10.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"name": "net.minecraft:launchwrapper:1.12"
},
{
"url": "http://automat-gh.github.io/minecrift/",
"url": "http://vivecraft.org/jar/",
"name": "com.sun:jna:4.2.1"
},
{
Expand Down
2 changes: 1 addition & 1 deletion minecriftversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
of_json_name = "1.7.10_HD_U_D1"
of_file_md5 = "57c724fe8335c82aef8d54c101043e60"
minecrift_version_num = "1.7.10"
minecrift_build = "Vivecraft-jrbudda31r3"
minecrift_build = "Vivecraft-jrbudda32"
of_file_extension = ".jar"
mcp_version = "mcp908"
mcp_uses_generics = False
Expand Down
48 changes: 26 additions & 22 deletions patches/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -1,40 +1,102 @@
@@ -1,40 +1,108 @@
package net.minecraft.client;

-import com.google.common.collect.Iterables;
Expand Down Expand Up @@ -84,6 +84,12 @@
+import com.mtbs3d.minecrift.api.IRoomscaleAdapter;
+import com.mtbs3d.minecrift.api.IStereoProvider;
+import com.mtbs3d.minecrift.gameplay.BowTracker;
+import com.mtbs3d.minecrift.gameplay.ClimbTracker;
+import com.mtbs3d.minecrift.gameplay.EatingTracker;
+import com.mtbs3d.minecrift.gameplay.JumpTracker;
+import com.mtbs3d.minecrift.gameplay.RunTracker;
+import com.mtbs3d.minecrift.gameplay.SneakTracker;
+import com.mtbs3d.minecrift.gameplay.SwimTracker;
+import com.mtbs3d.minecrift.provider.MCOpenVR;
+import com.mtbs3d.minecrift.provider.NullStereoRenderer;
+import com.mtbs3d.minecrift.provider.OpenVRPlayer;
Expand Down Expand Up @@ -113,7 +119,7 @@
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiChat;
@@ -68,6 +130,8 @@
@@ -68,6 +136,8 @@
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
Expand All @@ -122,15 +128,15 @@
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.client.renderer.texture.TextureManager;
@@ -97,6 +161,7 @@
@@ -97,6 +167,7 @@
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.shader.Framebuffer;
+import net.minecraft.client.shader.ShaderGroup;
import net.minecraft.client.stream.IStream;
import net.minecraft.client.stream.NullStream;
import net.minecraft.client.stream.TwitchStream;
@@ -127,6 +192,8 @@
@@ -127,6 +198,8 @@
import net.minecraft.profiler.Profiler;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.integrated.IntegratedServer;
Expand All @@ -139,15 +145,15 @@
import net.minecraft.stats.AchievementList;
import net.minecraft.stats.IStatStringFormat;
import net.minecraft.stats.StatFileWriter;
@@ -142,6 +209,7 @@
@@ -142,6 +215,7 @@
import net.minecraft.util.Session;
import net.minecraft.util.Timer;
import net.minecraft.util.Util;
+import net.minecraft.util.Vec3;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.WorldProviderEnd;
import net.minecraft.world.WorldProviderHell;
@@ -150,2988 +218,4803 @@
@@ -150,2988 +224,4801 @@
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.WorldInfo;
Expand Down Expand Up @@ -1751,8 +1757,14 @@
+ // VIVE START - teleport movement
+ public OpenVRPlayer vrPlayer;
+ public IRoomscaleAdapter roomScale;
+ public BowTracker bowTracker = new BowTracker();
+
+ public BowTracker bowTracker = new BowTracker();
+ public SwimTracker swimTracker = new SwimTracker();
+ public EatingTracker autoFood=new EatingTracker();
+ public JumpTracker jumpTracker=new JumpTracker();
+ public SneakTracker sneakTracker=new SneakTracker();
+ public ClimbTracker climbTracker = new ClimbTracker();
+ public RunTracker runTracker = new RunTracker();
+
+ // VIVE END - teleport movement
+
+ // VIVE START - vive ui debugging
Expand Down Expand Up @@ -1971,7 +1983,7 @@
+ * The minecriftVerString will be automatically updated by the build scripts, do not modify here.
+ * Modify minecriftversion.py in root minecrift dir.
+ */
+ public final String minecriftVerString = "Vivecraft 1.7.10 Vivecraft-jrbudda31r3";
+ public final String minecriftVerString = "Vivecraft 1.7.10 Vivecraft-jrbudda32";
+ /* end version */
+ /** END MINECRIFT */
+
Expand Down Expand Up @@ -2414,13 +2426,6 @@
+ this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort));
+ }
+ }
+ else if (this.vrSettings.firstLoad) {
+ // VIVE START - don't force options screen, player should try defaults first
+ //this.displayGuiScreen(new GuiMinecriftSettings(new GuiMainMenu(), vrSettings, gameSettings) );
+ this.displayGuiScreen(new GuiMainMenu());
+ // VIVE END - don't force options screen, player should try defaults first
+ this.vrSettings.firstLoad = false;
+ }
+ else
+ {
+ this.displayGuiScreen(new GuiMainMenu());
Expand Down Expand Up @@ -2776,6 +2781,7 @@
+ finally
+ {
+ Display.destroy();
+ MCOpenVR.destroy();
+
+ if (!this.hasCrashed)
+ {
Expand Down Expand Up @@ -5577,7 +5583,8 @@
+ {
+ if (!this.gameSettings.keyBindUseItem.getIsKeyPressed() && (bowTracker.isActive(thePlayer) == false || vrSettings.seated))
+ {
+ this.playerController.onStoppedUsingItem(this.thePlayer);
+ if(!autoFood.isEating())
+ this.playerController.onStoppedUsingItem(this.thePlayer);
+ }
+
+ label391:
Expand All @@ -5603,7 +5610,7 @@
+ }
+ }
+ }
+ else
+ else //not using item
+ {
+ if (this.gameSettings.keyBindAttack.getIsKeyPressed() && currentScreen == null)
+ {
Expand Down Expand Up @@ -6913,8 +6920,6 @@
+ {
+ boolean changeNonDestructiveRenderConfig = false;
+
+ glConfig.mirrorDisplay = this.vrSettings.displayMirrorMode == VRSettings.MIRROR_OFF ? false : true;
+ glConfig.usePositionalTimewarp = this.vrSettings.usePositionalTimewarp;
+
+ if (clipPlanesChanged())
+ {
Expand Down Expand Up @@ -7193,7 +7198,6 @@
+ {
+ // We had an issue. Set the usual suspects to defaults...
+ this.vrSettings.useFsaa = false;
+ this.vrSettings.fsaaScaleFactor = 1.4f;
+ this.vrSettings.saveOptions();
+ System.out.println("[Minecrift] FAILED to setup FSAA: " + ex.getMessage());
+ reinitFramebuffers = true;
Expand All @@ -7216,7 +7220,7 @@
+ "\nRender target width: " + (this.stereoProvider.isStereo() ? EyeTextureSize.w + EyeTextureSize.w: this.displayWidth) +
+ ", height: " + (this.stereoProvider.isStereo() ? Math.max(EyeTextureSize.h, EyeTextureSize.h) : this.displayHeight) +
+ (this.stereoProvider.isStereo() ? " [Render scale: " + this.vrSettings.renderScaleFactor + "]" : "") +
+ (this.vrSettings.useFsaa ? " [FSAA Scale: " + this.vrSettings.fsaaScaleFactor + "]" : "") +
+ (this.vrSettings.useFsaa ? " [FSAA Scale: " + this.vrSettings.renderScaleFactor + "]" : "") +
+ "\nDisplay target width: " + this.displayFBWidth + ", height: " + displayFBHeight);
+
+ // Init shaders
Expand Down
47 changes: 32 additions & 15 deletions patches/net/minecraft/client/entity/EntityPlayerSP.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@
this.worldObj.playSound(this.posX, this.posY - (double)this.yOffset, this.posZ, name, volume, pitch, false);
}

@@ -662,4 +854,268 @@
@@ -662,4 +854,285 @@
}

protected void sendHorseJump() {}
Expand Down Expand Up @@ -529,20 +529,36 @@
+ IRoomscaleAdapter con = mc.roomScale;
+
+ // Account for pitch if required
+ if(this.capabilities.isFlying || this.inWater)
+ if (Minecraft.getMinecraft().vrSettings.allowPitchAffectsHeightWhileFlying) {
+ if (vr.useLControllerForRestricedMovement) {//these are negative cause directionvec is backwards in the z direction.
+ directionVec.rotateAroundX(con.getControllerOffhandPitch_World() * PIOVER180);
+ } else {
+ directionVec.rotateAroundX(con.getHMDPitch_World()* PIOVER180);
+ }
+ }
+
+ // Account for yaw
+ if (vr.useLControllerForRestricedMovement) { //these are negative cause directionvec is backwards in the z direction.
+ directionVec.rotateAroundY(-con.getControllerOffhandYaw_World() * PIOVER180);
+ } else {
+ directionVec.rotateAroundY(-con.getHMDYaw_World()* PIOVER180);
+ if(mc.vrSettings.seated){
+ directionVec=directionVec.rotateYaw(-con.getControllerOffhandYaw_World() * PIOVER180);
+ }else{
+ if(this.capabilities.isFlying || this.inWater){
+ switch (mc.vrSettings.vrFreeMoveMode){
+ case VRSettings.FREEMOVE_CONTROLLER:
+ directionVec.rotateAroundX(con.getControllerOffhandPitch_World() * PIOVER180);
+ break;
+ case VRSettings.FREEMOVE_HMD:
+ directionVec.rotateAroundX(con.getHMDPitch_World()* PIOVER180);
+ break;
+ case VRSettings.FREEMOVE_RUNINPLACE:
+ //hmd pitch
+ directionVec.rotateAroundX(con.getHMDPitch_World()* PIOVER180);
+ break;
+ }
+ }
+
+ switch (mc.vrSettings.vrFreeMoveMode){
+ case VRSettings.FREEMOVE_CONTROLLER:
+ directionVec.rotateAroundY(-con.getControllerOffhandYaw_World() * PIOVER180);
+ break;
+ case VRSettings.FREEMOVE_HMD:
+ directionVec.rotateAroundY(-con.getHMDYaw_World() * PIOVER180);
+ break;
+ case VRSettings.FREEMOVE_RUNINPLACE:
+ directionVec.rotateAroundY((float) (-mc.runTracker.getYaw() * PIOVER180));
+ directionVec = OpenVRPlayer.vecMult(directionVec, (float)mc.runTracker.getSpeed());
+ break;
+ }
+ }
+
+ mX = directionVec.xCoord;
Expand Down Expand Up @@ -663,6 +679,7 @@
+ boolean client = this instanceof EntityPlayerSP;
+ boolean freemove = OpenVRPlayer.get().getFreeMoveMode();
+ boolean doY = freemove || (Minecraft.getMinecraft().vrSettings.simulateFalling && !this.isOnLadder()) && !this.isSneaking();
+
+ Vec3 roomOrigin = OpenVRPlayer.get().getRoomOriginPos_World();
+ // Vec3 camloc = Minecraft.getMinecraft().roomScale.getHMDPos_World();
+
Expand Down
Loading

0 comments on commit 218eb3c

Please sign in to comment.