Skip to content

Commit

Permalink
Hitbox component
Browse files Browse the repository at this point in the history
  • Loading branch information
jankrassnigg committed Oct 30, 2023
1 parent a20ce61 commit b39fcbd
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pages/docs/physics/jolt/actors/jolt-actors.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Triggers are set up by attaching a [trigger component](jolt-trigger-component.md

## Other Actors

ezEngine comes with a couple of additional components that end up as physics actors in the simulation, but have additional functionality for specific use cases. For example the [query shape actor](jolt-queryshape-actor-component.md) and the [bone collider component (TODO)](../ragdolls/jolt-bone-collider-component.md) can be used to define hit-boxes and the [ragdoll component (TODO)](../ragdolls/jolt-ragdoll-component.md) is used to physically simulate creatures.
ezEngine comes with a couple of additional components that end up as physics actors in the simulation, but have additional functionality for specific use cases. For example the [query shape actor](jolt-queryshape-actor-component.md) and the [hitbox component](../ragdolls/jolt-hitbox-component.md) can be used to define hit-boxes and the [ragdoll component (TODO)](../ragdolls/jolt-ragdoll-component.md) is used to physically simulate creatures.

### Character Controller

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ By using a query shape actor, it is very easy to define that this object only pa
## See Also

* [Jolt Actors](jolt-actors.md)
* [Jolt Bone Collider Component (TODO)](../ragdolls/jolt-bone-collider-component.md)
* [Jolt Hitbox Component](../ragdolls/jolt-hitbox-component.md)
10 changes: 0 additions & 10 deletions pages/docs/physics/jolt/ragdolls/jolt-bone-collider-component.md

This file was deleted.

23 changes: 23 additions & 0 deletions pages/docs/physics/jolt/ragdolls/jolt-hitbox-component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Jolt Hitbox Component

![Hitboxes](media/hitboxes.png)

The *Jolt hitbox component* is used to add collider shapes to an [animated mesh](../../../animation/skeletal-animation/animated-mesh-component.md).

The component must be attached next to another component that defines the [skeleton](../../../animation/skeletal-animation/skeleton-asset.md) to use, for instance an [animated mesh component](../../../animation/skeletal-animation/animated-mesh-component.md) or a [skeleton component](../../../animation/skeletal-animation/skeleton-component.md). It will then use that skeleton to create the physics shapes.

Consequently, the configuration of the hitbox shapes is set up through the [skeleton asset](../../../animation/skeletal-animation/skeleton-asset.md).

The hitboxes are usually used to be able to shoot an animated character. Although they share the collider setup with the [Jolt ragdoll component (TODO)](jolt-ragdoll-component.md), hitboxes and ragdolls are separate features that can be used independently of each other. For example, while a character is alive, it would use hitboxes, so that raycasts can determine where it would be hit, but it would not use a ragdoll component yet. Once a character dies, a ragdoll component would be activated to make it fall to the ground. The hitbox component could now be deactivated (which also makes sense for performance reasons), since it's functionality may not be needed anymore.

## Component Properties

* `Query Shapes Only`: If true, the shapes that get created act the same way as [query shape actors](../actors/jolt-queryshape-actor-component.md). That means the shapes can be detected via raycasts and other shape queries (e.g. the [projectile component](../../../gameplay/projectile-component.md) will be able to hit it), but otherwise they don't participate in the physical simulation. If set to false, full kinematic shapes are used, which means the shapes will push all [dynamic actors](../actors/jolt-dynamic-actor-component.md) aside. This is rarely desired, usually one would rather use a [character controller](../special/jolt-character-controller.md) or a single kinematic actor in the form of a capsule to represent the animated mesh, but in some exceptional cases it might be useful.
* `Update Threshold`: How often the hitboxes are updated to follow the animation. At 0, they are updated every frame. If perfect alignment with the animation is not necessary, it is better for performance to use a larger time step.

## See Also

* [Jolt Ragdoll Component (TODO)](jolt-ragdoll-component.md)
* [Jolt Query Shape Actor Component](../actors/jolt-queryshape-actor-component.md)
* [Skeleton Asset](../../../animation/skeletal-animation/skeleton-asset.md)
* [Skeletal Animations](../../../animation/skeletal-animation/skeletal-animation-overview.md)
2 changes: 1 addition & 1 deletion pages/docs/physics/jolt/ragdolls/jolt-ragdoll-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Ragdolls are a work-in-progress feature. They are partially working, but unfinis
## See Also

* [Skeletal Animations](../../../animation/skeletal-animation/skeletal-animation-overview.md)
* [Jolt Bone Collider Component (TODO)](jolt-bone-collider-component.md)
* [Jolt Hitbox Component](jolt-hitbox-component.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pages/docs/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
#### [Jolt Cone Constraint Component](physics/jolt/constraints/jolt-cone-constraint-component.md)
#### [Jolt Swing-Twist Constraint Component](physics/jolt/constraints/jolt-swing-twist-constraint-component.md)
### Ragdolls
#### [Jolt Bone Collider Component (TODO)](physics/jolt/ragdolls/jolt-bone-collider-component.md)
#### [Jolt Hitbox Component](physics/jolt/ragdolls/jolt-hitbox-component.md)
#### [Jolt Ragdoll Component (TODO)](physics/jolt/ragdolls/jolt-ragdoll-component.md)
### Special
#### [Character Controller](physics/jolt/special/jolt-character-controller.md)
Expand Down

0 comments on commit b39fcbd

Please sign in to comment.