SDK/PhysicsComponent2D: Add node synchronization

This commit is contained in:
Lynix
2018-10-24 20:38:20 +02:00
parent a292e47673
commit 2c0c8ef0a0
4 changed files with 54 additions and 11 deletions

View File

@@ -24,7 +24,7 @@ namespace Ndk
friend class ConstraintComponent2D;
public:
PhysicsComponent2D() = default;
PhysicsComponent2D();
PhysicsComponent2D(const PhysicsComponent2D& physics);
~PhysicsComponent2D() = default;
@@ -36,6 +36,8 @@ namespace Ndk
inline bool ClosestPointQuery(const Nz::Vector2f& position, Nz::Vector2f* closestPoint, float* closestDistance) const;
inline void EnableNodeSynchronization(bool nodeSynchronization);
inline Nz::Rectf GetAABB() const;
inline float GetAngularDamping() const;
inline Nz::RadianAnglef GetAngularVelocity() const;
@@ -52,6 +54,7 @@ namespace Ndk
inline std::size_t GetShapeCount() const;
inline Nz::Vector2f GetVelocity() const;
inline bool IsNodeSynchronizationEnabled() const;
inline bool IsSleeping() const;
inline void SetAngularDamping(float angularDamping);
@@ -81,6 +84,7 @@ namespace Ndk
void OnEntityDestruction() override;
std::unique_ptr<Nz::RigidBody2D> m_object;
bool m_nodeSynchronizationEnabled;
};
}