TorusGeometry
Description
This component establishes geometry on an entity.
Properties
Property | Type | Default | Description |
---|---|---|---|
radius | number | 1 | Radius of the torus. |
tubeRadius | number | 1 | Radius of the tube. |
Functions
Get
Returns a read-only reference.
Example
ecs.TorusGeometry.get(world, component.eid)
Set
Ensures the component exists on the entity, then assigns the (optional) data to the component.
Example
ecs.TorusGeometry.set(world, component.eid, {
radius: 1
})
Mutate
Perform an update to the component within a callback function. Return true
to indicate no changes made.
Example
ecs.TorusGeometry.mutate(world, component.eid, (cursor) => {
cursor.radius += 1;
return false;
})