Refactor Physics to separate PhysicsBackend

#673
This commit is contained in:
Wojtek Figat
2022-01-20 23:28:43 +01:00
parent cf1af53ab8
commit 427846f73b
66 changed files with 4803 additions and 4327 deletions

View File

@@ -2,36 +2,27 @@
#pragma once
namespace physx
{
class PxRigidActor;
class PxTransform;
}
/// <summary>
/// A base interface for all physical actors types/owners that can responds on transformation changed event.
/// </summary>
class FLAXENGINE_API IPhysicsActor
{
public:
/// <summary>
/// Finalizes an instance of the <see cref="IPhysicsActor"/> class.
/// </summary>
virtual ~IPhysicsActor() = default;
/// <summary>
/// Gets the rigid actor (PhysX object) may be null.
/// Gets the native physics backend object.
/// </summary>
/// <returns>PhysX rigid actor or null if not using</returns>
virtual physx::PxRigidActor* GetRigidActor() = 0;
virtual void* GetPhysicsActor() const = 0;
/// <summary>
/// Called when actor's active transformation gets changed after the physics simulation step.
/// Called when actor's active transformation gets changed after the physics simulation step during.
/// </summary>
/// <remarks>
/// This event is called internally by the Physics service and should not be used by the others.
/// </remarks>
/// <param name="transform">The current transformation.</param>
virtual void OnActiveTransformChanged(const physx::PxTransform& transform) = 0;
virtual void OnActiveTransformChanged() = 0;
};