New answers tagged

0

Disclaimer: This solution assumes knowledge of linear algebra. Additionally, I'm new to these problems myself and my solution might be erroneous or incomplete. Any comments or edits are more than welcome. Any transformation of objects in 2(3)D space is done via what is called an affine transformation matrix. This matrix is usually a 3x3 (or 4x4 in 3D) matrix ...


0

Assuming that you won't have thousands of cards dragging each other simultaneously, I'd go with calculating overlap area. This seems to be good starting point: https://stackoverflow.com/questions/44797713/calculate-the-area-of-intersection-of-two-rotated-rectangles-in-python especially this answer https://stackoverflow.com/a/45268241/14953457


0

Resolved by setting the "Freeze Rotation" on the Z axis in the RigidBody2D component


1

Try setting velocity of the object with set_linear_velocity(vel) on rigidbody, in that case object mass doesn't matter (unless you have strangely configured engine settings).


1

a std::condition_variable will let you wait_for the event_queue.has_event() when pushing an event you can notify_one to wake up the waiting thread. However the downside of this is that you are depending on the scheduler to actually wake up the thread. However scheduler resolution can be larger than you'd expect. it's better if only 1 thread is doing the ...


1

Check out Erin Catto’s (one of the creators of Box2D) GDC slides, he has by far one of the most succinct explanations of collision resolutions i’ve ever read. He also provides an accompanying demo of code which actually implements incredibly straight forward collision resolution in just a few hundred lines of code. He uses what is known as a sequential ...


0

I think the stuttering comes from your set resolution. The default aspect after your checkout was 3840x2160 which is about 4 times the size my screen can handle and even more so in the small preview window. I can see under Stats - Screen that it tried to render the 4k resolution into my 1483x616 game view. For every ~2.5 that it tried to render, it had only ...


0

I've added VSync back in and removed the targetFrameRate code. The stuttering is still visible in the editor, but on the target devices it's a lot better now.


0

As I mentioned in a comment, you can use a BoxCast to scan possible positions for a box along a line, and stop it at the moment it touches another object. Something like this: Vector3 GetStackedPosition(Vector3 lowest, float maxHeight, Vector3 halfExtents, Quaternion orientation) { Vector3 start = lowest; start.y += maxHeight; if (!Physics....


0

There is no one-size fits all answer to help you here, it really depends on how you want your game to feel and what abilities you want your player to have. Starting with a capsule is a great start, from here Ray cast a vector downwards from the capsules feet to test how far the capsule is from an AABB. then if that distance is less than how far the entity ...


Top 50 recent answers are included