mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
2D Physics and script improvements
- fixed time step - Fixed crash caused by physics script callback being registered in simulation mode - Moved 2D Physics config to file - Finally gave up on the attempt to keep X and Y rotation when applying new Z-rotation from 2D rigidbody to transform and now I can sleep well - Streamlined starting and stopping of scenes - Scripts: execute all inits and OnCreates before OnUpdate
This commit is contained in:
@@ -731,8 +731,7 @@ static class ScriptGlue
|
||||
{
|
||||
Scene scene = ScriptEngine.Context;
|
||||
|
||||
var box2DGravity = Box2D.World.GetGravity(scene.[Friend]_physicsWorld2D);
|
||||
gravity = *(float2*)&box2DGravity;
|
||||
gravity = scene.Physics2DSettings.Gravity;
|
||||
}
|
||||
|
||||
[RegisterCall("ScriptGlue::Physics2D_SetGravity")]
|
||||
@@ -740,8 +739,7 @@ static class ScriptGlue
|
||||
{
|
||||
Scene scene = ScriptEngine.Context;
|
||||
|
||||
#unwarn
|
||||
Box2D.World.SetGravity(scene.[Friend]_physicsWorld2D, gravity);
|
||||
scene.Physics2DSettings.Gravity = gravity;
|
||||
}
|
||||
|
||||
#endregion Physics2D
|
||||
|
||||
Reference in New Issue
Block a user