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

Internal component storing Jolt soft body reference. More...

#include <SoftBodyInternal.hpp>

Public Member Functions

 SoftBodyInternal ()
 Default constructor (invalid body).
 SoftBodyInternal (JPH::BodyID id)
 Construct with body ID.
 SoftBodyInternal (JPH::BodyID id, std::vector< uint32_t > map)
 Construct with body ID and vertex map.
 SoftBodyInternal (JPH::BodyID id, std::vector< uint32_t > map, const glm::vec3 &scale)
 Construct with body ID, vertex map, and initial scale.
bool IsValid () const
 Check if body ID is valid.

Public Attributes

JPH::BodyID bodyID
 Jolt body ID for the soft body.
std::vector< uint32_t > vertexMap
glm::vec3 initialScale = glm::vec3(1.0f)

Detailed Description

Internal component storing Jolt soft body reference.

Automatically created by SoftBodySystem when a SoftBody component is added. Used to track the Jolt physics body for simulation and updates.

Note
Users should not create this component directly

Constructor & Destructor Documentation

◆ SoftBodyInternal() [1/4]

Physics::Component::SoftBodyInternal::SoftBodyInternal ( )
inline

Default constructor (invalid body).

◆ SoftBodyInternal() [2/4]

Physics::Component::SoftBodyInternal::SoftBodyInternal ( JPH::BodyID id)
inlineexplicit

Construct with body ID.

Parameters
idJolt body ID

◆ SoftBodyInternal() [3/4]

Physics::Component::SoftBodyInternal::SoftBodyInternal ( JPH::BodyID id,
std::vector< uint32_t > map )
inline

Construct with body ID and vertex map.

Parameters
idJolt body ID
mapVertex mapping from original to deduplicated indices

◆ SoftBodyInternal() [4/4]

Physics::Component::SoftBodyInternal::SoftBodyInternal ( JPH::BodyID id,
std::vector< uint32_t > map,
const glm::vec3 & scale )
inline

Construct with body ID, vertex map, and initial scale.

Parameters
idJolt body ID
mapVertex mapping from original to deduplicated indices
scaleInitial scale applied to vertices

Member Function Documentation

◆ IsValid()

bool Physics::Component::SoftBodyInternal::IsValid ( ) const
inlinenodiscard

Check if body ID is valid.

Returns
true if body ID is valid

Member Data Documentation

◆ bodyID

JPH::BodyID Physics::Component::SoftBodyInternal::bodyID

Jolt body ID for the soft body.

◆ initialScale

glm::vec3 Physics::Component::SoftBodyInternal::initialScale = glm::vec3(1.0f)

Initial scale applied to vertices during creation Used to convert Jolt vertices (world-scale) back to local mesh space during sync

◆ vertexMap

std::vector<uint32_t> Physics::Component::SoftBodyInternal::vertexMap

Maps original mesh vertex index to deduplicated Jolt vertex index Used to sync Jolt simulation results back to the original mesh


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