Engine → Physics → collision_mesh_asset.h
collision_mesh_asset
| Type | Class |
| Namespace | conjure::physics |
| Include File Path | engine/include/conjure/physics/collision_mesh_asset.h |
| Source File Path | engine/src/physics/collision_mesh_asset.cpp |
| API ↗ | Bodies, colliders and characters, Physics |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | collision_mesh_asset(); | |
| public | collision_mesh_asset(
const collision_mesh_asset &) = default; | |
| public | collision_mesh_asset(
collision_mesh_asset &&) noexcept = default; |
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~collision_mesh_asset(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mBounds | math::aabb | {} | |
| private | mIndices | std::vector<u32> | {} | |
| private | mPositions | std::vector<math::vec3> | {} | |
| private | mShapes | std:: | nullptr |
Functions
Public
bounds
bounds[[nodiscard]] const math::aabb &bounds() const noexcept;Bounds of every position (invalid for an empty mesh).
from_geometry
from_geometry[[nodiscard]] static core::result<collision_mesh_asset> from_geometry(
std::span<const math::vec3> positions,
std::span<const u32> indices);Builds a mesh from positions and triangle indices. GEOMETRY_INVALID when the index count is not a multiple of three, an index is out of range, a position is not finite or no non-degenerate triangle remains. Degenerate triangles (repeated vertex or zero area) are dropped; unreferenced vertices are kept.
from_payload
from_payload[[nodiscard]] static core::result<collision_mesh_asset> from_payload(
std::span<const std::byte> payload);Parses a cooked payload. GEOMETRY_INVALID for a short or inconsistent buffer.
has_shapes
has_shapes[[nodiscard]] bool has_shapes() const noexcept;True once the loader built the Jolt shapes (false for a mesh made by from_geometry).
indices
indices[[nodiscard]] std::span<const u32> indices() const noexcept;positions
positions[[nodiscard]] std::span<const math::vec3> positions() const noexcept;set_shapes
set_shapesvoid set_shapes(
std::shared_ptr<const detail::collision_mesh_shapes> shapes) noexcept;Installs the Jolt shapes. For the physics module's own use.
shapes
shapes[[nodiscard]] const detail::collision_mesh_shapes *shapes() const noexcept;The Jolt shapes, or nullptr. For the physics module's own use.
to_payload
to_payload[[nodiscard]] std::vector<std::byte> to_payload() const;The cooked payload of this mesh (deterministic bytes).
triangle_count
triangle_count[[nodiscard]] u32 triangle_count() const noexcept;vertex_count
vertex_count[[nodiscard]] u32 vertex_count() const noexcept;Operator Overloads
Public
operator=
operator=collision_mesh_asset &operator=(
const collision_mesh_asset &) = default;collision_mesh_asset &operator=(
collision_mesh_asset &&) noexcept = default;