How can I calculate post-collision rotation in my physics engine?

AI Thread Summary
The discussion centers on calculating post-collision rotation in a Java physics engine after implementing wall collisions with elasticity and friction. The user shares their wall collision method, which involves projecting velocity onto the collision normal and wall vectors, adjusting for elasticity and friction. They suggest that an impulse function could be beneficial, allowing for the specification of velocity at a certain point on the object to determine the resulting rotation. The conversation highlights the need for a more precise approach to handle rotational dynamics post-collision. Overall, the focus is on improving collision response to include accurate rotational calculations.
MTK
Messages
13
Reaction score
0
I implemented collisions with walls in my Java physics engine, complete with elasticity and friction, but I am not sure how to calculate the post-collision rotation. Maybe you can help?

Here is the wall collision method (if you can understand it) :

Code:
public void processWallCollision(Vector normal) {
        Vector wall = normal.rotate(Math.PI/2);
        Vector normalProjection = velocity.projectOnto(normal);
        Vector wallProjection = velocity.projectOnto(wall);
        normalProjection = normalProjection.reverse();
        normalProjection = normalProjection.scale(elasticity);
        wallProjection = wallProjection.scale(1-friction);
        velocity = normalProjection.add(wallProjection);
}
 
Physics news on Phys.org
I am thinking that it might actually be best to have am impulse function (similar to the apply force function), that would set the velocity of a certrain point (instead of increasing or decreasing it) in the object to a specified value, and calculating the velocity ant rotation from that.
 
Thread 'Is 'Velocity of Transport' a Recognized Term in English Mechanics Literature?'
Here are two fragments from Banach's monograph in Mechanics I have never seen the term <<velocity of transport>> in English texts. Actually I have never seen this term being named somehow in English. This term has a name in Russian books. I looked through the original Banach's text in Polish and there is a Polish name for this term. It is a little bit surprising that the Polish name differs from the Russian one and also differs from this English translation. My question is: Is there...
Hi there, im studying nanoscience at the university in Basel. Today I looked at the topic of intertial and non-inertial reference frames and the existence of fictitious forces. I understand that you call forces real in physics if they appear in interplay. Meaning that a force is real when there is the "actio" partner to the "reactio" partner. If this condition is not satisfied the force is not real. I also understand that if you specifically look at non-inertial reference frames you can...
Back
Top