サークル幾何学
説明
このコンポーネントは、エンティティのジオメトリを確立する。
プロパティ
プロパティ | タイプ | デフォルト | 説明 |
---|---|---|---|
radius | number | 0 | Radius of the circle |
Get
Returns a read-only reference.
Example
ecs.CircleGeometry.get(world, component.eid)
Set
Ensures the component exists on the entity, then assigns the (optional) data to the component.
Example
ecs.CircleGeometry.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.CircleGeometry.mutate(world, component.eid, (cursor) => {
cursor.radius += 1;
return false;
})
Remove
Removes the component from the entity.
Example
ecs.CircleGeometry.remove(world, component.eid)
Has
Returns true
if the component is present on the entity.
Example
ecs.CircleGeometry.has(world, component.eid)