2Dphysics chain shape
2D物理链形碰撞形状
Constructor method
构造方法
Vertex data x,y,x,y ...
顶点数据 x,y,x,y ...
The density value. The value can be zero or a positive number. It is recommended to use similar densities to improve stacking stability. The default value is 10.
密度值。值可以为零或者是正数,建议使用相似的密度以改善堆叠稳定性。默认值为 10。
碰撞分组数据,用来设置当前形状碰撞时候的分组数据
Collision grouping data, used to set the grouping data when the current shape collides
The friction coefficient. The value ranges from 0 to 1, the larger the value, the greater the friction. The default value is 0.2.
摩擦力。取值范围0-1,值越大,摩擦越大。默认值为0.2。
Whether the object is a sensor. A sensor can trigger collision events but does not produce collision responses.
是否是传感器,传感器能够触发碰撞事件,但不会产生碰撞反应
Whether it is a closed loop. Ensure there are no self-intersecting link shapes, as they may not function properly.
是否是闭环,注意不要有自相交的链接形状,否则它可能不能正常工作
The restitution coefficient. The value ranges from 0 to 1, the larger the value, the greater the elasticity. The default value is 0.
弹性系数。取值范围0-1,值越大,弹性越大。默认值为0。
Restitution velocity threshold, usually in meters per second. Collisions above this velocity will have restitution applied (will bounce).
恢复速度阈值,通常以米/秒为单位。高于此速度的碰撞将应用恢复(将反弹)。
The x-axis offset relative to the node.
相对于节点的 x 轴偏移。
The y-axis offset relative to the node.
相对于节点的 y 轴偏移。
Destroy shape
销毁形状
box2D's AABB bounding box
Get the axis-aligned bounding box corresponding to the shape
获取形状对应的轴对齐包围盒
index通常用于ChainShape与PolygonShape等多形状的对象,CircleShape、EdgeShape等默认为0
是否相交
检测射线是否与形状相交
Check if a ray intersects a shape
En
2Dphysics chain shape
Zh
2D物理链形碰撞形状