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:
where is the velocity of the point, is the position of the point in world coordinates, 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
for forces,we have
一般时使用p而不是使用g,但是为了防止和位置(p)冲突所以使用了g。这个impulse和force是等价的。一些作用力不只是通过加速度来体现出来,有些是通过速度而不是加速度体现的。其实
Impulsive Torque
.
The linear component is given by
and the angular component by the torque
where the torque generates angular acceleration by
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”.
where the is the impulsive torque. 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
for collisions the point of application is given by the contact point and the origin of the object:
where is the position of the contact in world coordinates and 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:
For collisions involving two objects, the linear component is simply the sum of the two inverse masses:
The Angular Component
First, equation 1.7 tells us the amount of impulsive torque generated from a unit
of impulse:
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:
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:
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 2024-02-01 09:09 Ultraman_X 阅读(11) 评论(0) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗