Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Physics::Component::ConvexHullMeshCollider Struct Reference

Convex hull mesh collider. More...

#include <ConvexHullMeshCollider.hpp>

Public Member Functions

 ConvexHullMeshCollider ()=default
 Default constructor.
 ConvexHullMeshCollider (float convexRadius)
 Construct with convex radius.

Public Attributes

float maxConvexRadius = 0.05f
std::optional< Object::Component::Meshmesh
 Optional embedded mesh data for collision (avoids needing entity Mesh component).

Detailed Description

Convex hull mesh collider.

This component creates a convex hull collision shape from mesh data. The mesh can either be embedded in this component or retrieved from the entity's Object::Mesh component. The convex hull is computed automatically by Jolt Physics from the mesh vertices.

If this component is present on an entity with RigidBody, it uses the mesh geometry for collision instead of requiring an explicit collider.

Note
If mesh is not embedded, the entity MUST have an Object::Mesh component.
Convex hulls are more expensive than primitives (Box, Sphere, Capsule) but much cheaper than concave mesh colliders.
Jolt automatically computes the convex hull from the provided points, so interior points are handled correctly.

Constructor & Destructor Documentation

◆ ConvexHullMeshCollider() [1/2]

Physics::Component::ConvexHullMeshCollider::ConvexHullMeshCollider ( )
default

Default constructor.

◆ ConvexHullMeshCollider() [2/2]

Physics::Component::ConvexHullMeshCollider::ConvexHullMeshCollider ( float convexRadius)
inlineexplicit

Construct with convex radius.

Parameters
convexRadiusMaximum convex radius for collision detection

Member Data Documentation

◆ maxConvexRadius

float Physics::Component::ConvexHullMeshCollider::maxConvexRadius = 0.05f

Maximum convex radius (Jolt parameter for collision detection) Smaller values = sharper corners, larger values = smoother but less accurate

◆ mesh

std::optional<Object::Component::Mesh> Physics::Component::ConvexHullMeshCollider::mesh

Optional embedded mesh data for collision (avoids needing entity Mesh component).


The documentation for this struct was generated from the following file: