📄 d3dx8.pas
字号:
function D3DXMatrixRotationX(var mOut : TD3DXMatrix; const angle : Single) : PD3DXMatrix; stdcall; overload;
function D3DXMatrixRotationX(mOut : PD3DXMatrix; const angle : Single) : PD3DXMatrix; stdcall; overload;
// Build a matrix which rotates around the Y axis
function D3DXMatrixRotationY(var mOut : TD3DXMatrix; const angle : Single) : PD3DXMatrix; stdcall; overload;
function D3DXMatrixRotationY(mOut : PD3DXMatrix; const angle : Single) : PD3DXMatrix; stdcall; overload;
// Build a matrix which rotates around the Z axis
function D3DXMatrixRotationZ(var mOut : TD3DXMatrix; const angle : Single) : PD3DXMatrix; stdcall; overload;
function D3DXMatrixRotationZ(mOut : PD3DXMatrix; const angle : Single) : PD3DXMatrix; stdcall; overload;
// Build a matrix which rotates around an arbitrary axis
function D3DXMatrixRotationAxis(var mOut : TD3DXMatrix; var v : TD3DXVector3; const angle : Single) : PD3DXMatrix; stdcall;
// Build a matrix from a quaternion
function D3DXMatrixRotationQuaternion(var mOut : TD3DXMatrix; var Q : TD3DXQuaternion) : PD3DXMatrix; stdcall;
// Yaw around the Y axis, a pitch around the X axis,
// and a roll around the Z axis.
function D3DXMatrixRotationYawPitchRoll(var mOut : TD3DXMatrix; const yaw, pitch, roll : Single) : PD3DXMatrix; stdcall;
// Build transformation matrix. NULL arguments are treated as identity.
// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
function D3DXMatrixTransformation(var mOut : TD3DXMatrix; pScalingCenter : PD3DXVector3; pScalingRotation : PD3DXQuaternion; pScaling, pRotationCenter : PD3DXVector3; pRotation : PD3DXQuaternion; pTranslation : PD3DXVector3) : PD3DXMatrix; stdcall;
// Build affine transformation matrix. NULL arguments are treated as identity.
// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
function D3DXMatrixAffineTransformation(out mOut : TD3DXMatrix; const Scaling : Single; pRotationCenter : PD3DXVector3; pRotation : PD3DXQuaternion; pTranslation : PD3DXVector3): PD3DXMatrix; stdcall;
// Build a lookat matrix. (right-handed)
function D3DXMatrixLookAtRH(var mOut : TD3DXMatrix; var Eye, At, Up : TD3DXVector3) : PD3DXMatrix; stdcall;
// Build a lookat matrix. (left-handed)
function D3DXMatrixLookAtLH(out mOut : TD3DXMatrix; var Eye, At, Up : TD3DXVector3) : PD3DXMatrix; stdcall; overload;
function D3DXMatrixLookAtLH(out mOut : TD3DXMatrix; Eye, At, Up : PD3DXVector3) : PD3DXMatrix; stdcall; overload;
function D3DXMatrixLookAtLH(mOut : PD3DXMatrix; var Eye, At, Up : TD3DXVector3) : PD3DXMatrix; stdcall; overload;
function D3DXMatrixLookAtLH(mOut : PD3DXMatrix; Eye, At, Up : PD3DXVector3) : PD3DXMatrix; stdcall; overload;
// Build a perspective projection matrix. (right-handed)
function D3DXMatrixPerspectiveRH(var mOut : TD3DXMatrix; const w, h, zn, zf : Single) : PD3DXMatrix; stdcall;
// Build a perspective projection matrix. (left-handed)
function D3DXMatrixPerspectiveLH(var mOut : TD3DXMatrix; const w, h, zn, zf : Single) : PD3DXMatrix; stdcall;
// Build a perspective projection matrix. (right-handed)
function D3DXMatrixPerspectiveFovRH(var mOut : TD3DXMatrix; const flovy, aspect, zn, zf : Single) : PD3DXMatrix; stdcall;
// Build a perspective projection matrix. (left-handed)
function D3DXMatrixPerspectiveFovLH(var mOut : TD3DXMatrix; const flovy, aspect, zn, zf : Single) : PD3DXMatrix; stdcall;
// Build a perspective projection matrix. (right-handed)
function D3DXMatrixPerspectiveOffCenterRH(var mOut : TD3DXMatrix; const l, r, b, t, zn, zf : Single) : PD3DXMatrix; stdcall;
// Build a perspective projection matrix. (left-handed)
function D3DXMatrixPerspectiveOffCenterLH(var mOut : TD3DXMatrix; const l, r, b, t, zn, zf : Single) : PD3DXMatrix; stdcall;
// Build an ortho projection matrix. (right-handed)
function D3DXMatrixOrthoRH(var mOut : TD3DXMatrix; const w, h, zn, zf : Single) : PD3DXMatrix; stdcall;
// Build an ortho projection matrix. (left-handed)
function D3DXMatrixOrthoLH(var mOut : TD3DXMatrix; const w, h, zn, zf : Single) : PD3DXMatrix; stdcall;
// Build an ortho projection matrix. (right-handed)
function D3DXMatrixOrthoOffCenterRH(var mOut : TD3DXMatrix; const l, r, b, t, zn, zf : Single) : PD3DXMatrix; stdcall;
// Build an ortho projection matrix. (left-handed)
function D3DXMatrixOrthoOffCenterLH(var mOut : TD3DXMatrix; const l, r, b, t, zn, zf : Single) : PD3DXMatrix; stdcall;
// Build a matrix which flattens geometry into a plane, as if casting a shadow from a light.
function D3DXMatrixShadow(var mOut : TD3DXMatrix; var Light : TD3DXVector4; var Plane : TD3DXPlane) : PD3DXMatrix; stdcall;
// Build a matrix which reflects the coordinate system about a plane
function D3DXMatrixReflect(var mOut : TD3DXMatrix; var Plane : TD3DXPlane) : PD3DXMatrix; stdcall;
//--------------------------
// Quaternion
//--------------------------
// inline
function D3DXQuaternionLength(const q : TD3DXQuaternion) : Single;
// Length squared, or "norm"
function D3DXQuaternionLengthSq(const q : TD3DXQuaternion) : Single;
function D3DXQuaternionDot(const q1, q2 : TD3DXQuaternion) : Single;
// (0, 0, 0, 1)
function D3DXQuaternionIdentity(out qOut : TD3DXQuaternion) : TD3DXQuaternion;
function D3DXQuaternionIsIdentity(const q : TD3DXQuaternion) : BOOL;
// (-x, -y, -z, w)
function D3DXQuaternionConjugate(out qOut : TD3DXQuaternion; const q : TD3DXQuaternion) : TD3DXQuaternion;
// non-inline
// Compute a quaternin's axis and angle of rotation. Expects unit quaternions.
procedure D3DXQuaternionToAxisAngle(var q : TD3DXQuaternion; var Axis : TD3DXVector3; var Angle : Single); stdcall;
// Build a quaternion from a rotation matrix.
function D3DXQuaternionRotationMatrix(var qOut : TD3DXQuaternion; var m : TD3DXMatrix) : PD3DXQuaternion; stdcall;
// Rotation about arbitrary axis.
function D3DXQuaternionRotationAxis(var qOut : TD3DXQuaternion; var v : TD3DXVector3; const Angle: Single) : PD3DXQuaternion; stdcall;
// Yaw around the Y axis, a pitch around the X axis,
// and a roll around the Z axis.
function D3DXQuaternionRotationYawPitchRoll(var qOut : TD3DXQuaternion; const yaw, pitch, roll : Single) : PD3DXQuaternion; stdcall;
// Quaternion multiplication. The result represents the rotation Q2
// followed by the rotation Q1. (Out = Q2 * Q1)
function D3DXQuaternionMultiply(var qOut: TD3DXQuaternion; var q1, q2 : TD3DXQuaternion) : PD3DXQuaternion; stdcall;
function D3DXQuaternionNormalize(var qOut : TD3DXQuaternion; var q : TD3DXQuaternion) : PD3DXQuaternion; stdcall;
// Conjugate and re-norm
function D3DXQuaternionInverse(var qOut : TD3DXQuaternion; var q : TD3DXQuaternion) : PD3DXQuaternion; stdcall;
// Expects unit quaternions.
// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v)
function D3DXQuaternionLn(var qOut : TD3DXQuaternion; var q : TD3DXQuaternion) : PD3DXQuaternion; stdcall;
// Expects pure quaternions. (w == 0) w is ignored in calculation.
// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v)
function D3DXQuaternionExp(var qOut : TD3DXQuaternion; var q : TD3DXQuaternion) : PD3DXQuaternion; stdcall;
// Spherical linear interpolation between Q1 (s == 0) and Q2 (s == 1).
// Expects unit quaternions.
function D3DXQuaternionSlerp(var qOut : TD3DXQuaternion; var q1, q2 : TD3DXQuaternion; const t : Single) : PD3DXQuaternion; stdcall;
// Spherical quadrangle interpolation.
// Slerp(Slerp(Q1, Q4, t), Slerp(Q2, Q3, t), 2t(1-t))
function D3DXQuaternionSquad(var qOut : TD3DXQuaternion; var q1, q2, q3, q4 : TD3DXQuaternion; const t : Single) : PD3DXQuaternion; stdcall;
// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g))
function D3DXQuaternionBaryCentric(var qOut : TD3DXQuaternion; var q1, q2, q3 : TD3DXQuaternion; const f, g : Single) : PD3DXQuaternion; stdcall;
//--------------------------
// Plane
//--------------------------
// inline
// ax + by + cz + dw
function D3DXPlaneDot(const p : TD3DXPlane; const v : TD3DXVector4) : Single;
// ax + by + cz + d
function D3DXPlaneDotCoord(const p : TD3DXPlane; const v : TD3DXVector3) : Single;
// ax + by + cz
function D3DXPlaneDotNormal(const p : TD3DXPlane; const v : TD3DXVector3) : Single;
// non-inline
// Normalize plane (so that |a,b,c| == 1)
function D3DXPlaneNormalize(var pOut : TD3DXPlane; var p : TD3DXPlane) : PD3DXPlane; stdcall;
// Find the intersection between a plane and a line. If the line is parallel to the plane, NULL is returned.
function D3DXPlaneIntersectLine(var vOut : TD3DXVector3; var p : TD3DXPlane; var v1, v2 : TD3DXVector3) : PD3DXVector3; stdcall;
// Construct a plane from a point and a normal
function D3DXPlaneFromPointNormal(var pOut : TD3DXPlane; var vPoint, vNormal : TD3DXVector3) : PD3DXPlane; stdcall;
// Construct a plane from 3 points
function D3DXPlaneFromPoints(var pOut : TD3DXPlane; var v1, v2, v3 : TD3DXVector3) : PD3DXPlane; stdcall;
// Transform a plane by a matrix. The vector (a,b,c) must be normal. M must be an affine transform.
function D3DXPlaneTransform(var pOut : TD3DXPlane; var m : TD3DXMatrix) : PD3DXPlane; stdcall;
//--------------------------
// Color
//--------------------------
// inline
// (1-r, 1-g, 1-b, a)
function D3DXColorNegative(out cOut : TD3DXColor; const c : TD3DXColor) : TD3DXColor;
function D3DXColorAdd(out cOut : TD3DXColor; const c1, c2 : TD3DXColor) : TD3DXColor;
function D3DXColorSubtract(out cOut : TD3DXColor; const c1, c2 : TD3DXColor) : TD3DXColor;
function D3DXColorScale(out cOut : TD3DXColor; const c : TD3DXColor; const s : Single) : TD3DXColor;
// (r1*r2, g1*g2, b1*b2, a1*a2)
function D3DXColorModulate(out cOut : TD3DXColor; const c1, c2 : TD3DXColor) : TD3DXColor;
// Linear interpolation of r,g,b, and a. C1 + s(C2-C1)
function D3DXColorLerp(out cOut : TD3DXColor; const c1, c2 : TD3DXColor; const s : Single) : TD3DXColor;
// non-inline
// Interpolate r,g,b between desaturated color and color. DesaturatedColor + s(Color - DesaturatedColor)
function D3DXColorAdjustSaturation(var cOut : TD3DXColor; var pC : TD3DXColor; const s : Single) : PD3DXColor; stdcall;
// Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey)
function D3DXColorAdjustContrast(var cOut : TD3DXColor; var pC : TD3DXColor; const c : Single) : PD3DXColor; stdcall;
//===========================================================================
//
// Matrix Stack
//
//===========================================================================
type
ID3DXMatrixStack = interface(IUnknown)
['{E3357330-CC5E-11d2-A434-00A0C90629A8}']
//
// ID3DXMatrixStack methods
//
// Pops the top of the stack, returns the current top
// *after* popping the top.
function Pop : HResult; stdcall;
// Pushes the stack by one, duplicating the current matrix.
function Push : HResult; stdcall;
// Loads identity in the current matrix.
function LoadIdentity : HResult; stdcall;
// Loads the given matrix into the current matrix
function LoadMatrix(var M : TD3DXMatrix) : HResult; stdcall;
// Right-Multiplies the given matrix to the current matrix.
// (transformation is about the current world origin)
function MultMatrix(var M : TD3DXMatrix) : HResult; stdcall;
// Left-Multiplies the given matrix to the current matrix
// (transformation is about the local origin of the object)
function MultMatrixLocal(var M : TD3DXMatrix) : HResult; stdcall;
// Right multiply the current matrix with the computed rotation
// matrix, counterclockwise about the given axis with the given angle.
// (rotation is about the current world origin)
function RotateAxis(var V : TD3DXVector3; const Angle : Single) : HResult; stdcall;
// Left multiply the current matrix with the computed rotation
// matrix, counterclockwise about the given axis with the given angle.
// (rotation is about the local origin of the object)
function RotateAxisLocal(var V : TD3DXVector3; const Angle : Single) : HResult; stdcall;
// Right multiply the current matrix with the computed rotation
// matrix. All angles are counterclockwise. (rotation is about the
// current world origin)
// The rotation is composed of a yaw around the Y axis, a pitch around
// the X axis, and a roll around the Z axis.
function RotateYawPitchRoll(const yaw, pitch, roll : Single) : HResult; stdcall;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -