Jump to content

[1.7.10] Another setsize weird behavior question ...


Recommended Posts

Posted

Hi guys,

 

I have a fish model that is scaled down to 0.10F in its render class as follow ... the scale end up fine.

 

@Override
    protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2)
    {
        this.scaleFish((EntityClownFish)par1EntityLivingBase, par2);
    }
    
    protected void scaleFish(EntityClownFish par1, float par2)
    {
    	float scale = (float)par1.GetRenderValueFromSize();
        GL11.glScalef(scale, scale, scale);
    }

 

BUT as soon as I am trying to set the collision box smaller than setsize(0.5F,0.5F), the fish is thrown to the ground and die after few seconds.

 

In the following picture, I set it to setsize(0.3F,0.3F) ... this is the result. But like I said, if I set it to 0.5F,0.5F it is fine ... but the box is too big. Am I missing something? Is it because I scaled down the model too much?

 

 

 

 

 

 

 

setsize.png

Posted

It has nothing to do with your render scaling. There is no real interaction between bounding box and rendered model.

 

There may well be a limit on how small the bounding box can be. There certainly is limit to how big you can make it. The thing is that the bounding box is used for path-finding and to make the path-finding code efficient they can't allow too extreme of size and also don't rotate the bounding box and lastly make the X and Z to always be same.

 

So there is probably some pathfinding that is messing up and then moving the entity.

 

Anyway, you should test whether it is the height or the width of the bounding box that is causing the problem. Because in worst case you can at least make some of the dimensions match more closely.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

It has nothing to do with your render scaling. There is no real interaction between bounding box and rendered model.

 

There may well be a limit on how small the bounding box can be. There certainly is limit to how big you can make it. The thing is that the bounding box is used for path-finding and to make the path-finding code efficient they can't allow too extreme of size and also don't rotate the bounding box and lastly make the X and Z to always be same.

 

So there is probably some pathfinding that is messing up and then moving the entity.

 

Anyway, you should test whether it is the height or the width of the bounding box that is causing the problem. Because in worst case you can at least make some of the dimensions match more closely.

 

Actually the issue is at the height level. Width is fine in any sizes. Also, the model render is very jumpy (up and down) when I put the size smaller than 0.80.  At 0.80 everything is fine. At 0.79 ...I am starting to see many up/down shake and bubbles (the particle effect ... no clue why).

 

setSize drives me nuts. ;)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.