Refactor PhysX vehicles and cloth simulation code to be more readable

#2796
This commit is contained in:
Wojtek Figat
2024-07-25 13:51:32 +02:00
parent 3ac7dfbd3a
commit 1891b9e367
4 changed files with 518 additions and 493 deletions

View File

@@ -27,6 +27,11 @@ Cloth::Cloth(const SpawnParams& params)
_drawCategory = SceneRendering::SceneDrawAsync;
}
void* Cloth::GetPhysicsCloth() const
{
return _cloth;
}
ModelInstanceActor::MeshReference Cloth::GetMesh() const
{
auto value = _mesh;

View File

@@ -13,7 +13,6 @@
/// </summary>
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Cloth\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API Cloth : public Actor
{
friend class PhysicsBackend;
DECLARE_SCENE_OBJECT(Cloth);
/// <summary>
@@ -231,6 +230,11 @@ private:
Array<float> _paint;
public:
/// <summary>
/// Gets the native physics backend object.
/// </summary>
void* GetPhysicsCloth() const;
/// <summary>
/// Gets the mesh to use for the cloth simulation (single mesh from specific LOD). Always from the parent static or animated model actor.
/// </summary>

View File

@@ -13,6 +13,7 @@
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Wheeled Vehicle\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API WheeledVehicle : public RigidBody
{
friend class PhysicsBackend;
friend struct ScenePhysX;
DECLARE_SCENE_OBJECT(WheeledVehicle);
/// <summary>

File diff suppressed because it is too large Load Diff