Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Clamp() [1/2]

static void Microsoft.Xna.Framework.Vector4.Clamp ( ref Vector4 value1,
ref Vector4 min,
ref Vector4 max,
out Vector4 result )
inlinestatic

Definition at line 257 of file Vector4.cs.

258 {
259 float x = value1.X;
260 x = ((x > max.X) ? max.X : x);
261 x = ((x < min.X) ? min.X : x);
262 float y = value1.Y;
263 y = ((y > max.Y) ? max.Y : y);
264 y = ((y < min.Y) ? min.Y : y);
265 float z = value1.Z;
266 z = ((z > max.Z) ? max.Z : z);
267 z = ((z < min.Z) ? min.Z : z);
268 float w = value1.W;
269 w = ((w > max.W) ? max.W : w);
270 w = ((w < min.W) ? min.W : w);
271 result.X = x;
272 result.Y = y;
273 result.Z = z;
274 result.W = w;
275 }