Search found 11 matches

by TomatoSoup
Sat Mar 05, 2016 10:49 pm
Forum: Support and Development
Topic: Messenger / Observer
Replies: 8
Views: 2676

Re: Messenger / Observer

You're right, it's implementation specific. What I more meant to establish was that you wouldn't overwrite existing things, though. And that, with the Love2d Win64 implementation, it tends to work out. I wrote a script that'd randomly insert and remove and, by my best estimate, it works as I describ...
by TomatoSoup
Sat Mar 05, 2016 7:55 pm
Forum: Support and Development
Topic: Messenger / Observer
Replies: 8
Views: 2676

Re: Messenger / Observer

The array would remain nicely compact even without doing that. In t = {1,2,nil,4,5,nil}, t[#t+1] would insert to the third slot, and then again would insert into the sixth slot. It'd also guarantee that you never accidentally start putting values into the hashmap part of the table. Perhaps an altern...
by TomatoSoup
Sat Mar 05, 2016 6:34 pm
Forum: Support and Development
Topic: Correctly misusing Box2d to get time of impact
Replies: 6
Views: 3301

Re: Correctly misusing Box2d to get time of impact

Also, I can tell you for a fact that you're wrong about velocity clamping. I just had an object move 2^32, and retain that velocity after update, by setting the timestep to 1/1000000000. So, as I read, velocity limits are purely a function of timestep.
by TomatoSoup
Sat Mar 05, 2016 6:08 pm
Forum: Support and Development
Topic: Messenger / Observer
Replies: 8
Views: 2676

Re: Messenger / Observer

Have you considered making subscriptions a weak list and having the creator of a subscription maintain a reference to it? Then, when you destroy the creator, the garbage collector will eventually swing by and remove it. A consequence would be that you'd have to change ipairs to regular pairs, but be...
by TomatoSoup
Sat Mar 05, 2016 4:41 pm
Forum: Support and Development
Topic: Correctly misusing Box2d to get time of impact
Replies: 6
Views: 3301

Re: Correctly misusing Box2d to get time of impact

My reading is that the velocity limit is 2 units per update, so at 60hz that's 120u/s. Do you know what the velocity is clamped to? And, I don't think you call world:update like I do. I call it a dynamic number of times depending on if objects are likely to collide or not. In all likelihood, most fr...
by TomatoSoup
Sat Mar 05, 2016 3:30 pm
Forum: Support and Development
Topic: Correctly misusing Box2d to get time of impact
Replies: 6
Views: 3301

Re: Correctly misusing Box2d to get time of impact

To make sure we read the same thing about the speedlimit, it's 2.0 distance units per world:update, right? I was not aware of this but I think I can see how to work around it. So an object moving 10m/s given a .1s timestep will move 1, but an object moving 30m/s given a 0.1s timestep will only move ...
by TomatoSoup
Sat Mar 05, 2016 2:33 am
Forum: Support and Development
Topic: Correctly misusing Box2d to get time of impact
Replies: 6
Views: 3301

Correctly misusing Box2d to get time of impact

Given two physics objects that collide, how can I determine at what point in the frame they actually collided? For instance, two polygon shapes are headed at each other such that, during the 1/60 second timestep, they collide. How can I use the callbacks and the various position/velocity getters bef...
by TomatoSoup
Fri Nov 20, 2015 1:36 am
Forum: Support and Development
Topic: Continuous Collision Detection
Replies: 4
Views: 3297

Re: Continuous Collision Detection

So I was going to rewrite my code so that the sphere-sphere worked the same way, but instead decompose sphere-poly and poly-poly collisions into a bunch of line-line collisions. The only thing I thought this method wouldn't handle was where two colliders were coincident (a smaller one inside the oth...
by TomatoSoup
Thu Nov 19, 2015 8:40 pm
Forum: Support and Development
Topic: Continuous Collision Detection
Replies: 4
Views: 3297

Continuous Collision Detection

I'm working on a space game with proper physics. This means that ships are moving 10s to 1000s of times their own length each second. To resolve collisions I need a Continuous Collision Detection algorithm. I've implemented the formula seen here, http://studiofreya.com/3d-math-and-physics/little-mor...
by TomatoSoup
Wed Mar 25, 2015 9:38 pm
Forum: Support and Development
Topic: Box2d offset shape from body
Replies: 2
Views: 2246

Re: Box2d offset shape from body

Ah, so I see that I have entirely misunderstood the tutorials! So, to clarify, only when using the shortcut to create Rectangles will it be centered upon the body. Otherwise it positions the points that I provide relative to the body. Well that answers a large number of my questions! However, while ...