You are here: Lua Scripting Resources eGuide > Lua Scripting API Reference Guide > Physics Library > clamp

19.2.3 clamp

clamped = physics.Vect:clamp(len)

Parameter

Type

Description

self

in physics.Vect

The input vector

len

in number

The maximum length of the vector

clamped

out physics.Vect

A new vector with a length no longer than len


Returns a copy of self clamped to length len.

Introduced in platform.apiLevel = '2.0'