One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

DynamicLightShadowComponent

struct · iOS 18.0+ · SDK 27.1

struct DynamicLightShadowComponent

A component that controls an entity's shadow from dynamic (virtual) lights. Use `DynamicLightShadowComponent` to control whether an entity casts shadows from dynamic (virtual) lights. Dynamic lights cast shadows on other virtual objects, but not on physical objects. You can add a dynamic light shadow component to any entity that has a ``ModelComponent`` in its component set by adding a dynamic light shadow component to the entity's ``Entity/components`` property. ```swift if let model = try? await ModelEntity(named: "tv_retro") { let shadowComponent = DynamicLightShadowComponent(castsShadow: false) model.components.set(shadowComponent) } ``` You need to add the dynamic lights shadow component to each entity you want to apply the effect to because the dynamic light shadow component doesn't apply to hierarchies. - Note: By default, without a dynamic light shadow component, entities cast shadows from dynamic lights.

Members (3)

init · iOS 18.0+

init

TypeScript
static init(castsShadow: boolean): DynamicLightShadowComponent
Swift declaration
init(castsShadow: Bool)

Creates a dynamic light shadow component. - Parameter castsShadow: A Boolean value that indicates whether an entity with the component casts a shadow. By default, the component makes an entity to stop casting shadows from dynamic lights.

get · iOS 18.0+

castsShadow

TypeScript
get castsShadow(): boolean
Swift declaration
var castsShadow: Bool

A Boolean value that indicates whether an entity casts a shadow.

set · iOS 18.0+

castsShadow

TypeScript
set castsShadow(value: boolean)
Swift declaration
var castsShadow: Bool

A Boolean value that indicates whether an entity casts a shadow.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →