{
  "code": "export class FollowNumber {\r\n    constructor(t, from = 0, to = 0, tiny = 0) {\r\n        this.m_t = 0;\r\n        this.target = 0;\r\n        this.follow = 0;\r\n        this.m_tiny = 0;\r\n        this.m_t = t;\r\n        this.target = to;\r\n        this.follow = from;\r\n        this.m_tiny = tiny;\r\n    }\r\n    ChangeT(value) {\r\n        this.m_t = value;\r\n    }\r\n    get t() { return this.m_t; }\r\n    update() {\r\n        this.follow = MathTool.MixNumber(this.follow, this.target, this.m_t);\r\n        if (this.m_tiny != 0 && this.target != this.follow) {\r\n            if (Math.abs(this.target - this.follow) <= this.m_tiny) {\r\n                this.follow = this.target;\r\n            }\r\n        }\r\n    }\r\n}\r\nexport class MathTool {\r\n    static get VecZero() {\r\n        return new Laya.Vector3();\r\n    }\r\n    static RandomNumber(from, to) {\r\n        if (from >= to) {\r\n            return 0;\r\n        }\r\n        var size = to - from;\r\n        var curNumber = Math.random() * size + from;\r\n        return curNumber;\r\n    }\r\n    static SpToCam(v3) {\r\n        v3.x = -v3.x;\r\n        v3.y = v3.y - 180;\r\n        v3.z = -v3.z;\r\n        return v3;\r\n    }\r\n    static MixVector3(from, to, t, res = null) {\r\n        if (res == null) {\r\n            res = this.m_mixVector;\r\n        }\r\n        res.x = MathTool.MixNumber(from.x, to.x, t);\r\n        res.y = MathTool.MixNumber(from.y, to.y, t);\r\n        res.z = MathTool.MixNumber(from.z, to.z, t);\r\n        return res;\r\n    }\r\n    static MixNumber(from, to, t) {\r\n        t = MathTool.Clamp(t, 0, 1);\r\n        from = (to - from) * t + from;\r\n        return from;\r\n    }\r\n    static Clamp(value, from, to) {\r\n        if (value < from) {\r\n            value = from;\r\n        }\r\n        if (value > to) {\r\n            value = to;\r\n        }\r\n        return value;\r\n    }\r\n}\r\nMathTool.m_mixVector = new Laya.Vector3();\r\n//# sourceMappingURL=MathTool.js.map",
  "references": [],
  "map": "{\"version\":3,\"file\":\"MathTool.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Util/MathTool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