Skip to content

vec2 truncate function #308

@mreinstein

Description

@mreinstein

Shortens a vector to maxLength if it is longer.

export function truncate(out, maxLength) {
  if (vec2.length(out) > maxLength) {
    setLength(out, maxLength)
  }
  return out
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions