configureEntity(_:hoverEffect:allowedInputTypes:collisionShapes:)
Apply a default configuration to an entity to enable to it for use with manipulation component.
Declaration
static func configureEntity(_ entity: Entity, hoverEffect: HoverEffectComponent.HoverEffect? = nil, allowedInputTypes: InputTargetComponent.InputType? = nil, collisionShapes: [ShapeResource]? = nil)Parameters
- entity:
The entity to configure.
- hoverEffect:
A replacement for the default
HoverEffectthis method applies. - allowedInputTypes:
A replacement for the allowed input types this method applies.
- collisionShapes:
A replacement for the deafult collision shape this method generates based on the entity’s bounding box.
Discussion
This function applies an InputTargetComponent, CollisionComponent, and HoverEffectComponent to an Entity.
Use this method on an entity that already has a mesh asset in a ModelComponent. The system generates a collision mesh based on the entity’s bounding box if you don’t set one. This function will replace any pre-existing components of these types.