Sdk/PhysicsComponent2D: Fix copy
This commit is contained in:
@@ -86,7 +86,10 @@ namespace Ndk
|
||||
static ComponentIndex componentIndex;
|
||||
|
||||
private:
|
||||
inline void ApplyPhysicsState(Nz::RigidBody2D& rigidBody) const;
|
||||
inline void CopyPhysicsState(const Nz::RigidBody2D& rigidBody);
|
||||
Nz::RigidBody2D* GetRigidBody();
|
||||
const Nz::RigidBody2D* GetRigidBody() const;
|
||||
|
||||
void OnAttached() override;
|
||||
void OnComponentAttached(BaseComponent& component) override;
|
||||
@@ -94,7 +97,27 @@ namespace Ndk
|
||||
void OnDetached() override;
|
||||
void OnEntityDestruction() override;
|
||||
|
||||
struct PendingPhysObjectStates
|
||||
{
|
||||
struct ShapeStates
|
||||
{
|
||||
Nz::Vector2f surfaceVelocity;
|
||||
float elasticity;
|
||||
float friction;
|
||||
};
|
||||
|
||||
VelocityFunc velocityFunc;
|
||||
std::vector<ShapeStates> shapes;
|
||||
Nz::RadianAnglef angularVelocity;
|
||||
Nz::Vector2f massCenter;
|
||||
Nz::Vector2f velocity;
|
||||
bool valid = false;
|
||||
float mass;
|
||||
float momentOfInertia;
|
||||
};
|
||||
|
||||
std::unique_ptr<Nz::RigidBody2D> m_object;
|
||||
PendingPhysObjectStates m_pendingStates;
|
||||
bool m_nodeSynchronizationEnabled;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user