Skip to content

Commit

Permalink
Improve eye height
Browse files Browse the repository at this point in the history
  • Loading branch information
WenXin20 committed Jan 1, 2025
1 parent 99e79cf commit 9393b57
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,11 @@ private void getDimensions(Pose pose, CallbackInfoReturnable<EntityDimensions> c
float eyeHeightScale = (float) entity.getAttributeValue(AttributesRegistry.EYE_HEIGHT_SCALE);
float heightScale = (float) entity.getAttributeValue(AttributesRegistry.HEIGHT_SCALE);

float scaledHeight = cir.getReturnValue().height();
float scaledWidth = cir.getReturnValue().width();
float scaledHeight;
if (heightScale <= 1)
scaledHeight = cir.getReturnValue().height();
else scaledHeight = cir.getReturnValue().height() * heightScale;

float adjustedEyeHeight = cir.getReturnValue().eyeHeight() * eyeHeightScale * (scaledHeight / cir.getReturnValue().height());

EntityDimensions customDimensions = EntityDimensions.scalable(
Expand Down

0 comments on commit 9393b57

Please sign in to comment.