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

◆ Clamp() [2/2]

static Vector4 Microsoft.Xna.Framework.Vector4.Clamp ( Vector4 value1,
Vector4 min,
Vector4 max )
inlinestatic

Definition at line 235 of file Vector4.cs.

236 {
237 float x = value1.X;
238 x = ((x > max.X) ? max.X : x);
239 x = ((x < min.X) ? min.X : x);
240 float y = value1.Y;
241 y = ((y > max.Y) ? max.Y : y);
242 y = ((y < min.Y) ? min.Y : y);
243 float z = value1.Z;
244 z = ((z > max.Z) ? max.Z : z);
245 z = ((z < min.Z) ? min.Z : z);
246 float w = value1.W;
247 w = ((w > max.W) ? max.W : w);
248 w = ((w < min.W) ? min.W : w);
249 Vector4 result = default(Vector4);
250 result.X = x;
251 result.Y = y;
252 result.Z = z;
253 result.W = w;
254 return result;
255 }
Vector4(float x, float y, float z, float w)
Definition Vector4.cs:49

References Microsoft.Xna.Framework.Vector4.W, Microsoft.Xna.Framework.Vector4.X, Microsoft.Xna.Framework.Vector4.Y, and Microsoft.Xna.Framework.Vector4.Z.