constructor(x?: number, y?: number, z?: number)
View sourceCreates a local 3D scale.
Class
ExtendsVector3
Stores an entity’s local scale in 3D space as an ECS component. Its
coordinates default to (1, 1, 1) when omitted, preserving the entity’s
original size on every axis.
Use it with World and Query when an entity needs a
mutable 3D scale. It extends Vector3.
import { Query, World } from '@wimaengine/ecs'
import { Scale3D } from '@wimaengine/transform'
const world = new World()
world.spawn([new Scale3D(2, 1, 0.5)])
const scales = new Query(world, [Scale3D])
scales.each(([scale]) => {
scale.set(scale.x * 0.5, scale.y * 0.5, scale.z * 0.5)
})default(): Scale3Dcopy(source: Scale3D, target?: Scale3D): Scale3Dclone(target: Scale3D): Scale3Dserialize(value: Scale3D): Vector3Likedeserialize(value: Vector3Like, out?: Scale3D): Scale3D