Collision shape that a physics body may be composed of.
A shape may also carry its own optional collision settings, which refine the
body's rather than replacing them — collisionType, collisionMask,
isTrigger and isActive. See Body#addShape for the semantics.
Adapter support: the builtin and planck adapters honour them (planck maps
them onto per-fixture filters, which Box2D provides natively). The matter
adapter does NOT — its collisionFilter and isSensor belong to a body, not
to the parts it is built from, so per-shape values are ignored there.
The two 3D shapes are builtin-only.Box3d and Sphere exist because
the builtin solver resolves along Z; the matter and planck adapters are 2D
engines with no depth to resolve and THROW when handed either one. They are
in this union because a body definition is otherwise portable and these are
body shapes, not because every adapter accepts them: a game that wants to
stay adapter-portable builds its bodies from the planar three.
Collision shape that a physics body may be composed of.
A shape may also carry its own optional collision settings, which refine the body's rather than replacing them —
collisionType,collisionMask,isTriggerandisActive. See Body#addShape for the semantics.Adapter support: the builtin and planck adapters honour them (planck maps them onto per-fixture filters, which Box2D provides natively). The matter adapter does NOT — its
collisionFilterandisSensorbelong to a body, not to the parts it is built from, so per-shape values are ignored there.The two 3D shapes are builtin-only.
Box3dandSphereexist because the builtin solver resolves along Z; the matter and planck adapters are 2D engines with no depth to resolve and THROW when handed either one. They are in this union because a body definition is otherwise portable and these are body shapes, not because every adapter accepts them: a game that wants to stay adapter-portable builds its bodies from the planar three.