@game-vir/entity
Version:
Entity system for game development.
37 lines (36 loc) • 1.25 kB
TypeScript
import { type RequireExactlyOne } from 'type-fest';
/**
* An angle definition defined in either radians or degrees, with accessors for both radians and
* degrees. Values are rounded according to the given `digits` option. An instance of this class is
* readonly: to get updated values, construct a new instance.
*
* @category Math
*/
export declare class Angle {
/** Angle options. Set to `undefined` to disable all options. */
readonly options: {
/**
* Number of digits to round all values to. Set to `undefined` to disable
* rounding.
*/
digits: number | undefined;
} | undefined;
/** The angle's value expressed in radians. */
readonly radians: number;
/** The angle's value expressed in degrees. */
readonly degrees: number;
constructor(
/** Original angle value, either in radians or degrees. */
originalValue: RequireExactlyOne<{
radians: number;
degrees: number;
}>,
/** Angle options. Set to `undefined` to disable all options. */
options: {
/**
* Number of digits to round all values to. Set to `undefined` to disable
* rounding.
*/
digits: number | undefined;
} | undefined);
}