Jump to content
  • entries
    943
  • comments
    5,899
  • views
    924,416

Say Goodbye to Hitboxes


Josh

3,210 views

 Share

The limiting step on getting animated characters into Leadwerks is the creation of "hitboxes". Since vertex sknning is done entirely on the GPU, static boxes are attached to bones to approximate the shape of each limb. This works well and is efficient, but very tedious to set up. The zombie character pack, for example, would have been released much sooner if not for this task.

 

This morning I began with the intention of adding an option in the Model Editor to automatically calculate hit boxes for an animated model. However, I quickly realized this could be made completely automatic at load time.

 

I added a new pick mode called BoxPick, which you can probably guess does what. An Entity::SetPickBox() command was added. Then I modified the bone entity class. When a model is loaded, each bone automatically calculates its own pick box from any vertices in the model that are attached to that bone, with a weight of 50% or greater. The results are completely automatic hitboxes on all animated models that aliminate the need to manually attach these:

 

blogentry-1-0-58780200-1418862394_thumb.jpg

 

Combined with yesterday's convex decomposition update, the major bottlenecks in the model import process have been eradicated, making it easier for third party artists to add content to the Leadwerks Workshop. An update will be available later tonight with these additions.

  • Upvote 8
 Share

2 Comments


Recommended Comments

Super cool! I've always felt that hitboxes were a pain to make, but this should definitely help.

 

If you select convex decomposition, will the actual geometry be ignored for raycasts and such?

Link to comment

Normally picking is done on the visual meshes, while physics is a different set of geometry. Picking can also be performed on a sphere shape, and now a box shape. It can be confusing, I know, but this doesn't actually have anything to do with the convex decomposition, and there's a good reason for all that.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  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.

×
×
  • Create New...