Skip to content

Commit

Permalink
fix partial ticks^2
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jun 7, 2024
1 parent bb005f8 commit 0d61c8d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ private static long writeCamera(long ptr) {

private static long writeTime(long ptr, RenderContext context) {
int ticks = ((LevelRendererAccessor) context.renderer()).flywheel$getTicks();
float partialTick = context.partialTick();
//fixme checkover partialTick
float partialTick = context.deltaTracker().getGameTimeDeltaPartialTick(true);
float renderTicks = ticks + partialTick;
float renderSeconds = renderTicks / 20f;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public static void update(RenderContext context) {

PlayerInfo info = ((AbstractClientPlayerAccessor) player).flywheel$getPlayerInfo();

Vec3 eyePos = player.getEyePosition(context.partialTick());
//fixme checkover partialTick
Vec3 eyePos = player.getEyePosition(context.deltaTracker().getGameTimeDeltaPartialTick(true));
ptr = writeVec3(ptr, (float) eyePos.x, (float) eyePos.y, (float) eyePos.z);

ptr = writeTeamColor(ptr, info.getTeam());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ private VisualizationManagerImpl(LevelAccessor level) {
tickPlan = NestedPlan.of(blockEntities.tickPlan(), entities.tickPlan(), effects.tickPlan())
.then(RaisePlan.raise(tickFlag));

var recreate = SimplePlan.<RenderContext>of(context -> blockEntitiesStorage.recreateAll(context.partialTick()),
context -> entitiesStorage.recreateAll(context.partialTick()),
context -> effectsStorage.recreateAll(context.partialTick()));
//fixme checkover partialTick
var recreate = SimplePlan.<RenderContext>of(context -> blockEntitiesStorage.recreateAll(context.deltaTracker().getGameTimeDeltaPartialTick(true)),
context -> entitiesStorage.recreateAll(context.deltaTracker().getGameTimeDeltaPartialTick(true)),
context -> effectsStorage.recreateAll(context.deltaTracker().getGameTimeDeltaPartialTick(true)));

var update = MapContextPlan.map(this::createVisualFrameContext)
.to(NestedPlan.of(blockEntities.framePlan(), entities.framePlan(), effects.framePlan()));
Expand Down Expand Up @@ -128,7 +129,8 @@ private DynamicVisual.Context createVisualFrameContext(RenderContext ctx) {
viewProjection.translate((float) (renderOrigin.getX() - cameraPos.x), (float) (renderOrigin.getY() - cameraPos.y), (float) (renderOrigin.getZ() - cameraPos.z));
FrustumIntersection frustum = new FrustumIntersection(viewProjection);

return new DynamicVisualContextImpl(ctx.camera(), frustum, ctx.partialTick(), frameLimiter);
//fixme checkover partialTick
return new DynamicVisualContextImpl(ctx.camera(), frustum, ctx.deltaTracker().getGameTimeDeltaPartialTick(true), frameLimiter);
}

protected DistanceUpdateLimiterImpl createUpdateLimiter() {
Expand Down

0 comments on commit 0d61c8d

Please sign in to comment.