首页 > 其他分享 >Collision Resolution -Game Physics Engine Development总结

Collision Resolution -Game Physics Engine Development总结

时间:2024-02-01 09:23:57浏览次数:29  
标签:Engine Development linear qquad torque velocity Resolution angular dot

The velocity of a point

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

\[\dot{q} = \dot{\theta} \times (q - p) + \dot{p} \qquad \qquad [1.0] \]

where \(\dot{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 \(\theta\) is the angular velocity of the object.

Impulse

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

\[f = m\ddot{p} \qquad \qquad [1.1] \]

for forces,we have

\[g = m\dot{p} \qquad \qquad [1.2] \]

一般时使用p而不是使用g,但是为了防止和位置(p)冲突所以使用了g。这个impulse和force是等价的。一些作用力不只是通过加速度来体现出来,有些是通过速度而不是加速度体现的。其实 \(\dot{p}应该是速度的改变吧,此处有疑问\)

Impulsive Torque

.

The linear component is given by

\[\ddot{p} = \frac{1}{m}f \qquad \qquad [1.3] \]

and the angular component by the torque

\[\tau = P_{f} \times f \qquad \qquad [1.4] \]

where the torque generates angular acceleration by

\[\ddot{\theta} = I^{-1}\tau \qquad \qquad [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\dot{\theta} \qquad \qquad [1.6] \]

where the \(u\) is the impulsive torque. \(I\) is the inertia tensor, and \(\theta\) 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 = P_{f}\times g \qquad \qquad [1.7] \]

for collisions the point of application \(P_{f}\)is given by the contact point and the origin of the object:

\[P_{f} = q - p \qquad \qquad [1.8] \]

where \(q\)is 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:

\[\Delta\dot{P}_{d} = m^{-1} \qquad \qquad [1.9] \]

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

\[\Delta\dot{P}_{d} = m_{a}^{-1} + m_{b}^{-1} \qquad \qquad [1.10] \]

The Angular Component

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

\[u = q_{rel} \times \hat{d} \qquad \qquad [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:

\[\Delta \dot{\theta} = I^{-1}u \qquad \qquad [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:

\[\dot{q} = \dot{\theta}\times q_{rel} \qquad \qquad [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)

标签:Engine,Development,linear,qquad,torque,velocity,Resolution,angular,dot
From: https://www.cnblogs.com/ultramanX/p/18000508

相关文章

  • TDengine 签约海博思创,助力储能运维平台数据管理
    随着储能产业步入快速发展期,各类储能电站快速建设投产,规模各异,场景不同。为了实现储能电站的高效监控和运维管理,储能运维管理平台成为不可或缺的工具。通过高效的集中控制手段,这些平台能够有效解决储能电站运维成本高、效率低的问题,进一步提升运维管理的效率和智能化水平。为了实......
  • SciTech-HybridSoftwareEngineering-Software Engineering2ndEditionISBN13:978126072
    Part1:IntroductionandSystemEngineeringChapter1:IntroductionChapter2:SoftwareProcessandMethodologyChapter3:SystemEngineeringPart2:AnalysisandArchitecturalDesignChapter4:SoftwareRequirementsElicitationChapter5:DomainModel......
  • arcengine GP调用PolygonToLine 报错 -2147467259
    这个原因是传参数问题;GP调用面转线工具时,不能利用该方式传入参数IGpValueTableObjectgpValueTableObject=newGpValueTableObject();//对一个及以上要素类进行相交运算gpValueTableObject.SetColumns(2);objecto1=pFeatureClass2;//输入IFeatureC......
  • Google-SoftwareEngineering: Abseil CPP Library + Tensorflow Cpp codebase
    Abseil:https://abseil.io/about/design/swisstablesIntroductiontoAbseilWelcometoAbseil!Abseilisanopen-sourcecollectionofC++code(complianttoC++14)designedtoaugmenttheC++standardlibrary.ThisdocumentintroducesAbseilandprovidesa......
  • TDengine清理数据文件
    清理会丢失用户以及库信息,需提前准备好备份停止taosd、taosAdaptersystemctlstoptaosadaptersystemctlstatustaosadaptersystemctlstoptaosdsystemctlstatustaosd删除数据文件rm-rf/var/lib/taos/*启动taosd、taosAdaptersystemctlstarttaosdsy......
  • Development and Construction of Dapp Pledge Mining System
    Pledgeminingsystemisanemergingapplicationofblockchaintechnology,whichpledgesdigitalassetsontheblockchaintoobtaincorrespondingproofofequity,inordertoachieveproofofequityminingontheblockchain.Thedevelopmentofpledgeminin......
  • Prompt Engineering 可能会是 2024 年最热门的“编程语言”?
    编者按:“PromptEngineering”是否已经过时?模型本身的能力是否已经足够,不再需要特意设计prompt?我们今天为大家带来的文章,作者认为PromptEngineering不会过时,相反随着模型能力的增强,编写高质量prompt的重要性也将继续增加。文章详细论点归纳:(1)大语言模型应被视为操作系统的内......
  • Google earth engine(GEE)示例:地形分析
    //导入研究区域varstudyArea:Tableprojects/assets/study_area//导入SRTM地形数据varsrtm=ee.Image('USGS/SRTMGL1_003');//提取研究区域的高程varelevation=srtm.clip(studyArea);//计算坡度varslope=ee.Terrain.slope(elevation);//计算坡向va......
  • 关于ArcEngine在多线程模式下的注意点
    仅以我的环境来描述的我问题和解决方案,超出该范围的暂时没有考虑。一、环境ArcEngine10.2语言:C#.net版本:4.6.1二、需求创建GDB数据库,并从json文件把数据写入GDB中,包含了图形数据,为了兼顾效率,我使用了多线程来生成GDB,但也做了控制,一个线程只会对一个GDB进行操作。三、问题:......
  • TDD(Test-Driven Development)测试驱动开发
    TDD(Test-DrivenDevelopment)是一种软件开发方法,其中开发人员在编写实际代码之前编写测试用例。TDD的基本思想是在开发过程中先编写测试,然后编写足够的代码来通过这些测试。TDD的一般流程通常包括以下阶段:编写测试用例(Test):开发人员首先编写一个测试用例,该用例描述了新功能或修......