2D刚体模拟(包含HIP文件)2D Rigid Body Simulation (HIP File Included)

2D刚体模拟(包含HIP文件)2D Rigid Body Simulation (HIP File Included)

Hi again!

This is a 2d rigid body simulation which I did in two approaches:

1_ By using a quaternion to manipulate transform matrix on primitive intrinsic attribute of packed objects. In this case deforming attribute should has value of 2 in order to have correct collision in Bullet solver.

2_ In second approach, hard constraints are used to limit the rotation axis only on Z axis.

This method is much faster than first approach.

Also a glue constraint is added on barriers to have similar simulation like Angry Birds.

The best.

HIP file is ready for download:

https://drive.google.com/file/d/1zeUePld4zCvGab4hW9XIVJXSC7GINlJk/view?usp=sharing
你好,我们又见面了!

这是一个二维刚体仿真,我用两种方法做了:

1_通过使用四元数来处理打包对象的原始内在属性上的变换矩阵。在这种情况下,变形属性的值应为2,以便在子弹解算器中进行正确的碰撞。

2_在第二种方法中,硬约束仅用于限制Z轴上的旋转轴。

这种方法比第一种方法快得多。

此外,在障碍物上添加胶水约束以进行类似“愤怒的小鸟”的模拟。