< />

Ue4中clamp的作用 kisara

UE4中clamp的作用

3-26-2020-1.png

template<class T>
static T Clamp
(
    const T X,
    const T Min,
    const T Max
)
Module Core
Header /Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h
Include #include “Math/UnrealMathUtility.h”

其中让传入的x限于min和max之间,打个比方min 和max就像一把钳子 使x限定在范围之内,当x大于max时,x=max,x小于min时,x=min,其他就不变。

kisarawechat kisaraalipay