I’m trying to port it to a different language (Xojo) but there’s one part of the source code that I can’t work out (it may be because C# is not my main language).
In Dynamics/Contacts/Contact.cs there are references to what looks like a global Collision object but I can’t find it’s definition. For instance, on line 405, in the switch:
Hi, there a question. Is for your engine something like documentation, i started to learn monogame newly and want to get something bigger that only forum.
World.Gravity is now a Property and throws InvalidOperationException if set during stepping.
Delegate QueryCallback renamed to QueryReportFixtureDelegate to match box2d.
Delegate RayCastCallback renamed to RayCastReportFixtureDelegate to match box2d.
DebugViewBase and DebugViewFlags moved to Diagnostics.
Improve memory allocation of internal buffers.
Internal callbacks for Query/RayCast are cached.
The following methods were marked obsolete:
new World(AABB span)
List QueryAABB(ref AABB aabb)
List RayCast(Vector2 point1, Vector2 point2)
List TestPointAll(Vector2 point)
The following methods were Removed (Deprecated in version 1.2)
Body.IsStatic
Body.IsKinematic
Added support for netstandard2.0.
Added standalone library without dependencies to monogame. (net40 & netstandard2.0)
From v1.5 the nuget package Aether.Physics2D contain the standalone library with no dependencies to 3rd party math libraries (microsoft.XNA.Framework.Vector2).
The monogame based library and the monogame based diagnostics were moved to Aether.Physics2D.MG and Aether.Physics2D.Diagnostics.MG. To upgrade to the new version please replace the nuget reference with the new one. Sorry for this inconvenience.
The following properties are now read-only collections:
Body.FixtureList, World
World.BodyList
World.JointList
World.ControllerList
Added Joint.World property
Added DebugViewFlags.None flag
The following methods/properties were marked obsolete:
Body.IslandIndex
Body.SetRestitution(…)
Body.SetFriction(…)
Body.SetCollisionCategories(…)
Body.SetCollidesWith(…)
Body.SetCollisionGroup(…)
Body.SetIsSensor(…)
The following methods/properties were Removed
World.IsStepping (Deprecated in version 1.3)
World(AABB span) (Deprecated in version 1.5)
World.QueryAABB(ref AABB aabb) (Deprecated in version 1.5)
World.RayCast(Vector2 point1, Vector2 point2) (Deprecated in version 1.5)
World.TestPointAll(Vector2 point) (Deprecated in version 1.5)
I´ve started to implement Aether.Physics2D on my game after dabbling a bit with Farseer. I have a quick question that is confusing me a little bit:
The ConvertUnits was removed. An orthographic camera (View&Projection) is preferred for rendering your Physics world.
You can find ConvertUnits here and copy it in your project if you find it useful.
Without the ConvertUnits the default display units to sim Ratio is 100f? because I used to set it to 64 pixels per meter due the size of my sprites.
Sorry if my question is dumb, I´m just getting used to implementing the engine and I’m having some troubles setting the sizes of the bodies to match the sprites sizes, resulting in wierd collisions probably due to bodies overlapping
The library doesn’t do any conversion. ConvertUnits was simply a multiplication with a factor.
This is something you do in the draw method, and you choose your own units to sim, or dpi.
Preferably you can incorporate this into your camera view matrix if you implement resolution independent rendering.
Does anyone know a way to increase the maximum velocity (seems to be 120) of bodies? I’d take a hit on precision if I could increase velocity. Currently I have two possible workarounds, both of which are ugly:
step the world multiple times per update
scale down the sprites and collision fixtures, and zoom in the camera.
You could if you build it from source,
but I don’t suggest it because of floating precision errors when you multiply something very large (bodies expressed directly in pixels) with something very small (time).
At the end, you still need to multiply the scale factor in forces/velocities.
For example, gravity has to be 128 times larger if your dpi is 128.
Splitting the steps indroduces more precision errors, because the time is smaller.
The right way is to express the simulation in KMS, which is what the library was tuned for, and scale it up for drawing.