mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
a6949bc6ec
* use float64 on non-jsb' platforms * simplify * fix arg
22 lines
568 B
TypeScript
22 lines
568 B
TypeScript
import { JSB } from 'internal:constants';
|
|
import { ValueType } from '../value-types/value-type';
|
|
import { FloatArray } from './type-define';
|
|
|
|
export const MATH_FLOAT_ARRAY = JSB ? Float32Array : Float64Array;
|
|
|
|
export class MathBase extends ValueType {
|
|
public static createFloatArray (size: number) {
|
|
return new MATH_FLOAT_ARRAY(size);
|
|
}
|
|
|
|
/**
|
|
* @en Get the internal array data.
|
|
* @zh 获取内部 array 数据。
|
|
*/
|
|
public get array (): FloatArray {
|
|
return this._array;
|
|
}
|
|
|
|
protected declare _array: FloatArray;
|
|
}
|