Collision of an expanding disc with another disc.

Click For Summary

Discussion Overview

The discussion revolves around the challenges of simulating collisions between expanding and shrinking discs in a 2D collision engine. Participants explore the implications of elastic collisions, conservation of momentum, and the effects of radius growth on collision dynamics.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • Xavier describes a collision engine for circles and raises concerns about handling collisions for expanding or shrinking discs, noting that traditional methods may not apply.
  • One participant questions the conservation of momentum in the context of a moving, expanding disk, asking whether the disk's density changes to keep mass constant and how expansion affects collision assumptions.
  • Another participant suggests modifying the velocity vector of the disc center to include the radial velocity due to expansion or shrinking, proposing that this could help in calculating the collision point's velocity.
  • Xavier clarifies that the mass of the disk remains constant during expansion and discusses the need to account for radius growth in collision calculations, particularly in determining the center of mass speed.
  • Xavier provides a code snippet detailing the current collision handling method and expresses uncertainty about how to incorporate radius growth into the center of mass speed calculation.
  • In a hypothetical example, Xavier illustrates how the expected outcomes of a collision should reflect the effects of radius growth on the discs' movements post-collision.

Areas of Agreement / Disagreement

Participants express differing views on how to properly account for the dynamics of expanding discs in collision scenarios. There is no consensus on the best approach to incorporate radius growth into the collision calculations.

Contextual Notes

Unresolved aspects include the assumptions about mass conservation during expansion, the implications of elastic collisions on expanding discs, and the mathematical steps required to accurately model the interactions.

Tipx
Messages
6
Reaction score
0
Hi,
Like a lot of people programming, I created a simplistic 2D collision engine. This engine handles the collisions of circles (I know I typed "disc" in the title, but I wanted to avoid replies like "circles don't really exist so they can't collide".)

The simulation is friction-less, so since the circles do not rotate initially, they never end up rotating. The collisions are also totally elastic and since there is no deformation, the collisions happen instantly. The detection model is an a-priori model. I want my engine to handles circles that expand or shrink.

It works fine with regular ("regular", opposed to "expanding" or "shrinking") circles, but when it comes to non-regular circles, I'm having an issue :
I can detect when the collision will occur, but I have no clues how to calculate the movement of the circles after the collision. I can't base the impact forces on the velocity of the circles since it's possible for 2 non-moving circles to collide if one (or both) of them expands.

I thought about taking into account the "radius growth speed" into the velocity, but that's just a wild guess. Anyone can steer me in the right direction?

Thanks,
Xavier
 
Physics news on Phys.org
Your collision model is fundamentally based on the conservation of momentum... but from your post it is not clear how a moving, expanding disk has a conserved momentum. Does its density fall to keep its mass constant? At the point of collision, do you assume the disk is not expanding? (otherwise it would expand into the other disk!)
 
Tipx said:
I thought about taking into account the "radius growth speed" into the velocity, but that's just a wild guess. Anyone can steer me in the right direction?
Sounds reasonable. You modify the velocity vector of the disc center with the radial velocity of the circumference due to explansion/shinking. The sum of both vectors gives you the velocity of the collision point at the discs circumference, used for the collision calculations.
 
Oh, forgot to specify, sorry. The mass of the disk is deemed in the middle of the disk and remains constant through the expansion.

As for preventing the disk from further expanding when it collides : I though that since the collision is totally elastic, after any given collision, the 2 colliding disks will move away from each other at at-least the "Radius Growth speed". This is if I manage to take the radius growth speed into account. The following code is how I handle the collision for now. I'll mention the changes I plan to make after :

float collAMass = collidableA.Mass;
Vector2 collASpeed = collidableA.Speed;
float collAGrowth = collidableA.RadiusGrowth;

float collBMass = collidableB.Mass;
Vector2 collBSpeed = collidableB.Speed;
float collBGrowth = collidableB.RadiusGrowth;

// Center of Mass Speed
Vector2 cmSpeed = (collAMass * collASpeed + collBMass * collBSpeed) / (collAMass + collBMass);

Vector2 collAInitialRelativeSpeed = collASpeed - cmSpeed;
Vector2 collBInitialRelativeSpeed = collBSpeed - cmSpeed;

Vector2 collAParallelSpeed = Vector2Tools.Projection(collAInitialRelativeSpeed, impulseNormal);
Vector2 collBParallelSpeed = Vector2Tools.Projection(collBInitialRelativeSpeed, impulseNormal);

Vector2 collAPerpendicularSpeed = collAInitialRelativeSpeed - collAParallelSpeed;
Vector2 collBPerpendicularSpeed = collBInitialRelativeSpeed - collBParallelSpeed;

Vector2 collAFinalRelativeSpeed = -collAParallelSpeed + collAPerpendicularSpeed;
Vector2 collBFinalRelativeSpeed = -collBParallelSpeed + collBPerpendicularSpeed;

Vector2 collAFinalSpeed = collAFinalRelativeSpeed + cmSpeed;
Vector2 collBFinalSpeed = collBFinalRelativeSpeed + cmSpeed;



So I know I need to take into account the RadiusGrowth, but where I'm unsure, is how to incorporate it in the "Center of Mass Speed". I think I'll have to add the growth of one disk and subtract the growth of the other one when calculating cmSpeed. I know it sounds silly because the actual center of mass doesn't change, but that's the only way I see to transfer the "Expansion" from one disk into another disk (as a motion). For example if we lose one dimension for the time being :

Disk A (CollidableA) :
* Position : 0
* Speed : 0
* Mass : 10
* Radius : 1
* Radius Growth : 1/sec

Disk B (CollidableB) :
* Position : 3
* Speed : 0
* Mass : 5
* Radius : 1
* Radius Growth : 0

There should be a collision after 1sec. I expect Disk A to end up with a negative speed (relative to the referential) that is about half of how fast Disk B should be going the other way. If I don't change cmSpeed, Disk A would end up moving after the collision, and not Disk B.

(Just explaining this helps me see my problem clearer, as always!)
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 46 ·
2
Replies
46
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
2
Views
3K