AR_Engine_SDK
|
函数 | |
function | XRT_RayToAABB3 (vStart, vDelta, vMins, vMaxs) end |
function | XRT_PlaneAABBOverlap (Plane, _vMins, _vMaxs) end |
function | XRT_PlaneSphereOverlap (Plane, vCenter, fRadius) end |
function | XRT_PlaneSphereOverlap (vNormal, fDist, vCenter, fRadius) end |
function | XG_InvSqrt (v) end |
function | XG_SquareMagnitude (v) end |
function | XG_Magnitude (v) end |
function | XG_MagnitudeH (v) end |
function | XG_Vector423 (v) end |
function | XG_Normalize (v) end |
function | XG_CompressDir (v) end |
function | XG_DecompressDir (b1, b2) end |
function | XG_VecMin (v1, v2) end |
function | XG_VecMax (v1, v2) end |
function | XG_ViewToWorld (vIn, matView) end |
function | XG_IdentityMatrix3 () end |
function | XG_TransformMatrix3 (fRad, vecPos) end |
function | XG_TransformMatrix3 (fRad, vecPos, vecScale) end |
function | XG_TransformMatrix3 (vecXDir, vecPos) end |
function | XG_TransformMatrix3 (vecXDir, vecPos, vecScale) end |
function | XG_IdentityMatrix () end |
function | XG_ZeroMatrix () end |
function | XG_ViewMatrix (from, dir, vecUp, roll) end |
function | XG_LookAtMatrix (from, to, vecUp, roll) end |
function | XG_TransformMatrix (vecDir, vecUp, vecPos) end |
function | XG_RotateX (vRad) end |
function | XG_RotateX (mat, vRad) end |
function | XG_RotateY (vRad) end |
function | XG_RotateY (mat, vRad) end |
function | XG_RotateZ (vRad) end |
function | XG_RotateZ (mat, vRad) end |
function | XG_RotateAxis (vecAxis, vRad) end |
function | XG_RotateAxis (vecPos, vecAxis, vRad) end |
function | XG_RotateEuler (xRad, yRad, zRad) end |
function | XG_RotatePosAroundX (vPos, fRad) end |
function | XG_RotatePosAroundY (vPos, fRad) end |
function | XG_RotatePosAroundZ (vPos, fRad) end |
function | XG_RotatePosAroundAxis (vPos, vAxis, fRad) end |
function | XG_RotatePosAroundLine (vPos, vOrigin, vDir, fRad) end |
function | XG_RotateVecAroundLine (v, vOrigin, vDir, fRad) end |
function | XG_Scaling (sx, sy, sz) end |
function | XG_Scaling (mat, sx, sy, sz) end |
function | XG_ScalingRelative (matRoot, sx, sy, sz) end |
function | XG_Translate (x, y, z) end |
function | XG_ScaleAlongAxis (vAxis, fScale) end |
function | XG_Transpose (mat) end |
function | XG_Transpose (matIn) end |
function | XG_DecomposeMatrix (mat) end |
function | XG_DecomposeStrechedMatrixDiscardScale (mat) end |
function | XG_GetCubeMapDirAndUp (nFaceIndex) end |
function | XG_ColorValueToColorRGBA (colorValue) end |
function | XG_ColorRGBAToColorValue (colorRGBA) end |
function | XG_MirrorMatrix (p, n) end |
function | XG_InverseTM (mat) end |
function | XG_InverseTM (matIn) end |
function | XG_InverseMatrix (mat) end |
function | XG_InverseMatrix (matIn) end |
function | XG_InverseAffineMatrix (mat) end |
function | XG_InverseAffineMatrix (matIn) end |
function | XG_OrthoMatrix (fWidth, fHeight, fZNear, fZFar) end |
function | XG_OrthoOffCenterMatrix (fLeft, fRight, fBottom, fTop, fZNear, fZFar) end |
function | XG_PerspectiveMatrix (fWidth, fHeight, fZNear, fZFar) end |
function | XG_PerspectiveFovMatrix (fFovY, fAspect, fZNear, fZFar) end |
function | XG_PerspectiveOffCenterMatrix (fLeft, fRight, fBottom, fTop, fZNear, fZFar) end |
function | XG_OrthoMatrixRH (fWidth, fHeight, fZNear, fZFar) end |
function | XG_OrthoOffCenterMatrixRH (fLeft, fRight, fBottom, fTop, fZNear, fZFar) end |
function | XG_PerspectiveMatrixRH (fWidth, fHeight, fZNear, fZFar) end |
function | XG_PerspectiveFovMatrixRH (fFovY, fAspect, fZNear, fZFar) end |
function | XG_PerspectiveOffCenterMatrixRH (fLeft, fRight, fBottom, fTop, fZNear, fZFar) end |
function | XG_ClearAABB (vMins, vMaxs) end |
function | XG_AddVertexToAABB (vMins, vMaxs, vPoint) end |
function | XG_ExpandAABB (vecMins, vecMaxs, obb) end |
function | XG_ExpandAABB (vecMins, vecMaxs, subAABB) end |
function | XG_BuildAABB (obb) end |
function | XG_MergeAABB (pAABB, subAABB) end |
function | XG_CompleteAABB (pAABB) end |
function | XG_CompleteOBB (pOBB) end |
function | XG_RandDirH () end |
function | XG_HSVToRGB (hsvColor) end |
function | XG_RGBToHSV (rgbColor) end |
function | XG_RGBToHSL (r, g, b) end |
function | XG_DecompressColor (rgbColor) end |
function | XG_Matrix3Rotate (fRad) end |
function | XG_Matrix3Rotate (mat, fRad) end |
function | XG_Matrix3Translate (x, y) end |
function | XG_Matrix3Translate (mat, x, y) end |
function | XG_VectorMatrix3x3 (v, mat) end |
function | XG_DistSquareToAABB (vPos, aabb) end |
function | XG_TransformAABB (aabb, mat) end |
function | XG_RayToTriangle (vStart, vDelta, v0, v1, v2, bTwoSides) end |
function | TransformMatrix (qRotation, vTranslation, vScaling) end |
function | XG_CastRay (pViewport, vecScreenPoint) end |
function | XG_NormalizedCrossProduct (vec1, vec2) end |
function | XG_IsZeroLength (vecIn) end |
function | XG_PointToLineDistance (vecPoint, vecLinePoint, vecLineDirection) end |
function | XG_LineLineDistance (vecPoint0, vecDir0, vecPoint1, vecDir1) end |
function | XG_LinePlaneIntersection (vecLinePoint, vecLineDir, vecPlanePoint, vecPlaneNormal) end |
function | XG_LineSphereIntersection (vecLinePoint, vecLineDir, vecSphereCenter, fRadius) end |
function | X_Equals (a, b, eps) end |
function | X_IsPowerOfTwo (x) end |
function | X_CeilPowerOfTwo (x) end |
function | X_FloorPowerOfTwo (x) end |
function | X_Srand_Time () end |
function | X_Srand_ (seed) end |
function | X_Rand_ () end |
function | X_Random_0_to_1 () end |
function | X_RandInt (lower, upper) end |
function | X_RandFloat (lower, upper) end |
function | XG_CompressDirH (x, z) end |
function | XG_DecompressDirH (byDir) end |
function | XECrypt (operation, algorithm, mode, padding, key, key_len, vector, vector_len, input, input_len, output) end |
@type number @readonly | |
变量 | |
DEFAULTFOVDEGREE = 0 | |
@type number @readonly | |
DEFAULTZNEAR = 0 | |
@type number @readonly | |
DEFAULTZFAR = 0 | |
@type number @readonly | |
DEFAULTRADIO = 0 | |
@type number @readonly | |
function TransformMatrix | ( | qRotation | , |
vTranslation | , | ||
vScaling | |||
) |
function X_CeilPowerOfTwo | ( | x | ) |
X_CeilPowerOfTwo00
x | number |
function X_Equals | ( | a | , |
b | , | ||
eps | |||
) |
判断变量 a 和 b 是否在一定误差范围内相等(提供了两个接口,支持xfloat32和xfloat64两种类型)
a | number |
b | number |
eps | number 误差范围(xfloat32类型) |
判断变量 a 和 b 是否在一定误差范围内相等(提供了两个接口,支持xfloat32和xfloat64两种类型)
a | number |
b | number |
eps | number 误差范围(xfloat64类型) |
function X_FloorPowerOfTwo | ( | x | ) |
X_FloorPowerOfTwo00
x | number |
function X_IsPowerOfTwo | ( | x | ) |
判断 x 是否是 2 的 n 次幂
x | number |
function X_Rand_ | ( | ) |
X_Rand_00
function X_Random_0_to_1 | ( | ) |
X_Random_0_to_100
function X_Srand_ | ( | seed | ) |
X_Srand_00
seed | number |
function X_Srand_Time | ( | ) |
X_Srand_Time00
function XECrypt | ( | operation | , |
algorithm | , | ||
mode | , | ||
padding | , | ||
key | , | ||
key_len | , | ||
vector | , | ||
vector_len | , | ||
input | , | ||
input_len | , | ||
output | |||
) |
@type number @readonly
@type number @readonly @type number @readonly @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @type XConsoleVariable @manual xelua_XEngine_XECrypt_manual XECrypt_manual
operation | number |
algorithm | number |
mode | number |
padding | number |
key | string |
key_len | number |
vector | string |
vector_len | number |
input | string |
input_len | number |
output | string |
function XG_AddVertexToAABB | ( | vMins | , |
vMaxs | , | ||
vPoint | |||
) |
function XG_CastRay | ( | pViewport | , |
vecScreenPoint | |||
) |
function XG_ColorRGBAToColorValue | ( | colorRGBA | ) |
XCOLOR格式转换为XCOLORBASE格式
colorRGBA | number XCOLOR(一个xuint32)格式颜色信息 |
function XG_ColorValueToColorRGBA | ( | colorValue | ) |
XCOLORBASE格式转换为XCOLOR格式
colorValue | XCOLORBASE XCOLORBASE(4个xfloat32颜色分量r,g,b,a)格式颜色信息 |
function XG_CompleteAABB | ( | pAABB | ) |
function XG_CompleteOBB | ( | pOBB | ) |
function XG_CompressDir | ( | v | ) |
function XG_DecomposeMatrix | ( | mat | ) |
function XG_DecomposeStrechedMatrixDiscardScale | ( | mat | ) |
function XG_DecompressColor | ( | rgbColor | ) |
XG_DecompressColor00
rgbColor | number |
function XG_DecompressDir | ( | b1 | , |
b2 | |||
) |
function XG_DecompressDirH | ( | byDir | ) |
function XG_DistSquareToAABB | ( | vPos | , |
aabb | |||
) |
function XG_ExpandAABB | ( | vecMins | , |
vecMaxs | , | ||
obb | |||
) |
function XG_ExpandAABB | ( | vecMins | , |
vecMaxs | , | ||
subAABB | |||
) |
function XG_GetCubeMapDirAndUp | ( | nFaceIndex | ) |
function XG_HSVToRGB | ( | hsvColor | ) |
function XG_IdentityMatrix | ( | ) |
初始化一个 4 x 4 的单位矩阵并将其返回
function XG_IdentityMatrix3 | ( | ) |
初始化一个 3 x 3 的单位矩阵并将其返回
function XG_InverseTM | ( | mat | ) |
function XG_InvSqrt | ( | v | ) |
计算 v 的平方根的倒数,并返回
v | number 待计算的浮点数 |
function XG_IsZeroLength | ( | vecIn | ) |
function XG_LineLineDistance | ( | vecPoint0 | , |
vecDir0 | , | ||
vecPoint1 | , | ||
vecDir1 | |||
) |
function XG_LinePlaneIntersection | ( | vecLinePoint | , |
vecLineDir | , | ||
vecPlanePoint | , | ||
vecPlaneNormal | |||
) |
function XG_LineSphereIntersection | ( | vecLinePoint | , |
vecLineDir | , | ||
vecSphereCenter | , | ||
fRadius | |||
) |
function XG_LookAtMatrix | ( | from | , |
to | , | ||
vecUp | , | ||
roll | |||
) |
function XG_Magnitude | ( | v | ) |
function XG_MagnitudeH | ( | v | ) |
function XG_Matrix3Rotate | ( | fRad | ) |
function XG_Matrix3Rotate | ( | mat | , |
fRad | |||
) |
function XG_MergeAABB | ( | pAABB | , |
subAABB | |||
) |
function XG_Normalize | ( | v | ) |
function XG_NormalizedCrossProduct | ( | vec1 | , |
vec2 | |||
) |
function XG_OrthoMatrix | ( | fWidth | , |
fHeight | , | ||
fZNear | , | ||
fZFar | |||
) |
根据宽、高、远近距离构建正交投影矩阵并返回,此时投影平面的中心与屏幕的几何中心点重合
fWidth | number 视口的宽 |
fHeight | number 视口的高 |
fZNear | number 近裁剪平面到相机的距离 |
fZFar | number 远裁剪平面到相机的距离 |
function XG_OrthoMatrixRH | ( | fWidth | , |
fHeight | , | ||
fZNear | , | ||
fZFar | |||
) |
function XG_OrthoOffCenterMatrix | ( | fLeft | , |
fRight | , | ||
fBottom | , | ||
fTop | , | ||
fZNear | , | ||
fZFar | |||
) |
根据上下左右远近距离构建正交投影矩阵并返回
fLeft | number 视椎体左平面到相机的距离 |
fRight | number 视椎体右平面到相机的距离 |
fBottom | number 视椎体底部平面到相机的距离 |
fTop | number 视椎体顶部平面到相机的距离 |
fZNear | number 近裁剪平面到相机的距离 |
fZFar | number 远裁剪平面到相机的距离 |
function XG_OrthoOffCenterMatrixRH | ( | fLeft | , |
fRight | , | ||
fBottom | , | ||
fTop | , | ||
fZNear | , | ||
fZFar | |||
) |
计算左右,上下不等值的正交矩阵
fLeft | number 左侧值 |
fRight | number 右侧值 |
fBottom | number 下侧值 |
fTop | number 上侧值 |
fZNear | number 近裁剪 |
fZFar | number 远裁剪 |
function XG_PerspectiveFovMatrix | ( | fFovY | , |
fAspect | , | ||
fZNear | , | ||
fZFar | |||
) |
根据竖直方向的视角、近裁剪平面的宽高比、远近距离构建透视投影矩阵并返回
fFovY | number 竖直方向的视角(弧度) |
fAspect | number 视口的宽高比 |
fZNear | number 近裁剪平面到相机的距离 |
fZFar | number 远裁剪平面到相机的距离 |
function XG_PerspectiveFovMatrixRH | ( | fFovY | , |
fAspect | , | ||
fZNear | , | ||
fZFar | |||
) |
由于fov计算一个右手透视矩阵
fFovY | number fov值 |
fAspect | number 宽高比 |
fZNear | number 近裁剪 |
fZFar | number 远裁剪 |
function XG_PerspectiveMatrix | ( | fWidth | , |
fHeight | , | ||
fZNear | , | ||
fZFar | |||
) |
根据宽、高、远近距离构建透视投影矩阵并返回
fWidth | number 视口的宽 |
fHeight | number 视口的高 |
fZNear | number 近裁剪平面到相机的距离 |
fZFar | number 远裁剪平面到相机的距离 |
function XG_PerspectiveMatrixRH | ( | fWidth | , |
fHeight | , | ||
fZNear | , | ||
fZFar | |||
) |
function XG_PerspectiveOffCenterMatrix | ( | fLeft | , |
fRight | , | ||
fBottom | , | ||
fTop | , | ||
fZNear | , | ||
fZFar | |||
) |
根据上下左右远近远近距离构建透视投影矩阵并返回
fLeft | number 视椎体左平面到相机的距离 |
fRight | number 视椎体右平面到相机的距离 |
fBottom | number 视椎体底部平面到相机的距离 |
fTop | number 视椎体顶部平面到相机的距离 |
fZNear | number 近裁剪平面到相机的距离 |
fZFar | number 远裁剪平面到相机的距离 |
function XG_PerspectiveOffCenterMatrixRH | ( | fLeft | , |
fRight | , | ||
fBottom | , | ||
fTop | , | ||
fZNear | , | ||
fZFar | |||
) |
计算一个左右,上下不对称的透视矩阵
fLeft | number 左侧值 |
fRight | number 右侧值 |
fBottom | number 下侧值 |
fTop | number 上侧值 |
fZNear | number 近裁剪 |
fZFar | number 远裁剪 |
function XG_PointToLineDistance | ( | vecPoint | , |
vecLinePoint | , | ||
vecLineDirection | |||
) |
function XG_RandDirH | ( | ) |
随机生成一个水平向量
function XG_RayToTriangle | ( | vStart | , |
vDelta | , | ||
v0 | , | ||
v1 | , | ||
v2 | , | ||
bTwoSides | |||
) |
function XG_RGBToHSL | ( | r | , |
g | , | ||
b | |||
) |
XG_RGBToHSL00
r | number |
g | number |
b | number |
function XG_RGBToHSV | ( | rgbColor | ) |
function XG_RotateAxis | ( | vecAxis | , |
vRad | |||
) |
function XG_RotateAxis | ( | vecPos | , |
vecAxis | , | ||
vRad | |||
) |
function XG_RotateEuler | ( | xRad | , |
yRad | , | ||
zRad | |||
) |
计算欧拉角对应的旋转矩阵并返回。
xRad | number 绕x轴旋转的欧拉角 |
yRad | number 绕y轴旋转的欧拉角 |
zRad | number 绕z轴旋转的欧拉角 |
function XG_RotatePosAroundAxis | ( | vPos | , |
vAxis | , | ||
fRad | |||
) |
function XG_RotatePosAroundX | ( | vPos | , |
fRad | |||
) |
function XG_RotatePosAroundY | ( | vPos | , |
fRad | |||
) |
function XG_RotatePosAroundZ | ( | vPos | , |
fRad | |||
) |
function XG_RotateVecAroundLine | ( | v | , |
vOrigin | , | ||
vDir | , | ||
fRad | |||
) |
function XG_RotateX | ( | mat | , |
vRad | |||
) |
function XG_RotateX | ( | vRad | ) |
function XG_RotateY | ( | mat | , |
vRad | |||
) |
function XG_RotateY | ( | vRad | ) |
function XG_RotateZ | ( | mat | , |
vRad | |||
) |
function XG_RotateZ | ( | vRad | ) |
function XG_ScaleAlongAxis | ( | vAxis | , |
fScale | |||
) |
function XG_Scaling | ( | mat | , |
sx | , | ||
sy | , | ||
sz | |||
) |
function XG_Scaling | ( | sx | , |
sy | , | ||
sz | |||
) |
function XG_ScalingRelative | ( | matRoot | , |
sx | , | ||
sy | , | ||
sz | |||
) |
function XG_SquareMagnitude | ( | v | ) |
function XG_TransformMatrix | ( | vecDir | , |
vecUp | , | ||
vecPos | |||
) |
function XG_TransformMatrix3 | ( | fRad | , |
vecPos | |||
) |
function XG_TransformMatrix3 | ( | fRad | , |
vecPos | , | ||
vecScale | |||
) |
function XG_TransformMatrix3 | ( | vecXDir | , |
vecPos | |||
) |
function XG_TransformMatrix3 | ( | vecXDir | , |
vecPos | , | ||
vecScale | |||
) |
构建平移矩阵并将其返回,返回的矩阵不包含旋转和缩放信息
x | number x轴上的平移量 |
y | number y轴上的平移量 |
z | number z轴上的平移量 |
function XG_VecMax | ( | v1 | , |
v2 | |||
) |
function XG_VecMin | ( | v1 | , |
v2 | |||
) |
function XG_ViewMatrix | ( | from | , |
dir | , | ||
vecUp | , | ||
roll | |||
) |
function XG_ViewToWorld | ( | vIn | , |
matView | |||
) |
function XG_ZeroMatrix | ( | ) |
初始化一个 4 x 4 ,且元素全为 0 的矩阵并将其返回
function XRT_PlaneAABBOverlap | ( | Plane | , |
_vMins | , | ||
_vMaxs | |||
) |
检测平面是否与AABB包围盒碰撞(或重叠)
Plane | XCusSPlane 引擎中封装的代表平面的对象 |
_vMins | XVECTOR3 AABB包围盒“最小”点 |
_vMaxs | XVECTOR3 AABB包围盒“最大”点 |
检测平面是否与球体碰撞(或重叠)
Plane | XCusSPlane 引擎中封装的代表平面的对象 |
vCenter | XVECTOR3 空间中球的中心坐标 |
fRadius | number 球的半径 |
function XRT_RayToAABB3 | ( | vStart | , |
vDelta | , | ||
vMins | , | ||
vMaxs | |||
) |
DEFAULTFOVDEGREE = 0 |
@type number @readonly
DEFAULTRADIO = 0 |
@type number @readonly
DEFAULTZFAR = 0 |
@type number @readonly
DEFAULTZNEAR = 0 |
@type number @readonly