vec3
const vec3: (input, options?) => {
Variable: vec3
const vec3: (input, options?) => {
x: number;
y: number;
z: number;
} = Vec3.make;Defined in: packages/motion/src/Entity.ts:50
Build a Vec3; omitted axes are 0.
Constructs a value from the make input representation synchronously.
When to use
Use when constructor input is trusted or when validation failure
should abort with a thrown Error.
Details
Applies constructor defaults and type-side validation according to
MakeOptions.
Gotchas
Throws an Error with the schema issue in its cause when validation
fails. Schema validation failures use the generic message
"Schema validation failed"; format the cause explicitly with
SchemaIssue.makeFormatterDefault() when human-readable details are needed.
Causes that contain defects, interruptions, or other non-schema reasons
throw with the underlying Cause attached instead.
Parameters
| Parameter | Type |
|---|---|
input | { x?: number; y?: number; z?: number; } |
input.x? | number |
input.y? | number |
input.z? | number |
options? | MakeOptions |
Returns
{
x: number;
y: number;
z: number;
}x
readonly x: number;y
readonly y: number;z
readonly z: number;See
- BottomWithoutNew.makeOption — construct synchronously and discard validation details
- BottomWithoutNew.makeEffect — construct through
Effectwhen validation failure should stay in the error channel
Example
Entity.vec3({ x: 100, y: 50 })