fix(physics): editor drag teleports dynamic bodies
SyncScene only reconciled static/kinematic transforms into Jolt bodies; dragging a dynamic entity (esp. while paused, where Writeback never runs) moved the visual but left the body -- and the collider debug wireframe -- at the old pose. Dynamic bodies now get the same drag reconciliation (teleport + zero velocity + activate), and Writeback syncs lastPos/lastRot to the body pose so physics motion is never misread as editor dragging (which would teleport the body back).
This commit is contained in:
@@ -119,7 +119,7 @@ namespace Engine {
|
||||
};
|
||||
|
||||
void SyncScene(); // 对账:孤儿清理 / 创建 / 参数同步
|
||||
void Writeback() const; // 动态体 → TransformComponent(标脏)
|
||||
void Writeback(); // 动态体 → TransformComponent(标脏)+ lastPos/lastRot 对账基线
|
||||
void UpdateAccels(f32 dt); // 速度差分 → BodyRecord.lastAccel(step 率)
|
||||
void CollectDebugData(); // 按 m_DebugBits 收集调试图元(渲染帧率)
|
||||
void CreateBody(u32 entityBits, ECS::RigidBodyComponent& rb,
|
||||
|
||||
Reference in New Issue
Block a user