mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Updated Box2D
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user