public static void changeShader(PhysicsSystem physSystem, aShader shader) { foreach (PhysicsObject obj in physSystem.GetMoveableObjects()) { obj.Shader = shader; } }
public PhysicsObject(AABB boundingBox, Type t, float r, bool locked, aShader shader, float m = 0) { Velocity = new Vec2(0, 0); Aabb = boundingBox; Width = Aabb.Max.X - Aabb.Min.X; Height = Aabb.Max.Y - Aabb.Min.Y; Pos = new Vec2(Aabb.Min.X, Aabb.Min.Y); Center = new Vec2(Pos.X + Width / 2, Pos.Y + Height / 2); ShapeType = t; Restitution = r; Mass = (int)m == 0 ? Aabb.Area : m; IMass = 1 / Mass; Locked = locked; Shader = shader; }