Skip to content

Commit

Permalink
old changes for cloth capes
Browse files Browse the repository at this point in the history
  • Loading branch information
PepperLola committed Oct 9, 2023
1 parent 0ceba1b commit 5b4c72e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public void renderSmoothCape(AbstractClientPlayer player, float delta, float[] a

GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 0.0F, 0.2F);

// TODO rotate cape when sneaking so it doesn't clip into the player
if (player.isSneaking()) {
GlStateManager.translate(0.0, 0.15F, 0.0);
GlStateManager.rotate(0.5F, 1F, 0F, 0F);
}
// double lvt_9_1_ = player.prevChasingPosX + (player.chasingPosX - player.prevChasingPosX) * (double) delta - (player.prevPosX + (player.posX - player.prevPosX) * (double) delta);
// double lvt_11_1_ = player.prevChasingPosY + (player.chasingPosY - player.prevChasingPosY) * (double) delta - (player.prevPosY + (player.posY - player.prevPosY) * (double) delta);
// double lvt_13_1_ = player.prevChasingPosZ + (player.chasingPosZ - player.prevChasingPosZ) * (double) delta - (player.prevPosZ + (player.posZ - player.prevPosZ) * (double) delta);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ public default void simulate(AbstractClientPlayer player) {
double fallHack = MathHelper.clamp_double((player.prevPosY - player.posY) * 10, 0, 1);
Vector3d strafe = new Vector3d(player.posX - player.prevPosX, player.posY - player.prevPosY, player.posZ - player.prevPosZ);
strafe.rotateDegrees(-player.rotationYaw);
double changeX = (d * o + m * p) + fallHack;
double changeY = (player.posY - player.prevPosY) * heightMul;
double changeX = (d * o + m * p) + fallHack + (player.isSneaking() && !simulation.isSneaking() ? 3 : 0);
double changeY = (player.posY - player.prevPosY) * heightMul + (player.isSneaking() && !simulation.isSneaking() ? 1 : 0);
double changeZ = -strafe.x * strafeMul;
simulation.setSneaking(player.isSneaking());
Vector3d change = new Vector3d(changeX, changeY, changeZ);
simulation.applyMovement(change);
simulation.simulate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class VerletSimulation {
private List<Point> points = new ArrayList<>();
private List<Stick> sticks = new ArrayList<>();
private final int numIterations = 20;
private boolean sneaking = false;

public boolean init(int partCount) {
if (points.size() != partCount) {
Expand Down Expand Up @@ -97,6 +98,14 @@ public int getNumIterations() {
return numIterations;
}

public boolean isSneaking() {
return this.sneaking;
}

public void setSneaking(boolean sneaking) {
this.sneaking = sneaking;
}

public static class Point {
public Vector3d position = new Vector3d();
public Vector3d prevPosition = new Vector3d();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package com.palight.playerinfo.rendering.training;public class TargetRenderer {
}

0 comments on commit 5b4c72e

Please sign in to comment.