Shadow
Description
This component controls how the entity handles shadows.
Properties
Property | Type | Default | Description |
---|---|---|---|
castShadow | boolean | false | Indicates if an entity can cast shadows. |
receiveShadow | boolean | false | Indicates if an entity can receive shadows. |
Functions
Get
Returns a read-only reference.
Example
ecs.Shadow.get(world, component.eid)
Set
Ensures the component exists on the entity, then assigns the (optional) data to the component.
Example
ecs.Shadow.set(world, component.eid, {
castShadow: false,
receiveShadow: false
})
Mutate
Perform an update to the component within a callback function. Return true
to indicate no changes made.
Example
ecs.Shadow.mutate(world, component.eid, (cursor) => {
cursor.castShadow = true;
cursor.receiveShadow = true;
return false;
})