A representation of a physical object that RealityKit renders and optionally
simulates.
Use one or more model entities to place physical objects in a scene. In
addition to the components they inherit from the ``Entity`` class, model
entities have geometry, described by their ``ModelComponent``. Model
entities acquire the model component by conforming to the ``HasModel``
protocol. You specify meshes and materials to control how a model entity
appears.

Models respond to physics simulations because they conform to the
``HasPhysics`` protocol. You give them mass and other physical properties
with a ``PhysicsBodyComponent`` instance, and then apply forces or impulses.
The simulator uses a ``PhysicsMotionComponent`` to manage the linear and
angular velocity of the object. Alternatively, you can selectively
circumvent the simulation to control position and velocity yourself. Do this
for a given model by setting its physics body ``PhysicsBodyComponent/mode``
to ``PhysicsBodyMode/kinematic``.
Models can also collide with one another, and with other entities that
conform to the ``HasCollision`` protocol. The ``CollisionComponent``
provides parameters that let you manage which models collide with each
other. It also lets you control the collision shape, which for performance
reasons, is typically simpler than the visual geometry.
Creates a model entity with a particular mesh, set of materials,
collision shape, and mass.
- Parameters:
- mesh: A mesh that defines the geometry of the model.
- materials: Material resources that define the appearance of the model.
- collisionShape: A collection of shape resources that define a composite collision shape.
- mass: The mass of the model in kilograms.
Creates a model entity with a particular mesh, set of materials, a
composite collision shape, and mass.
- Parameters:
- mesh: A mesh that defines the geometry of the model.
- materials: Material resources that define the appearance of the model.
- collisionShapes: A collection of shape resources that define a composite collision shape.
- mass: The mass of the model in kilograms.
Creates a model entity with a particular mesh and set of materials.
- Parameters:
- mesh: A mesh that defines the geometry of the model.
- materials: Material resources that define the appearance of the model.