Class
SoftBody2D
View sourceMarks an entity with the 2D soft-body component type.
SoftBody2D is an empty marker component with no instance fields.
Use its presence to identify an entity as a 2D soft body; the marker carries
no additional state of its own.
Examples
import { World } from '@wimaengine/ecs'
import { SoftBody2D } from '@wimaengine/narrowphase'
const world = new World()
const entity = world.spawn([new SoftBody2D()])
const marker = world.get(entity, SoftBody2D)
console.log(marker instanceof SoftBody2D) // trueConstructor
Methods
staticdefault(): SoftBody2D
View sourcestaticcopy(source: SoftBody2D, target?: SoftBody2D): SoftBody2D
View sourceCopies an empty marker into a target component.
SoftBody2D has no instance fields, so source is not read. When
target is omitted, a new marker is created; otherwise the exact target
is returned unchanged.
staticclone(target: SoftBody2D): SoftBody2D
View sourceCreates a new empty marker because there is no state to clone.
This delegates to SoftBody2D.copy without a target, so the
supplied marker is not read and the result is always a new instance.
staticserialize(_value: SoftBody2D): object
View sourceSerializes the marker as an empty object.
There is no instance state to persist, so _value is not read.
staticdeserialize(_value: unknown, out?: SoftBody2D): SoftBody2D
View sourceDeserializes an empty marker without reading serialized data.
The input is not validated or read. This returns out when supplied, or
creates and returns a new marker.
