Collision Resolution -Game Physics Engine Development总结

The velocity of a point

The velocity of a point on an object depends on both its linear and angular velocity:

q˙=θ˙×(qp)+p˙[1.0]

where q˙ is the velocity of the point, p is the position of the point in world coordinates,p is the position of the origin of the object, and θ is the angular velocity of the object.

Impulse

An instantaneous change in velocity.In the same way that we have

f=mp¨[1.1]

for forces,we have

g=mp˙[1.2]

一般时使用p而不是使用g,但是为了防止和位置(p)冲突所以使用了g。这个impulse和force是等价的。一些作用力不只是通过加速度来体现出来,有些是通过速度而不是加速度体现的。其实 p˙

Impulsive Torque

.

The linear component is given by

p¨=1mf[1.3]

and the angular component by the torque

τ=Pf×f[1.4]

where the torque generates angular acceleration by

θ¨=I1τ[1.5]

In the case of the collision it stands to reason that the collision will generate a
linear change in velocity (the impulse) and an angular change in velocity. An instantaneous
angular change in velocity is called an “impulsive torque”.

u=Iθ˙[1.6]

where the u is the impulsive torque. I is the inertia tensor, and θ is the angular velocity.该公式对应了上面的[1.2] (个人感觉此处应该是angular velocity的改变值)

Impulses behave just like forces. In particular for a given impulse there will be both a linear component and an angular component.The impulsive torque generated by an impulse (impluse也会产生impulsive torque) is given by

u=Pf×g[1.7]

for collisions the point of application Pfis given by the contact point and the origin of the object:

Pf=qp[1.8]

where qis the position of the contact in world coordinates and p is the position of
the origin of the object in world coordinates.

VELOCITY CHANGE BY IMPULSE

Impulses cause a change in velocity both angular and linear.

The Linear Component

The linear change in velocity for a unit impulse will be in the direction of the impulse, with a magnitude given by the inverse mass:

ΔP˙d=m1[1.9]

For collisions involving two objects, the linear component is simply the sum of the two inverse masses:

ΔP˙d=ma1+mb1[1.10]

The Angular Component

First, equation 1.7 tells us the amount of impulsive torque generated from a unit
of impulse:

u=qrel×d^[1.11]

where d is the direction of the impulse (in our case the contact normal).
Second, equation 1.6 tells us the change in angular velocity for a unit of impulsive
torque:

Δθ˙=I1u[1.12]

And finally, equation 1.0 tells us the total velocity of a point. If we remove the
linear component, we get the equation for the linear velocity of a point due only to
its rotation:

q˙=θ˙×qrel[1.13]

So we now have a set of equations that can get us from a unit of impulse, via the
impulsive torque it generates and the angular velocity that the torque causes, through
to the linear velocity that results.

Vector3 torquePerUnitImpulse = relativeContactPosition % contactNormal; (参考:1.11)
Vector3 rotationPerUnitImpulse = inverseInertiaTensor.transform(torquePerUnitImpulse); (参考:1.12)
Vector3 velocityPerUnitImpulse = rotationPerUnitImpulse % relativeContactPosition; (参考:1.13)

posted on   Ultraman_X  阅读(11)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗
点击右上角即可分享
微信分享提示