Jump to content

setBounds help


MyOwnHarem

Recommended Posts

I am having problems with set bounds. I've modeled a block, about 2x2 in size, and set it's bounds to this:

 

// x axis bounds

// -1.0f - 0.0f Left

// 0.0f - 1.0f Right

 

// y axis bounds

// 0.0f - 1.0f Bottom

// 1.0f - 2.0f Top

 

// z axis bounds

// 0.5f Front

// 0.6f Back

 

this.setBlockBounds(-1.0f, 0.0f, 0.5f, 1.0f, 2.0f, 0.6f);

 

when I look at the bottom left part (-1.0f) on the bounds, it shows the bounds and encompasses the whole block, however, if I look at any other position on the other 3 sections of the model, then the bounds disappear/don't show up, as well as the right 2 blocks have no collision but the left 2 blocks do have collision. But the top left one like all the right blocks don't render the bounds when looked at.

 

How do I get the bounds to display on all portions, and make all portions solid?

 

*Working on uploading screenshots*

Link to comment
Share on other sites

I don't think blocks like having bounds outside a full cube.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Hi

 

The ray tracing code for figuring out which block you're looking at is in World.rayTraceBlocks_do_do

 

I think the problem might be that the ray-tracing code implicitly assumes all blocks are contained within a 1x1x1 cube.  You could test this directly by adding some breakpoints or logging System.out.println to the code in this method.

 

Perhaps you'd be better off to model your 2x2 block as 4 individual blocks.  You could use the DrawBlockHighlightEvent to create your custom bounding-box renderer - i.e. normal render if looking at a normal block, 2x2 size render if looking at your custom block.  See also RenderGlobal.drawSelectionBox.

 

-TGG

 

Link to comment
Share on other sites

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.