add PhysX SDK and some tweaks

This commit is contained in:
2025-12-17 12:39:20 +08:00
parent 57ca6c30f5
commit 00d3993a77
26 changed files with 1594 additions and 132 deletions

View File

@ -0,0 +1,15 @@
namespace Prism
{
public static class Mathf
{
public static float Clamp(float value, float min, float max)
{
if (value < min)
return min;
if (value > max)
return max;
return value;
}
}
}

View File

@ -33,6 +33,23 @@ namespace Prism
Z = vec.Z;
}
public void Clamp(Vec3 min, Vec3 max)
{
X = Mathf.Clamp(X, min.X, max.X);
Y = Mathf.Clamp(Y, min.Y, max.Y);
Z = Mathf.Clamp(Z, min.Z, max.Z);
}
public static Vec3 operator *(Vec3 left, float scalar)
{
return new Vec3(left.X * scalar, left.Y * scalar, left.Z * scalar);
}
public static Vec3 operator *(float scalar, Vec3 right)
{
return new Vec3(scalar * right.X, scalar * right.Y, scalar * right.Z);
}
public Vec2 XY {
get { return new Vec2(X, Y); }
set { X = value.X; Y = value.Y; }