clampPoint 方法的作用是将给定的点约束到此AABB中。
AABB.clampPoint(point: Vector3, target: Vector3): Vector3
point:Vector3类型,表示需要被约束的点。target:Vector3类型,表示一个可选的向量用于存放约束后的点。如果未指定此参数,则会返回一个新的Vector3对象。Vector3类型,表示约束后的点。如果存在 target 参数,则返回该参数;否则,返回一个新的 Vector3 对象。
clampPoint: function ( point, target ) {
    var min = this.min;
    var max = this.max;
    if ( target === undefined ) {
        console.warn( 'Yuka: AABB - No result vector given.' );
        target = new Vector3();
    }
    target.copy( point );
    target.x = Math.max( min.x, Math.min( max.x, target.x ) );
    target.y = Math.max( min.y, Math.min( max.y, target.y ) );
    target.z = Math.max( min.z, Math.min( max.z, target.z ) );
    return target;
}
const aabb = new AABB( new Vector3( -1, -1, -1 ), new Vector3( 1, 1, 1 ) );
const point = new Vector3( 4, 4, 4 );
const result = aabb.clampPoint( point ); // result equals (1, 1, 1)