?? d3dx9.pas
字號:
// (0, 0, 0, 1)
function D3DXQuaternionIdentity(out qOut: TD3DXQuaternion): PD3DXQuaternion;
{$EXTERNALSYM D3DXQuaternionIdentity}
function D3DXQuaternionIsIdentity (const q: TD3DXQuaternion): BOOL;
{$EXTERNALSYM D3DXQuaternionIsIdentity}
// (-x, -y, -z, w)
function D3DXQuaternionConjugate(out qOut: TD3DXQuaternion;
const q: TD3DXQuaternion): PD3DXQuaternion;
{$EXTERNALSYM D3DXQuaternionConjugate}
// non-inline
// Compute a quaternin's axis and angle of rotation. Expects unit quaternions.
procedure D3DXQuaternionToAxisAngle(const q: TD3DXQuaternion;
out Axis: TD3DXVector3; out Angle: Single); stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionToAxisAngle}
// Build a quaternion from a rotation matrix.
function D3DXQuaternionRotationMatrix(out qOut: TD3DXQuaternion;
const m: TD3DXMatrix): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionRotationMatrix}
// Rotation about arbitrary axis.
function D3DXQuaternionRotationAxis(out qOut: TD3DXQuaternion;
const v: TD3DXVector3; Angle: Single): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionRotationAxis}
// Yaw around the Y axis, a pitch around the X axis,
// and a roll around the Z axis.
function D3DXQuaternionRotationYawPitchRoll(out qOut: TD3DXQuaternion;
yaw, pitch, roll: Single): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionRotationYawPitchRoll}
// Quaternion multiplication. The result represents the rotation Q2
// followed by the rotation Q1. (Out = Q2 * Q1)
function D3DXQuaternionMultiply(out qOut: TD3DXQuaternion;
const q1, q2: TD3DXQuaternion): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionMultiply}
function D3DXQuaternionNormalize(out qOut: TD3DXQuaternion;
const q: TD3DXQuaternion): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionNormalize}
// Conjugate and re-norm
function D3DXQuaternionInverse(out qOut: TD3DXQuaternion;
const q: TD3DXQuaternion): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionInverse}
// Expects unit quaternions.
// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v)
function D3DXQuaternionLn(out qOut: TD3DXQuaternion;
const q: TD3DXQuaternion): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionLn}
// Expects pure quaternions. (w == 0) w is ignored in calculation.
// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v)
function D3DXQuaternionExp(out qOut: TD3DXQuaternion;
const q: TD3DXQuaternion): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionExp}
// Spherical linear interpolation between Q1 (s == 0) and Q2 (s == 1).
// Expects unit quaternions.
function D3DXQuaternionSlerp(out qOut: TD3DXQuaternion;
const q1, q2: TD3DXQuaternion; t: Single): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionSlerp}
// Spherical quadrangle interpolation.
// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t))
function D3DXQuaternionSquad(out qOut: TD3DXQuaternion;
const pQ1, pA, pB, pC: TD3DXQuaternion; t: Single): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionSquad}
// Setup control points for spherical quadrangle interpolation
// from Q1 to Q2. The control points are chosen in such a way
// to ensure the continuity of tangents with adjacent segments.
procedure D3DXQuaternionSquadSetup(out pAOut, pBOut, pCOut: TD3DXQuaternion;
const pQ0, pQ1, pQ2, pQ3: TD3DXQuaternion); stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionSquadSetup}
// Barycentric interpolation.
// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g))
function D3DXQuaternionBaryCentric(out qOut: TD3DXQuaternion;
const q1, q2, q3: TD3DXQuaternion; f, g: Single): PD3DXQuaternion; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXQuaternionBaryCentric}
//--------------------------
// Plane
//--------------------------
// inline
// ax + by + cz + dw
function D3DXPlaneDot(const p: TD3DXPlane; const v: TD3DXVector4): Single;
{$EXTERNALSYM D3DXPlaneDot}
// ax + by + cz + d
function D3DXPlaneDotCoord(const p: TD3DXPlane; const v: TD3DXVector3): Single;
{$EXTERNALSYM D3DXPlaneDotCoord}
// ax + by + cz
function D3DXPlaneDotNormal(const p: TD3DXPlane; const v: TD3DXVector3): Single;
{$EXTERNALSYM D3DXPlaneDotNormal}
// non-inline
// Normalize plane (so that |a,b,c| == 1)
function D3DXPlaneNormalize(out pOut: TD3DXPlane; const p: TD3DXPlane): PD3DXPlane; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXPlaneNormalize}
// Find the intersection between a plane and a line. If the line is
// parallel to the plane, NULL is returned.
function D3DXPlaneIntersectLine(out vOut: TD3DXVector3;
const p: TD3DXPlane; const v1, v2: TD3DXVector3): PD3DXVector3; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXPlaneIntersectLine}
// Construct a plane from a point and a normal
function D3DXPlaneFromPointNormal(out pOut: TD3DXPlane;
const vPoint, vNormal: TD3DXVector3): PD3DXPlane; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXPlaneFromPointNormal}
// Construct a plane from 3 points
function D3DXPlaneFromPoints(out pOut: TD3DXPlane;
const v1, v2, v3: TD3DXVector3): PD3DXPlane; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXPlaneFromPoints}
// Transform a plane by a matrix. The vector (a,b,c) must be normal.
// M should be the inverse transpose of the transformation desired.
function D3DXPlaneTransform(out pOut: TD3DXPlane; const m: TD3DXMatrix): PD3DXPlane; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXPlaneTransform}
// Transform an array of planes by a matrix. The vectors (a,b,c) must be normal.
// M should be the inverse transpose of the transformation desired.
function D3DXPlaneTransformArray(pOut: PD3DXPlane; OutStride: LongWord;
pP: PD3DXPlane; PStride: LongWord; const m: TD3DXMatrix; n: LongWord): PD3DXPlane; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXPlaneTransformArray}
//--------------------------
// Color
//--------------------------
// inline
// (1-r, 1-g, 1-b, a)
function D3DXColorNegative(out cOut: TD3DXColor; const c: TD3DXColor): PD3DXColor;
{$EXTERNALSYM D3DXColorNegative}
function D3DXColorAdd(out cOut: TD3DXColor; const c1, c2: TD3DXColor): PD3DXColor;
{$EXTERNALSYM D3DXColorAdd}
function D3DXColorSubtract(out cOut: TD3DXColor; const c1, c2: TD3DXColor): PD3DXColor;
{$EXTERNALSYM D3DXColorSubtract}
function D3DXColorScale(out cOut: TD3DXColor; const c: TD3DXColor; s: Single): PD3DXColor;
{$EXTERNALSYM D3DXColorScale}
// (r1*r2, g1*g2, b1*b2, a1*a2)
function D3DXColorModulate(out cOut: TD3DXColor; const c1, c2: TD3DXColor): PD3DXColor;
{$EXTERNALSYM D3DXColorModulate}
// Linear interpolation of r,g,b, and a. C1 + s(C2-C1)
function D3DXColorLerp(out cOut: TD3DXColor; const c1, c2: TD3DXColor; s: Single): PD3DXColor;
{$EXTERNALSYM D3DXColorLerp}
// non-inline
// Interpolate r,g,b between desaturated color and color.
// DesaturatedColor + s(Color - DesaturatedColor)
function D3DXColorAdjustSaturation(out cOut: TD3DXColor;
const pC: TD3DXColor; s: Single): PD3DXColor; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXColorAdjustSaturation}
// Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey)
function D3DXColorAdjustContrast(out cOut: TD3DXColor;
const pC: TD3DXColor; c: Single): PD3DXColor; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXColorAdjustContrast}
//--------------------------
// Misc
//--------------------------
// Calculate Fresnel term given the cosine of theta (likely obtained by
// taking the dot of two normals), and the refraction index of the material.
function D3DXFresnelTerm(CosTheta, RefractionIndex: Single): Single; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXFresnelTerm}
//===========================================================================
//
// Matrix Stack
//
//===========================================================================
type
{$HPPEMIT 'DECLARE_DINTERFACE_TYPE(ID3DXMatrixStack);'}
{$EXTERNALSYM ID3DXMatrixStack}
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(const M: TD3DXMatrix): HResult; stdcall;
// Right-Multiplies the given matrix to the current matrix.
// (transformation is about the current world origin)
function MultMatrix(const M: TD3DXMatrix): HResult; stdcall;
// Left-Multiplies the given matrix to the current matrix
// (transformation is about the local origin of the object)
function MultMatrixLocal(const 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(const V: TD3DXVector3; 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(const V: TD3DXVector3; 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(yaw, pitch, roll: Single): HResult; stdcall;
// Left multiply the current matrix with the computed rotation
// matrix. All angles are counterclockwise. (rotation is about the
// local origin of the object)
// 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 RotateYawPitchRollLocal(yaw, pitch, roll: Single): HResult; stdcall;
// Right multiply the current matrix with the computed scale
// matrix. (transformation is about the current world origin)
function Scale(x, y, z: Single): HResult; stdcall;
// Left multiply the current matrix with the computed scale
// matrix. (transformation is about the local origin of the object)
function ScaleLocal(x, y, z: Single): HResult; stdcall;
// Right multiply the current matrix with the computed translation
// matrix. (transformation is about the current world origin)
function Translate(x, y, z: Single): HResult; stdcall;
// Left multiply the current matrix with the computed translation
// matrix. (transformation is about the local origin of the object)
function TranslateLocal(x, y, z: Single): HResult; stdcall;
// Obtain the current matrix at the top of the stack
function GetTop: PD3DXMatrix; stdcall;
end;
type
IID_ID3DXMatrixStack = ID3DXMatrixStack;
{$EXTERNALSYM IID_ID3DXMatrixStack}
function D3DXCreateMatrixStack(Flags: DWord; out Stack: ID3DXMatrixStack): HResult; stdcall; external d3dx9mathDLL;
{$EXTERNALSYM D3DXCreateMatrixStack}
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx9core.h
// Content: D3DX core types and functions
//
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// D3DX_SDK_VERSION:
// -----------------
// This identifier is passed to D3DXCheckVersion in order to ensure that an
// application was built against the correct header files and lib files.
// This number is incremented whenever a header (or other) change would
// require applications to be rebuilt. If the version doesn't match,
// D3DXCreateVersion will return FALSE. (The number itself has no meaning.)
///////////////////////////////////////////////////////////////////////////
const
D3DX_VERSION = 0900;
{$EXTERNALSYM D3DX_VERSION}
D3DX_SDK_VERSION = 9;
{$EXTERNALSYM D3DX_SDK_VERSION}
function D3DXCheckVersion(D3DSdkVersion, D3DXSdkVersion: LongWord): BOOL; stdcall; external d3dx9coreDLL;
{$EXTERNALSYM D3DXCheckVersion}
///////////////////////////////////////////////////////////////////////////
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -