Files
esengine/source/src/Math/SubpixelVector2.ts
2020-08-23 22:09:22 +08:00

23 lines
624 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
module es {
export class SubpixelVector2 {
public _x: SubpixelFloat = new SubpixelFloat();
public _y: SubpixelFloat = new SubpixelFloat();
/**
* 以数量递增s/y余数将值截断为整数存储新的余数并将amount设置为当前值
* @param amount
*/
public update(amount: Vector2) {
amount.x = this._x.update(amount.x);
amount.y = this._y.update(amount.y);
}
/**
* 将余数重置为0
*/
public reset(){
this._x.reset();
this._y.reset();
}
}
}