One more collision problem!`

So, I hope this is the last collision problem I’m going to deal with for a long time!

Everything is going quite well, my objects are bouncing off each other nicely, nothing sticking, nothing untoward happening. So of course I thought I’d try to break things again!

My objects (meteors or asteroids) are bouncing around in a large circle, they bounce off the edges and each other imparting energy as they go. It’s all completely elastic so there is no loss of energy over time and with that in mind it all looks really realistic. Except, I’m not imparting any spin. As the objects are irregular (but roughly circular) it looks slightly off when a glancing blow doesn’t change the spin (rotation) of either object.

I’ve tried searching for snooker/pool physics, but that’s all a bit over the top, I just want to transfer spinning energy to both objects with a constant coefficient.

Does anyone have a simple snippet, or know where I can look for an example?

Many thanks.

You can do this by applying a rotation based on the collision

For example if you have a collision on the right side of the screen you would could take the y velocity.

Something like.
RotationSpeed = y * scale;
DrawRortation += RotationSpeed;

Make scale a const and keep changing it till it looks right.

You will need to use x velocity for collision top and bottom

Yes, that would work for a bounce on a static surface, I have objects flying all in all directions bouncing off each other. I get that I’ll have to work out a mean force or spin rate and add to one, deduct from another, but it’s how to work out the glancing force and rotational directions.

I’d do it something like this:
On each object, work out the surface velocity. I presume you know the object’s angular velocity and axis, as well as the radius/vector from the centre to the point of the collision, right? The simplest way to work out the surface velocity, then, would be - thinks whilst making right-hand-rule gestures - the angular velocity as a vector (pointed along the axis of rotation) crossed with the radius vector. Do that for both objects colliding, and now you know the speeds at which they’re brushing past one another. You can make that into a relative amount, too (the difference between the two velocity vectors).
From there, you have a few options. Are the objects identical? If so, you just want to adjust their spins counter to the velocities you just calculated in an equal amount depending on the amount of friction you want to simulate.
If they’re not identical, physically speaking, you can impart a mutual impulse at that point of impact in the opposite directions of the surface velocities. Or, if you just want to find the change in spins, change in angular velocity = radius vector crossed with impulse, divided by moment of inertia. Let me know if you need further details on those calculations.