Rigid Body Physics Rotations

前端 未结 3 1494
旧巷少年郎
旧巷少年郎 2021-01-26 16:10

I\'m wanting to create a physics engine within Java. However it\'s not the code I\'m bothered about. It\'s simply the math of rigid body physics, specifically forces and how the

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-26 16:38

    1. rotation is form of kinetic energy

      first the analogy to movement

      • alpha - angular position [rad]
      • omega - angular speed [rad/s]
      • epsilon - angular acceleration [rad/s^2]
      • alpha(t)/(dt^2)=omega(t)/dt=epsilon(t)

      now the inertia

      • I - quadratic rotation mass inertia [kg.m^2]
      • m - mass [kg]
      • M - torque [N.m]

      and some equations to be exploited

      1. M=epsilon*I - torque needed to achieve acceleration or vice versa [N.m]
      2. acc=epsilon*radius - perimeter acceleration [m/s^2]
      3. vel=omega*radius - perimeter speed [m/s^2]

      equation #1 can be used to directly compute the force. Equations #2,#3 can be used to calculate friction based forces like wheels grip/drag. Do not forget about the kinetic energy Ek=0.5*m*vel^2+0.5*I*omega^2 so you can exploit the law of preserving energy.

    2. During continuous contact of object1 with object2 in rotation happens this

      Perimeter speed/acceleration create interaction force, this is slowing down the rotation of object2 creating drag force on the object2 and reacting force on the object1.

      if object1 is not fixed then this force also create torque and rotates the object1

      If the rotation is forced to stop suddenly then all rotational part of kinetic energy is moved to the collision reaction Force impulse.

      If object is in more complicated rotation motion then you should compute the actual rotation axis and alpha,omega,epsilon and use that because object can rotate with more rotations each with different center of rotation.

      Also if object is rotating and another rotation is applied in different axis then this creates gyroscopic torque creating also rotation in the third axis perpendicular to both.

      So when yo put all these together you have a idea of what structures you need. Sorry can not be more specific than this without further info about the structures and properties of your simulation ...

提交回复
热议问题