📄 d3dx9.pas
字号:
{$EXTERNALSYM D3DXVec2TransformNormalArray}
//--------------------------
// 3D Vector
//--------------------------
// inline
function D3DXVec3Length(const v: TD3DXVector3): Single;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec3Length}
function D3DXVec3LengthSq(const v: TD3DXVector3): Single;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec3LengthSq}
function D3DXVec3Dot(const v1, v2: TD3DXVector3): Single;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec3Dot}
function D3DXVec3Cross(out vOut: TD3DXVector3; const v1, v2: TD3DXVector3): PD3DXVector3;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec3Cross}
function D3DXVec3Add(out vOut: TD3DXVector3; const v1, v2: TD3DXVector3): PD3DXVector3;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec3Add}
function D3DXVec3Subtract(out vOut: TD3DXVector3; const v1, v2: TD3DXVector3): PD3DXVector3;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec3Subtract}
// Minimize each component. x = min(x1, x2), y = min(y1, y2), ...
function D3DXVec3Minimize(out vOut: TD3DXVector3; const v1, v2: TD3DXVector3): PD3DXVector3;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec3Minimize}
// Maximize each component. x = max(x1, x2), y = max(y1, y2), ...
function D3DXVec3Maximize(out vOut: TD3DXVector3; const v1, v2: TD3DXVector3): PD3DXVector3;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec3Maximize}
function D3DXVec3Scale(out vOut: TD3DXVector3; const v: TD3DXVector3; s: Single): PD3DXVector3;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec3Scale}
// Linear interpolation. V1 + s(V2-V1)
function D3DXVec3Lerp(out vOut: TD3DXVector3;
const v1, v2: TD3DXVector3; s: Single): PD3DXVector3;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec3Lerp}
// non-inline
function D3DXVec3Normalize(out vOut: TD3DXVector3;
const v: TD3DXVector3): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3Normalize}
// Hermite interpolation between position V1, tangent T1 (when s == 0)
// and position V2, tangent T2 (when s == 1).
function D3DXVec3Hermite(out vOut: TD3DXVector3;
const v1, t1, v2, t2: TD3DXVector3; s: Single): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3Hermite}
// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
function D3DXVec3CatmullRom(out vOut: TD3DXVector3;
const v0, v1, v2, v3: TD3DXVector3; s: Single): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3CatmullRom}
// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1)
function D3DXVec3BaryCentric(out vOut: TD3DXVector3;
const v1, v2, v3: TD3DXVector3; f, g: Single): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3BaryCentric}
// Transform (x, y, z, 1) by matrix.
function D3DXVec3Transform(out vOut: TD3DXVector4;
const v: TD3DXVector3; const m: TD3DXMatrix): PD3DXVector4; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3Transform}
// Transform (x, y, z, 1) by matrix, project result back into w=1.
function D3DXVec3TransformCoord(out vOut: TD3DXVector3;
const v: TD3DXVector3; const m: TD3DXMatrix): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3TransformCoord}
// Transform (x, y, z, 0) by matrix. If you transforming a normal by a
// non-affine matrix, the matrix you pass to this function should be the
// transpose of the inverse of the matrix you would use to transform a coord.
function D3DXVec3TransformNormal(out vOut: TD3DXVector3;
const v: TD3DXVector3; const m: TD3DXMatrix): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3TransformNormal}
// Transform Array (x, y, z, 1) by matrix.
function D3DXVec3TransformArray(pOut: PD3DXVector4; OutStride: LongWord;
pV: PD3DXVector3; VStride: LongWord; const m: TD3DXMatrix; n: LongWord): PD3DXVector4; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3TransformArray}
// Transform Array (x, y, z, 1) by matrix, project result back into w=1.
function D3DXVec3TransformCoordArray(pOut: PD3DXVector3; OutStride: LongWord;
pV: PD3DXVector3; VStride: LongWord; const m: TD3DXMatrix; n: LongWord): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3TransformCoordArray}
// Transform (x, y, z, 0) by matrix. If you transforming a normal by a
// non-affine matrix, the matrix you pass to this function should be the
// transpose of the inverse of the matrix you would use to transform a coord.
function D3DXVec3TransformNormalArray(pOut: PD3DXVector3; OutStride: LongWord;
pV: PD3DXVector3; VStride: LongWord; const m: TD3DXMatrix; n: LongWord): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3TransformNormalArray}
// Project vector from object space into screen space
function D3DXVec3Project(out vOut: TD3DXVector3;
const v: TD3DXVector3; const pViewport: TD3DViewport9;
const pProjection, pView, pWorld: TD3DXMatrix): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3Project}
// Project vector from screen space into object space
function D3DXVec3Unproject(out vOut: TD3DXVector3;
const v: TD3DXVector3; const pViewport: TD3DViewport9;
const pProjection, pView, pWorld: TD3DXMatrix): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3Unproject}
// Project vector Array from object space into screen space
function D3DXVec3ProjectArray(pOut: PD3DXVector3; OutStride: LongWord;
pV: PD3DXVector3; VStride: LongWord; const pViewport: TD3DViewport9;
const pProjection, pView, pWorld: TD3DXMatrix; n: LongWord): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3ProjectArray}
// Project vector Array from screen space into object space
function D3DXVec3UnprojectArray(pOut: PD3DXVector3; OutStride: LongWord;
pV: PD3DXVector3; VStride: LongWord; const pViewport: TD3DViewport9;
const pProjection, pView, pWorld: TD3DXMatrix; n: LongWord): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec3UnprojectArray}
//--------------------------
// 4D Vector
//--------------------------
// inline
function D3DXVec4Length(const v: TD3DXVector4): Single;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec4Length}
function D3DXVec4LengthSq(const v: TD3DXVector4): Single;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec4LengthSq}
function D3DXVec4Dot(const v1, v2: TD3DXVector4): Single;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec4Dot}
function D3DXVec4Add(out vOut: TD3DXVector4; const v1, v2: TD3DXVector4): PD3DXVector4;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec4Add}
function D3DXVec4Subtract(out vOut: TD3DXVector4; const v1, v2: TD3DXVector4): PD3DXVector4;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec4Subtract}
// Minimize each component. x = min(x1, x2), y = min(y1, y2), ...
function D3DXVec4Minimize(out vOut: TD3DXVector4; const v1, v2: TD3DXVector4): PD3DXVector4;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec4Minimize}
// Maximize each component. x = max(x1, x2), y = max(y1, y2), ...
function D3DXVec4Maximize(out vOut: TD3DXVector4; const v1, v2: TD3DXVector4): PD3DXVector4;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec4Maximize}
function D3DXVec4Scale(out vOut: TD3DXVector4; const v: TD3DXVector4; s: Single): PD3DXVector4;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec4Scale}
// Linear interpolation. V1 + s(V2-V1)
function D3DXVec4Lerp(out vOut: TD3DXVector4;
const v1, v2: TD3DXVector4; s: Single): PD3DXVector4;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXVec4Lerp}
// non-inline
// Cross-product in 4 dimensions.
function D3DXVec4Cross(out vOut: TD3DXVector4;
const v1, v2, v3: TD3DXVector4): PD3DXVector4; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec4Cross}
function D3DXVec4Normalize(out vOut: TD3DXVector4;
const v: TD3DXVector4): PD3DXVector4; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec4Normalize}
// Hermite interpolation between position V1, tangent T1 (when s == 0)
// and position V2, tangent T2 (when s == 1).
function D3DXVec4Hermite(out vOut: TD3DXVector4;
const v1, t1, v2, t2: TD3DXVector4; s: Single): PD3DXVector4; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec4Hermite}
// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
function D3DXVec4CatmullRom(out vOut: TD3DXVector4;
const v0, v1, v2, v3: TD3DXVector4; s: Single): PD3DXVector4; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec4CatmullRom}
// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1)
function D3DXVec4BaryCentric(out vOut: TD3DXVector4;
const v1, v2, v3: TD3DXVector4; f, g: Single): PD3DXVector4; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec4BaryCentric}
// Transform vector by matrix.
function D3DXVec4Transform(out vOut: TD3DXVector4;
const v: TD3DXVector4; const m: TD3DXMatrix): PD3DXVector4; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec4Transform}
// Transform vector array by matrix.
function D3DXVec4TransformArray(pOut: PD3DXVector4; OutStride: LongWord;
pV: PD3DXVector4; VStride: LongWord; const m: TD3DXMatrix; n: LongWord): PD3DXVector4; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXVec4TransformArray}
//--------------------------
// 4D Matrix
//--------------------------
// inline
function D3DXMatrixIdentity(out mOut: TD3DXMatrix): PD3DXMatrix;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXMatrixIdentity}
function D3DXMatrixIsIdentity(const m: TD3DXMatrix): BOOL;{$IFDEF ALLOW_INLINE} inline;{$ENDIF}
{$EXTERNALSYM D3DXMatrixIsIdentity}
// non-inline
function D3DXMatrixDeterminant(const m: TD3DXMatrix): Single; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixDeterminant}
function D3DXMatrixDecompose(pOutScale: PD3DXVector3; pOutRotation: PD3DXQuaternion;
pOutTranslation: PD3DXVector3; const M: TD3DXMatrix): HRESULT; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixDecompose}
function D3DXMatrixTranspose(out pOut: TD3DXMatrix; const pM: TD3DXMatrix): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixTranspose}
// Matrix multiplication. The result represents the transformation M2
// followed by the transformation M1. (Out = M1 * M2)
function D3DXMatrixMultiply(out mOut: TD3DXMatrix; const m1, m2: TD3DXMatrix): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixMultiply}
// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2))
function D3DXMatrixMultiplyTranspose(out pOut: TD3DXMatrix; const pM1, pM2: TD3DXMatrix): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixMultiplyTranspose}
// Calculate inverse of matrix. Inversion my fail, in which case NULL will
// be returned. The determinant of pM is also returned it pfDeterminant
// is non-NULL.
function D3DXMatrixInverse(out mOut: TD3DXMatrix; pfDeterminant: PSingle;
const m: TD3DXMatrix): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixInverse}
// Build a matrix which scales by (sx, sy, sz)
function D3DXMatrixScaling(out mOut: TD3DXMatrix; sx, sy, sz: Single): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixScaling}
// Build a matrix which translates by (x, y, z)
function D3DXMatrixTranslation(out mOut: TD3DXMatrix; x, y, z: Single): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixTranslation}
// Build a matrix which rotates around the X axis
function D3DXMatrixRotationX(out mOut: TD3DXMatrix; angle: Single): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixRotationX}
// Build a matrix which rotates around the Y axis
function D3DXMatrixRotationY(out mOut: TD3DXMatrix; angle: Single): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixRotationY}
// Build a matrix which rotates around the Z axis
function D3DXMatrixRotationZ(out mOut: TD3DXMatrix; angle: Single): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixRotationZ}
// Build a matrix which rotates around an arbitrary axis
function D3DXMatrixRotationAxis(out mOut: TD3DXMatrix; const v: TD3DXVector3;
angle: Single): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixRotationAxis}
// Build a matrix from a quaternion
function D3DXMatrixRotationQuaternion(out mOut: TD3DXMatrix; const Q: TD3DXQuaternion): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixRotationQuaternion}
// Yaw around the Y axis, a pitch around the X axis,
// and a roll around the Z axis.
function D3DXMatrixRotationYawPitchRoll(out mOut: TD3DXMatrix; yaw, pitch, roll: Single): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixRotationYawPitchRoll}
// Build transformation matrix. NULL arguments are treated as identity.
// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
function D3DXMatrixTransformation(out mOut: TD3DXMatrix;
pScalingCenter: PD3DXVector3;
pScalingRotation: PD3DXQuaternion; pScaling, pRotationCenter: PD3DXVector3;
pRotation: PD3DXQuaternion; pTranslation: PD3DXVector3): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixTransformation}
// Build 2D transformation matrix in XY plane. NULL arguments are treated as identity.
// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
function D3DXMatrixTransformation2D(out pOut: TD3DXMatrix;
pScalingCenter: PD3DXVector2;
ScalingRotation: Single; pScaling: PD3DXVector2; pRotationCenter: PD3DXVector2;
Rotation: Single; pTranslation: PD3DXVector2): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixTransformation2D}
// Build affine transformation matrix. NULL arguments are treated as identity.
// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
function D3DXMatrixAffineTransformation(out mOut: TD3DXMatrix;
Scaling: Single; pRotationCenter: PD3DXVector3;
pRotation: PD3DXQuaternion; pTranslation: PD3DXVector3): PD3DXMatrix; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXMatrixAffineTransformation}
// Build 2D affine transformation matrix in XY plane. NULL arguments are treated as identity.
// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -