Updated Box2D

This commit is contained in:
Simon Lübeß
2023-08-10 20:38:49 +02:00
parent aafcc41286
commit b28ca14e15
4 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -247,7 +247,7 @@ static class ScriptGlue
Entity entity = scene.GetEntityByID(entityId);
var rigidBody = entity.GetComponent<Rigidbody2DComponent>();
Box2D.Body.ApplyForce(rigidBody.[Friend]RuntimeBody, ref *(Box2D.b2Vec2*)&force, ref *(Box2D.b2Vec2*)&point, wakeUp);
Box2D.Body.ApplyForce(rigidBody.[Friend]RuntimeBody, force, point, wakeUp);
}
[RegisterCall("ScriptGlue::RigidBody2D_ApplyForceToCenter")]
@@ -257,7 +257,7 @@ static class ScriptGlue
Entity entity = scene.GetEntityByID(entityId);
var rigidBody = entity.GetComponent<Rigidbody2DComponent>();
Box2D.Body.ApplyForceToCenter(rigidBody.[Friend]RuntimeBody, ref *(Box2D.b2Vec2*)&force, wakeUp);
Box2D.Body.ApplyForceToCenter(rigidBody.[Friend]RuntimeBody, force, wakeUp);
}
#endregion RigidBody2D
@@ -281,7 +281,7 @@ static class ScriptGlue
Scene scene = ScriptEngine.Context;
#unwarn
Box2D.World.SetGravity(scene.[Friend]_physicsWorld2D, ref *(b2Vec2*)&gravity);
Box2D.World.SetGravity(scene.[Friend]_physicsWorld2D, gravity);
}
#endregion Physics2D
@@ -413,7 +413,7 @@ namespace GlitchyEngine.World
{
float angle = Box2D.Body.GetAngle(RuntimeBody);
Box2D.Body.SetTransform(RuntimeBody, ref *(Box2D.b2Vec2*)&position, angle);
Box2D.Body.SetTransform(RuntimeBody, position, angle);
}
}
@@ -433,7 +433,7 @@ namespace GlitchyEngine.World
{
var pos = Box2D.Body.GetPosition(RuntimeBody);
Box2D.Body.SetTransform(RuntimeBody, ref pos, angle);
Box2D.Body.SetTransform(RuntimeBody, pos, angle);
}
}
}
+1 -1
View File
@@ -177,7 +177,7 @@ namespace GlitchyEngine.World
public void OnSimulationStart()
{
_physicsWorld2D = World.Create(ref _gravity2D);
_physicsWorld2D = World.Create(_gravity2D);
_contactListener = b2ContactListener();
_contactListener.beginContactCallback = (contact, userData) =>