- #1
Xcrypt
- 21
- 0
http://imageshack.us/photo/my-images/195/spinner.png/
^this is the object/spinner I am referring to.
I am trying to code a physics based minigolf game in which a ball should be able to collide properly with the spinner object and the arms of it.
However I am lacking in physical knowledge to do so.
This is the model I currently have:
1) When the ball hits the spinner, a point gets defined where the ball hits the spinner. Of this point on the spinner, there is a tangential velocity bound to it which I have put in a vector.
2) Then, I projected the ballVelocityVector onto that tangentialVelocity Vector, and get a new vector: ballProjectedVelocityVector
3) After that, momentum gets defined:
ballProjectedMomentumVector = ballProjectedVelocityVector * ballMass
spinnerPointMomentumVector = pointTangentialVelocityVector * spinnerMass [probably where it goes wrong?]
4) Then new velocities get defined for the ballProjectedVelocityVector and the spinnerPointTangentialVelocityVector
Using:
va = [Cr*ma*(ub-ua)+ma*ua+mb*ub]/(ma+mb)
where:
va is the final velocity of the first object after impact
vb is the final velocity of the second object after impact
ua is the initial velocity of the first object before impact
ub is the initial velocity of the second object before impact
ma is the mass of the first object
mb is the mass of the second object
Cr is the coefficient of restitution (which I have set for a near-perfect non-elastic collision (0.05) )
5) The spinner gets a new angular velocity: (the new spinnerPointTangentialVelocityVectorLength / distance from that point to the axis of the spinner)
The ball gets a new velocityVector: (the new ballProjectedVelocityVector + (the old ballVelocityVector[projected onto the vector perpendicular to the projected velocity]) )
----------
However, this model I am using is not quite accurate, since if 'the point where the ball hits the spinner' is closer to the axis, the MORE angular rotation the spinner will get with this model.
Does anyone know what I am doing wrong / what steps I should take to determine the proper new angular velocity of the spinner after collision and the new velocity of the ball after collision?
----------
In explaining, please make try to do so so I can understand, because although I am very interested in physics and learning, my current knowledge is still very low.
----------
Thanks a lot for the help! :)
^this is the object/spinner I am referring to.
I am trying to code a physics based minigolf game in which a ball should be able to collide properly with the spinner object and the arms of it.
However I am lacking in physical knowledge to do so.
This is the model I currently have:
1) When the ball hits the spinner, a point gets defined where the ball hits the spinner. Of this point on the spinner, there is a tangential velocity bound to it which I have put in a vector.
2) Then, I projected the ballVelocityVector onto that tangentialVelocity Vector, and get a new vector: ballProjectedVelocityVector
3) After that, momentum gets defined:
ballProjectedMomentumVector = ballProjectedVelocityVector * ballMass
spinnerPointMomentumVector = pointTangentialVelocityVector * spinnerMass [probably where it goes wrong?]
4) Then new velocities get defined for the ballProjectedVelocityVector and the spinnerPointTangentialVelocityVector
Using:
va = [Cr*ma*(ub-ua)+ma*ua+mb*ub]/(ma+mb)
where:
va is the final velocity of the first object after impact
vb is the final velocity of the second object after impact
ua is the initial velocity of the first object before impact
ub is the initial velocity of the second object before impact
ma is the mass of the first object
mb is the mass of the second object
Cr is the coefficient of restitution (which I have set for a near-perfect non-elastic collision (0.05) )
5) The spinner gets a new angular velocity: (the new spinnerPointTangentialVelocityVectorLength / distance from that point to the axis of the spinner)
The ball gets a new velocityVector: (the new ballProjectedVelocityVector + (the old ballVelocityVector[projected onto the vector perpendicular to the projected velocity]) )
----------
However, this model I am using is not quite accurate, since if 'the point where the ball hits the spinner' is closer to the axis, the MORE angular rotation the spinner will get with this model.
Does anyone know what I am doing wrong / what steps I should take to determine the proper new angular velocity of the spinner after collision and the new velocity of the ball after collision?
----------
In explaining, please make try to do so so I can understand, because although I am very interested in physics and learning, my current knowledge is still very low.
----------
Thanks a lot for the help! :)
Last edited: