normalizeDirectionInPlace Method

Normalize the direction vector in place.

normalizeDirectionInPlace(defaultX: number1, defaultY: number0): boolean

@returns whether normalization succeeded (i.e., direction is nonzero)

Parameter Type Description
defaultX number value to set this.direction.x if normalization fails. Default value 1.
defaultY number value to set this.direction.y if normalization fails. Default value 0.

Returns - boolean

whether normalization succeeded (i.e., direction is nonzero)

Defined in

Last Updated: 14 November, 2024