Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
RigidBodyInternal.hpp
Go to the documentation of this file.
1/**************************************************************************
2 * EngineSquared v0.1.1
3 *
4 * EngineSquared is a software package, part of the Engine² organization.
5 *
6 * This file is part of the EngineSquared project that is under MIT License.
7 * Copyright © 2025-present by @EngineSquared, All rights reserved.
8 *
9 * EngineSquared is a free software: you can redistribute it and/or modify
10 * it under the terms of the MIT License. See the project's LICENSE file for
11 * the full license text and details.
12 *
13 * @file RigidBodyInternal.hpp
14 * @brief Internal RigidBody component for Jolt Physics data storage
15 *
16 * This component is automatically created/destroyed via entt hooks when
17 * RigidBody is added/removed. Users should never directly interact with
18 * this component.
19 *
20 * @author @EngineSquared
21 * @version 0.1.1
22 * @date 2025-10-28
23 **************************************************************************/
24
25#pragma once
26
27#include <Jolt/Jolt.h>
28#include <Jolt/Physics/Body/BodyID.h>
29
30namespace Physics::Component {
31
42 JPH::BodyID bodyID;
43
47 RigidBodyInternal() = default;
48
53 explicit RigidBodyInternal(JPH::BodyID id) : bodyID(id) {}
54
58 [[nodiscard]] bool IsValid() const { return !bodyID.IsInvalid(); }
59};
60
61} // namespace Physics::Component
Definition BoxCollider.hpp:27
RigidBodyInternal(JPH::BodyID id)
Construct with body ID.
Definition RigidBodyInternal.hpp:53
JPH::BodyID bodyID
Jolt Physics body identifier.
Definition RigidBodyInternal.hpp:42
bool IsValid() const
Check if this component has a valid body.
Definition RigidBodyInternal.hpp:58
RigidBodyInternal()=default
Default constructor (invalid body).