1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938 |
- /*++
- Copyright (c) Microsoft Corporation. All rights reserved.
- Module Name:
- xnamath.h
- Abstract:
- XNA math library for Windows and Xbox 360
- --*/
- #if defined(_MSC_VER) && (_MSC_VER > 1000)
- #pragma once
- #endif
- #ifndef __XNAMATH_H__
- #define __XNAMATH_H__
- #ifdef __XBOXMATH_H__
- #error XNAMATH and XBOXMATH are incompatible in the same compilation module. Use one or the other.
- #endif
- #define XNAMATH_VERSION 203
- #if !defined(_XM_X64_) && !defined(_XM_X86_)
- #if defined(_M_AMD64) || defined(_AMD64_)
- #define _XM_X64_
- #elif defined(_M_IX86) || defined(_X86_)
- #define _XM_X86_
- #endif
- #endif
- #if !defined(_XM_BIGENDIAN_) && !defined(_XM_LITTLEENDIAN_)
- #if defined(_XM_X64_) || defined(_XM_X86_)
- #define _XM_LITTLEENDIAN_
- #elif defined(_XBOX_VER)
- #define _XM_BIGENDIAN_
- #else
- #error xnamath.h only supports x86, x64, or XBox 360 targets
- #endif
- #endif
- #if defined(_XM_X86_) || defined(_XM_X64_)
- #define _XM_SSE_INTRINSICS_
- #if !defined(__cplusplus) && !defined(_XM_NO_INTRINSICS_)
- #error xnamath.h only supports C compliation for Xbox 360 targets and no intrinsics cases for x86/x64
- #endif
- #elif defined(_XBOX_VER)
- #if !defined(__VMX128_SUPPORTED) && !defined(_XM_NO_INTRINSICS_)
- #error xnamath.h requires VMX128 compiler support for XBOX 360
- #endif // !__VMX128_SUPPORTED && !_XM_NO_INTRINSICS_
- #define _XM_VMX128_INTRINSICS_
- #else
- #error xnamath.h only supports x86, x64, or XBox 360 targets
- #endif
- #if defined(_XM_SSE_INTRINSICS_)
- #ifndef _XM_NO_INTRINSICS_
- #include <xmmintrin.h>
- #include <emmintrin.h>
- #endif
- #elif defined(_XM_VMX128_INTRINSICS_)
- #error This version of xnamath.h is for Windows use only
- #endif
- #if defined(_XM_SSE_INTRINSICS_)
- #pragma warning(push)
- #pragma warning(disable:4985)
- #endif
- #include <math.h>
- #if defined(_XM_SSE_INTRINSICS_)
- #pragma warning(pop)
- #endif
- #include <sal.h>
- #if !defined(XMINLINE)
- #if !defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
- #define XMINLINE __inline
- #else
- #define XMINLINE __forceinline
- #endif
- #endif
- #if !defined(XMFINLINE)
- #define XMFINLINE __forceinline
- #endif
- #if !defined(XMDEBUG)
- #if defined(_DEBUG)
- #define XMDEBUG
- #endif
- #endif // !XMDEBUG
- #if !defined(XMASSERT)
- #if defined(_PREFAST_)
- #define XMASSERT(Expression) __analysis_assume((Expression))
- #elif defined(XMDEBUG) // !_PREFAST_
- #define XMASSERT(Expression) ((VOID)((Expression) || (XMAssert(#Expression, __FILE__, __LINE__), 0)))
- #else // !XMDEBUG
- #define XMASSERT(Expression) ((VOID)0)
- #endif // !XMDEBUG
- #endif // !XMASSERT
- #if !defined(XM_NO_ALIGNMENT)
- #define _DECLSPEC_ALIGN_16_ __declspec(align(16))
- #else
- #define _DECLSPEC_ALIGN_16_
- #endif
- #if defined(_MSC_VER) && (_MSC_VER<1500) && (_MSC_VER>=1400)
- #define _XM_ISVS2005_
- #endif
- /****************************************************************************
- *
- * Constant definitions
- *
- ****************************************************************************/
- #define XM_PI 3.141592654f
- #define XM_2PI 6.283185307f
- #define XM_1DIVPI 0.318309886f
- #define XM_1DIV2PI 0.159154943f
- #define XM_PIDIV2 1.570796327f
- #define XM_PIDIV4 0.785398163f
- #define XM_SELECT_0 0x00000000
- #define XM_SELECT_1 0xFFFFFFFF
- #define XM_PERMUTE_0X 0x00010203
- #define XM_PERMUTE_0Y 0x04050607
- #define XM_PERMUTE_0Z 0x08090A0B
- #define XM_PERMUTE_0W 0x0C0D0E0F
- #define XM_PERMUTE_1X 0x10111213
- #define XM_PERMUTE_1Y 0x14151617
- #define XM_PERMUTE_1Z 0x18191A1B
- #define XM_PERMUTE_1W 0x1C1D1E1F
- #define XM_CRMASK_CR6 0x000000F0
- #define XM_CRMASK_CR6TRUE 0x00000080
- #define XM_CRMASK_CR6FALSE 0x00000020
- #define XM_CRMASK_CR6BOUNDS XM_CRMASK_CR6FALSE
- #define XM_CACHE_LINE_SIZE 64
- /****************************************************************************
- *
- * Macros
- *
- ****************************************************************************/
- // Unit conversion
- XMFINLINE FLOAT XMConvertToRadians(FLOAT fDegrees) { return fDegrees * (XM_PI / 180.0f); }
- XMFINLINE FLOAT XMConvertToDegrees(FLOAT fRadians) { return fRadians * (180.0f / XM_PI); }
- // Condition register evaluation proceeding a recording (Rc) comparison
- #define XMComparisonAllTrue(CR) (((CR) & XM_CRMASK_CR6TRUE) == XM_CRMASK_CR6TRUE)
- #define XMComparisonAnyTrue(CR) (((CR) & XM_CRMASK_CR6FALSE) != XM_CRMASK_CR6FALSE)
- #define XMComparisonAllFalse(CR) (((CR) & XM_CRMASK_CR6FALSE) == XM_CRMASK_CR6FALSE)
- #define XMComparisonAnyFalse(CR) (((CR) & XM_CRMASK_CR6TRUE) != XM_CRMASK_CR6TRUE)
- #define XMComparisonMixed(CR) (((CR) & XM_CRMASK_CR6) == 0)
- #define XMComparisonAllInBounds(CR) (((CR) & XM_CRMASK_CR6BOUNDS) == XM_CRMASK_CR6BOUNDS)
- #define XMComparisonAnyOutOfBounds(CR) (((CR) & XM_CRMASK_CR6BOUNDS) != XM_CRMASK_CR6BOUNDS)
- #define XMMin(a, b) (((a) < (b)) ? (a) : (b))
- #define XMMax(a, b) (((a) > (b)) ? (a) : (b))
- /****************************************************************************
- *
- * Data types
- *
- ****************************************************************************/
- #pragma warning(push)
- #pragma warning(disable:4201 4365 4324)
- #if !defined (_XM_X86_) && !defined(_XM_X64_)
- #pragma bitfield_order(push)
- #pragma bitfield_order(lsb_to_msb)
- #endif // !_XM_X86_ && !_XM_X64_
- #if defined(_XM_NO_INTRINSICS_) && !defined(_XBOX_VER)
- // The __vector4 structure is an intrinsic on Xbox but must be separately defined
- // for x86/x64
- typedef struct __vector4
- {
- union
- {
- float vector4_f32[4];
- unsigned int vector4_u32[4];
- #ifndef XM_STRICT_VECTOR4
- struct
- {
- FLOAT x;
- FLOAT y;
- FLOAT z;
- FLOAT w;
- };
- FLOAT v[4];
- UINT u[4];
- #endif // !XM_STRICT_VECTOR4
- };
- } __vector4;
- #endif // _XM_NO_INTRINSICS_
- #if (defined (_XM_X86_) || defined(_XM_X64_)) && defined(_XM_NO_INTRINSICS_)
- typedef UINT __vector4i[4];
- #else
- typedef __declspec(align(16)) UINT __vector4i[4];
- #endif
- // Vector intrinsic: Four 32 bit floating point components aligned on a 16 byte
- // boundary and mapped to hardware vector registers
- #if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- typedef __m128 XMVECTOR;
- #else
- typedef __vector4 XMVECTOR;
- #endif
- // Conversion types for constants
- typedef _DECLSPEC_ALIGN_16_ struct XMVECTORF32 {
- union {
- float f[4];
- XMVECTOR v;
- };
- #if defined(__cplusplus)
- inline operator XMVECTOR() const { return v; }
- #if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_)
- inline operator __m128i() const { return reinterpret_cast<const __m128i *>(&v)[0]; }
- inline operator __m128d() const { return reinterpret_cast<const __m128d *>(&v)[0]; }
- #endif
- #endif // __cplusplus
- } XMVECTORF32;
- typedef _DECLSPEC_ALIGN_16_ struct XMVECTORI32 {
- union {
- INT i[4];
- XMVECTOR v;
- };
- #if defined(__cplusplus)
- inline operator XMVECTOR() const { return v; }
- #if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_)
- inline operator __m128i() const { return reinterpret_cast<const __m128i *>(&v)[0]; }
- inline operator __m128d() const { return reinterpret_cast<const __m128d *>(&v)[0]; }
- #endif
- #endif // __cplusplus
- } XMVECTORI32;
- typedef _DECLSPEC_ALIGN_16_ struct XMVECTORU8 {
- union {
- BYTE u[16];
- XMVECTOR v;
- };
- #if defined(__cplusplus)
- inline operator XMVECTOR() const { return v; }
- #if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_)
- inline operator __m128i() const { return reinterpret_cast<const __m128i *>(&v)[0]; }
- inline operator __m128d() const { return reinterpret_cast<const __m128d *>(&v)[0]; }
- #endif
- #endif // __cplusplus
- } XMVECTORU8;
- typedef _DECLSPEC_ALIGN_16_ struct XMVECTORU32 {
- union {
- UINT u[4];
- XMVECTOR v;
- };
- #if defined(__cplusplus)
- inline operator XMVECTOR() const { return v; }
- #if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_)
- inline operator __m128i() const { return reinterpret_cast<const __m128i *>(&v)[0]; }
- inline operator __m128d() const { return reinterpret_cast<const __m128d *>(&v)[0]; }
- #endif
- #endif // __cplusplus
- } XMVECTORU32;
- // Fix-up for (1st-3rd) XMVECTOR parameters that are pass-in-register for x86 and Xbox 360, but not for other targets
- #if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- typedef const XMVECTOR FXMVECTOR;
- #elif defined(_XM_X86_) && !defined(_XM_NO_INTRINSICS_)
- typedef const XMVECTOR FXMVECTOR;
- #elif defined(__cplusplus)
- typedef const XMVECTOR& FXMVECTOR;
- #else
- typedef const XMVECTOR FXMVECTOR;
- #endif
- // Fix-up for (4th+) XMVECTOR parameters to pass in-register for Xbox 360 and by reference otherwise
- #if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- typedef const XMVECTOR CXMVECTOR;
- #elif defined(__cplusplus)
- typedef const XMVECTOR& CXMVECTOR;
- #else
- typedef const XMVECTOR CXMVECTOR;
- #endif
- // Vector operators
- #if defined(__cplusplus) && !defined(XM_NO_OPERATOR_OVERLOADS)
- XMVECTOR operator+ (FXMVECTOR V);
- XMVECTOR operator- (FXMVECTOR V);
- XMVECTOR& operator+= (XMVECTOR& V1, FXMVECTOR V2);
- XMVECTOR& operator-= (XMVECTOR& V1, FXMVECTOR V2);
- XMVECTOR& operator*= (XMVECTOR& V1, FXMVECTOR V2);
- XMVECTOR& operator/= (XMVECTOR& V1, FXMVECTOR V2);
- XMVECTOR& operator*= (XMVECTOR& V, FLOAT S);
- XMVECTOR& operator/= (XMVECTOR& V, FLOAT S);
- XMVECTOR operator+ (FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR operator- (FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR operator* (FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR operator/ (FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR operator* (FXMVECTOR V, FLOAT S);
- XMVECTOR operator* (FLOAT S, FXMVECTOR V);
- XMVECTOR operator/ (FXMVECTOR V, FLOAT S);
- #endif // __cplusplus && !XM_NO_OPERATOR_OVERLOADS
- // Matrix type: Sixteen 32 bit floating point components aligned on a
- // 16 byte boundary and mapped to four hardware vector registers
- #if (defined(_XM_X86_) || defined(_XM_X64_)) && defined(_XM_NO_INTRINSICS_)
- typedef struct _XMMATRIX
- #else
- typedef _DECLSPEC_ALIGN_16_ struct _XMMATRIX
- #endif
- {
- union
- {
- XMVECTOR r[4];
- struct
- {
- FLOAT _11, _12, _13, _14;
- FLOAT _21, _22, _23, _24;
- FLOAT _31, _32, _33, _34;
- FLOAT _41, _42, _43, _44;
- };
- FLOAT m[4][4];
- };
- #ifdef __cplusplus
- _XMMATRIX() {};
- _XMMATRIX(FXMVECTOR R0, FXMVECTOR R1, FXMVECTOR R2, CXMVECTOR R3);
- _XMMATRIX(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33);
- _XMMATRIX(CONST FLOAT *pArray);
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
- _XMMATRIX& operator= (CONST _XMMATRIX& M);
- #ifndef XM_NO_OPERATOR_OVERLOADS
- _XMMATRIX& operator*= (CONST _XMMATRIX& M);
- _XMMATRIX operator* (CONST _XMMATRIX& M) CONST;
- #endif // !XM_NO_OPERATOR_OVERLOADS
- #endif // __cplusplus
- } XMMATRIX;
- // Fix-up for XMMATRIX parameters to pass in-register on Xbox 360, by reference otherwise
- #if defined(_XM_VMX128_INTRINSICS_)
- typedef const XMMATRIX CXMMATRIX;
- #elif defined(__cplusplus)
- typedef const XMMATRIX& CXMMATRIX;
- #else
- typedef const XMMATRIX CXMMATRIX;
- #endif
- // 16 bit floating point number consisting of a sign bit, a 5 bit biased
- // exponent, and a 10 bit mantissa
- //typedef WORD HALF;
- typedef USHORT HALF;
- // 2D Vector; 32 bit floating point components
- typedef struct _XMFLOAT2
- {
- FLOAT x;
- FLOAT y;
- #ifdef __cplusplus
- _XMFLOAT2() {};
- _XMFLOAT2(FLOAT _x, FLOAT _y) : x(_x), y(_y) {};
- _XMFLOAT2(CONST FLOAT *pArray);
- _XMFLOAT2& operator= (CONST _XMFLOAT2& Float2);
- #endif // __cplusplus
- } XMFLOAT2;
- // 2D Vector; 32 bit floating point components aligned on a 16 byte boundary
- #ifdef __cplusplus
- __declspec(align(16)) struct XMFLOAT2A : public XMFLOAT2
- {
- XMFLOAT2A() : XMFLOAT2() {};
- XMFLOAT2A(FLOAT _x, FLOAT _y) : XMFLOAT2(_x, _y) {};
- XMFLOAT2A(CONST FLOAT *pArray) : XMFLOAT2(pArray) {};
- XMFLOAT2A& operator= (CONST XMFLOAT2A& Float2);
- };
- #else
- typedef __declspec(align(16)) XMFLOAT2 XMFLOAT2A;
- #endif // __cplusplus
- // 2D Vector; 16 bit floating point components
- typedef struct _XMHALF2
- {
- HALF x;
- HALF y;
- #ifdef __cplusplus
- _XMHALF2() {};
- _XMHALF2(HALF _x, HALF _y) : x(_x), y(_y) {};
- _XMHALF2(CONST HALF *pArray);
- _XMHALF2(FLOAT _x, FLOAT _y);
- _XMHALF2(CONST FLOAT *pArray);
- _XMHALF2& operator= (CONST _XMHALF2& Half2);
- #endif // __cplusplus
- } XMHALF2;
- // 2D Vector; 16 bit signed normalized integer components
- typedef struct _XMSHORTN2
- {
- SHORT x;
- SHORT y;
- #ifdef __cplusplus
- _XMSHORTN2() {};
- _XMSHORTN2(SHORT _x, SHORT _y) : x(_x), y(_y) {};
- _XMSHORTN2(CONST SHORT *pArray);
- _XMSHORTN2(FLOAT _x, FLOAT _y);
- _XMSHORTN2(CONST FLOAT *pArray);
- _XMSHORTN2& operator= (CONST _XMSHORTN2& ShortN2);
- #endif // __cplusplus
- } XMSHORTN2;
- // 2D Vector; 16 bit signed integer components
- typedef struct _XMSHORT2
- {
- SHORT x;
- SHORT y;
- #ifdef __cplusplus
- _XMSHORT2() {};
- _XMSHORT2(SHORT _x, SHORT _y) : x(_x), y(_y) {};
- _XMSHORT2(CONST SHORT *pArray);
- _XMSHORT2(FLOAT _x, FLOAT _y);
- _XMSHORT2(CONST FLOAT *pArray);
- _XMSHORT2& operator= (CONST _XMSHORT2& Short2);
- #endif // __cplusplus
- } XMSHORT2;
- // 2D Vector; 16 bit unsigned normalized integer components
- typedef struct _XMUSHORTN2
- {
- USHORT x;
- USHORT y;
- #ifdef __cplusplus
- _XMUSHORTN2() {};
- _XMUSHORTN2(USHORT _x, USHORT _y) : x(_x), y(_y) {};
- _XMUSHORTN2(CONST USHORT *pArray);
- _XMUSHORTN2(FLOAT _x, FLOAT _y);
- _XMUSHORTN2(CONST FLOAT *pArray);
- _XMUSHORTN2& operator= (CONST _XMUSHORTN2& UShortN2);
- #endif // __cplusplus
- } XMUSHORTN2;
- // 2D Vector; 16 bit unsigned integer components
- typedef struct _XMUSHORT2
- {
- USHORT x;
- USHORT y;
- #ifdef __cplusplus
- _XMUSHORT2() {};
- _XMUSHORT2(USHORT _x, USHORT _y) : x(_x), y(_y) {};
- _XMUSHORT2(CONST USHORT *pArray);
- _XMUSHORT2(FLOAT _x, FLOAT _y);
- _XMUSHORT2(CONST FLOAT *pArray);
- _XMUSHORT2& operator= (CONST _XMUSHORT2& UShort2);
- #endif // __cplusplus
- } XMUSHORT2;
- // 3D Vector; 32 bit floating point components
- typedef struct _XMFLOAT3
- {
- FLOAT x;
- FLOAT y;
- FLOAT z;
- #ifdef __cplusplus
- _XMFLOAT3() {};
- _XMFLOAT3(FLOAT _x, FLOAT _y, FLOAT _z) : x(_x), y(_y), z(_z) {};
- _XMFLOAT3(CONST FLOAT *pArray);
- _XMFLOAT3& operator= (CONST _XMFLOAT3& Float3);
- #endif // __cplusplus
- } XMFLOAT3;
- // 3D Vector; 32 bit floating point components aligned on a 16 byte boundary
- #ifdef __cplusplus
- __declspec(align(16)) struct XMFLOAT3A : public XMFLOAT3
- {
- XMFLOAT3A() : XMFLOAT3() {};
- XMFLOAT3A(FLOAT _x, FLOAT _y, FLOAT _z) : XMFLOAT3(_x, _y, _z) {};
- XMFLOAT3A(CONST FLOAT *pArray) : XMFLOAT3(pArray) {};
- XMFLOAT3A& operator= (CONST XMFLOAT3A& Float3);
- };
- #else
- typedef __declspec(align(16)) XMFLOAT3 XMFLOAT3A;
- #endif // __cplusplus
- // 3D Vector; 11-11-10 bit normalized components packed into a 32 bit integer
- // The normalized 3D Vector is packed into 32 bits as follows: a 10 bit signed,
- // normalized integer for the z component and 11 bit signed, normalized
- // integers for the x and y components. The z component is stored in the
- // most significant bits and the x component in the least significant bits
- // (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0]
- typedef struct _XMHENDN3
- {
- union
- {
- struct
- {
- INT x : 11; // -1023/1023 to 1023/1023
- INT y : 11; // -1023/1023 to 1023/1023
- INT z : 10; // -511/511 to 511/511
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMHENDN3() {};
- _XMHENDN3(UINT Packed) : v(Packed) {};
- _XMHENDN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMHENDN3(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMHENDN3& operator= (CONST _XMHENDN3& HenDN3);
- _XMHENDN3& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMHENDN3;
- // 3D Vector; 11-11-10 bit components packed into a 32 bit integer
- // The 3D Vector is packed into 32 bits as follows: a 10 bit signed,
- // integer for the z component and 11 bit signed integers for the
- // x and y components. The z component is stored in the
- // most significant bits and the x component in the least significant bits
- // (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0]
- typedef struct _XMHEND3
- {
- union
- {
- struct
- {
- INT x : 11; // -1023 to 1023
- INT y : 11; // -1023 to 1023
- INT z : 10; // -511 to 511
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMHEND3() {};
- _XMHEND3(UINT Packed) : v(Packed) {};
- _XMHEND3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMHEND3(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMHEND3& operator= (CONST _XMHEND3& HenD3);
- _XMHEND3& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMHEND3;
- // 3D Vector; 11-11-10 bit normalized components packed into a 32 bit integer
- // The normalized 3D Vector is packed into 32 bits as follows: a 10 bit unsigned,
- // normalized integer for the z component and 11 bit unsigned, normalized
- // integers for the x and y components. The z component is stored in the
- // most significant bits and the x component in the least significant bits
- // (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0]
- typedef struct _XMUHENDN3
- {
- union
- {
- struct
- {
- UINT x : 11; // 0/2047 to 2047/2047
- UINT y : 11; // 0/2047 to 2047/2047
- UINT z : 10; // 0/1023 to 1023/1023
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMUHENDN3() {};
- _XMUHENDN3(UINT Packed) : v(Packed) {};
- _XMUHENDN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMUHENDN3(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMUHENDN3& operator= (CONST _XMUHENDN3& UHenDN3);
- _XMUHENDN3& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMUHENDN3;
- // 3D Vector; 11-11-10 bit components packed into a 32 bit integer
- // The 3D Vector is packed into 32 bits as follows: a 10 bit unsigned
- // integer for the z component and 11 bit unsigned integers
- // for the x and y components. The z component is stored in the
- // most significant bits and the x component in the least significant bits
- // (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0]
- typedef struct _XMUHEND3
- {
- union
- {
- struct
- {
- UINT x : 11; // 0 to 2047
- UINT y : 11; // 0 to 2047
- UINT z : 10; // 0 to 1023
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMUHEND3() {};
- _XMUHEND3(UINT Packed) : v(Packed) {};
- _XMUHEND3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMUHEND3(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMUHEND3& operator= (CONST _XMUHEND3& UHenD3);
- _XMUHEND3& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMUHEND3;
- // 3D Vector; 10-11-11 bit normalized components packed into a 32 bit integer
- // The normalized 3D Vector is packed into 32 bits as follows: a 10 bit signed,
- // normalized integer for the x component and 11 bit signed, normalized
- // integers for the y and z components. The z component is stored in the
- // most significant bits and the x component in the least significant bits
- // (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0]
- typedef struct _XMDHENN3
- {
- union
- {
- struct
- {
- INT x : 10; // -511/511 to 511/511
- INT y : 11; // -1023/1023 to 1023/1023
- INT z : 11; // -1023/1023 to 1023/1023
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMDHENN3() {};
- _XMDHENN3(UINT Packed) : v(Packed) {};
- _XMDHENN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMDHENN3(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMDHENN3& operator= (CONST _XMDHENN3& DHenN3);
- _XMDHENN3& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMDHENN3;
- // 3D Vector; 10-11-11 bit components packed into a 32 bit integer
- // The 3D Vector is packed into 32 bits as follows: a 10 bit signed,
- // integer for the x component and 11 bit signed integers for the
- // y and z components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0]
- typedef struct _XMDHEN3
- {
- union
- {
- struct
- {
- INT x : 10; // -511 to 511
- INT y : 11; // -1023 to 1023
- INT z : 11; // -1023 to 1023
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMDHEN3() {};
- _XMDHEN3(UINT Packed) : v(Packed) {};
- _XMDHEN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMDHEN3(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMDHEN3& operator= (CONST _XMDHEN3& DHen3);
- _XMDHEN3& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMDHEN3;
- // 3D Vector; 10-11-11 bit normalized components packed into a 32 bit integer
- // The normalized 3D Vector is packed into 32 bits as follows: a 10 bit unsigned,
- // normalized integer for the x component and 11 bit unsigned, normalized
- // integers for the y and z components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0]
- typedef struct _XMUDHENN3
- {
- union
- {
- struct
- {
- UINT x : 10; // 0/1023 to 1023/1023
- UINT y : 11; // 0/2047 to 2047/2047
- UINT z : 11; // 0/2047 to 2047/2047
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMUDHENN3() {};
- _XMUDHENN3(UINT Packed) : v(Packed) {};
- _XMUDHENN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMUDHENN3(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMUDHENN3& operator= (CONST _XMUDHENN3& UDHenN3);
- _XMUDHENN3& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMUDHENN3;
- // 3D Vector; 10-11-11 bit components packed into a 32 bit integer
- // The 3D Vector is packed into 32 bits as follows: a 10 bit unsigned,
- // integer for the x component and 11 bit unsigned integers
- // for the y and z components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0]
- typedef struct _XMUDHEN3
- {
- union
- {
- struct
- {
- UINT x : 10; // 0 to 1023
- UINT y : 11; // 0 to 2047
- UINT z : 11; // 0 to 2047
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMUDHEN3() {};
- _XMUDHEN3(UINT Packed) : v(Packed) {};
- _XMUDHEN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMUDHEN3(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMUDHEN3& operator= (CONST _XMUDHEN3& UDHen3);
- _XMUDHEN3& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMUDHEN3;
- // 3D vector: 5/6/5 unsigned integer components
- typedef struct _XMU565
- {
- union
- {
- struct
- {
- USHORT x : 5;
- USHORT y : 6;
- USHORT z : 5;
- };
- USHORT v;
- };
- #ifdef __cplusplus
- _XMU565() {};
- _XMU565(USHORT Packed) : v(Packed) {};
- _XMU565(CHAR _x, CHAR _y, CHAR _z) : x(_x), y(_y), z(_z) {};
- _XMU565(CONST CHAR *pArray);
- _XMU565(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMU565(CONST FLOAT *pArray);
- operator USHORT () { return v; }
- _XMU565& operator= (CONST _XMU565& U565);
- _XMU565& operator= (CONST USHORT Packed);
- #endif // __cplusplus
- } XMU565;
- // 3D vector: 11/11/10 floating-point components
- // The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent
- // and 6-bit mantissa for x component, a 5-bit biased exponent and
- // 6-bit mantissa for y component, a 5-bit biased exponent and a 5-bit
- // mantissa for z. The z component is stored in the most significant bits
- // and the x component in the least significant bits. No sign bits so
- // all partial-precision numbers are positive.
- // (Z10Y11X11): [32] ZZZZZzzz zzzYYYYY yyyyyyXX XXXxxxxx [0]
- typedef struct _XMFLOAT3PK
- {
- union
- {
- struct
- {
- UINT xm : 6;
- UINT xe : 5;
- UINT ym : 6;
- UINT ye : 5;
- UINT zm : 5;
- UINT ze : 5;
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMFLOAT3PK() {};
- _XMFLOAT3PK(UINT Packed) : v(Packed) {};
- _XMFLOAT3PK(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMFLOAT3PK(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMFLOAT3PK& operator= (CONST _XMFLOAT3PK& float3pk);
- _XMFLOAT3PK& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMFLOAT3PK;
- // 3D vector: 9/9/9 floating-point components with shared 5-bit exponent
- // The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent
- // with 9-bit mantissa for the x, y, and z component. The shared exponent
- // is stored in the most significant bits and the x component mantissa is in
- // the least significant bits. No sign bits so all partial-precision numbers
- // are positive.
- // (E5Z9Y9X9): [32] EEEEEzzz zzzzzzyy yyyyyyyx xxxxxxxx [0]
- typedef struct _XMFLOAT3SE
- {
- union
- {
- struct
- {
- UINT xm : 9;
- UINT ym : 9;
- UINT zm : 9;
- UINT e : 5;
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMFLOAT3SE() {};
- _XMFLOAT3SE(UINT Packed) : v(Packed) {};
- _XMFLOAT3SE(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMFLOAT3SE(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMFLOAT3SE& operator= (CONST _XMFLOAT3SE& float3se);
- _XMFLOAT3SE& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMFLOAT3SE;
- // 4D Vector; 32 bit floating point components
- typedef struct _XMFLOAT4
- {
- FLOAT x;
- FLOAT y;
- FLOAT z;
- FLOAT w;
- #ifdef __cplusplus
- _XMFLOAT4() {};
- _XMFLOAT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMFLOAT4(CONST FLOAT *pArray);
- _XMFLOAT4& operator= (CONST _XMFLOAT4& Float4);
- #endif // __cplusplus
- } XMFLOAT4;
- // 4D Vector; 32 bit floating point components aligned on a 16 byte boundary
- #ifdef __cplusplus
- __declspec(align(16)) struct XMFLOAT4A : public XMFLOAT4
- {
- XMFLOAT4A() : XMFLOAT4() {};
- XMFLOAT4A(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w) : XMFLOAT4(_x, _y, _z, _w) {};
- XMFLOAT4A(CONST FLOAT *pArray) : XMFLOAT4(pArray) {};
- XMFLOAT4A& operator= (CONST XMFLOAT4A& Float4);
- };
- #else
- typedef __declspec(align(16)) XMFLOAT4 XMFLOAT4A;
- #endif // __cplusplus
- // 4D Vector; 16 bit floating point components
- typedef struct _XMHALF4
- {
- HALF x;
- HALF y;
- HALF z;
- HALF w;
- #ifdef __cplusplus
- _XMHALF4() {};
- _XMHALF4(HALF _x, HALF _y, HALF _z, HALF _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMHALF4(CONST HALF *pArray);
- _XMHALF4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMHALF4(CONST FLOAT *pArray);
- _XMHALF4& operator= (CONST _XMHALF4& Half4);
- #endif // __cplusplus
- } XMHALF4;
- // 4D Vector; 16 bit signed normalized integer components
- typedef struct _XMSHORTN4
- {
- SHORT x;
- SHORT y;
- SHORT z;
- SHORT w;
- #ifdef __cplusplus
- _XMSHORTN4() {};
- _XMSHORTN4(SHORT _x, SHORT _y, SHORT _z, SHORT _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMSHORTN4(CONST SHORT *pArray);
- _XMSHORTN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMSHORTN4(CONST FLOAT *pArray);
- _XMSHORTN4& operator= (CONST _XMSHORTN4& ShortN4);
- #endif // __cplusplus
- } XMSHORTN4;
- // 4D Vector; 16 bit signed integer components
- typedef struct _XMSHORT4
- {
- SHORT x;
- SHORT y;
- SHORT z;
- SHORT w;
- #ifdef __cplusplus
- _XMSHORT4() {};
- _XMSHORT4(SHORT _x, SHORT _y, SHORT _z, SHORT _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMSHORT4(CONST SHORT *pArray);
- _XMSHORT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMSHORT4(CONST FLOAT *pArray);
- _XMSHORT4& operator= (CONST _XMSHORT4& Short4);
- #endif // __cplusplus
- } XMSHORT4;
- // 4D Vector; 16 bit unsigned normalized integer components
- typedef struct _XMUSHORTN4
- {
- USHORT x;
- USHORT y;
- USHORT z;
- USHORT w;
- #ifdef __cplusplus
- _XMUSHORTN4() {};
- _XMUSHORTN4(USHORT _x, USHORT _y, USHORT _z, USHORT _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMUSHORTN4(CONST USHORT *pArray);
- _XMUSHORTN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUSHORTN4(CONST FLOAT *pArray);
- _XMUSHORTN4& operator= (CONST _XMUSHORTN4& UShortN4);
- #endif // __cplusplus
- } XMUSHORTN4;
- // 4D Vector; 16 bit unsigned integer components
- typedef struct _XMUSHORT4
- {
- USHORT x;
- USHORT y;
- USHORT z;
- USHORT w;
- #ifdef __cplusplus
- _XMUSHORT4() {};
- _XMUSHORT4(USHORT _x, USHORT _y, USHORT _z, USHORT _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMUSHORT4(CONST USHORT *pArray);
- _XMUSHORT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUSHORT4(CONST FLOAT *pArray);
- _XMUSHORT4& operator= (CONST _XMUSHORT4& UShort4);
- #endif // __cplusplus
- } XMUSHORT4;
- // 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer
- // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned,
- // normalized integer for the w component and 10 bit signed, normalized
- // integers for the z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
- typedef struct _XMXDECN4
- {
- union
- {
- struct
- {
- INT x : 10; // -511/511 to 511/511
- INT y : 10; // -511/511 to 511/511
- INT z : 10; // -511/511 to 511/511
- UINT w : 2; // 0/3 to 3/3
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMXDECN4() {};
- _XMXDECN4(UINT Packed) : v(Packed) {};
- _XMXDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMXDECN4(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMXDECN4& operator= (CONST _XMXDECN4& XDecN4);
- _XMXDECN4& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMXDECN4;
- // 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer
- // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned
- // integer for the w component and 10 bit signed integers for the
- // z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
- typedef struct _XMXDEC4
- {
- union
- {
- struct
- {
- INT x : 10; // -511 to 511
- INT y : 10; // -511 to 511
- INT z : 10; // -511 to 511
- UINT w : 2; // 0 to 3
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMXDEC4() {};
- _XMXDEC4(UINT Packed) : v(Packed) {};
- _XMXDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMXDEC4(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMXDEC4& operator= (CONST _XMXDEC4& XDec4);
- _XMXDEC4& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMXDEC4;
- // 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer
- // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit signed,
- // normalized integer for the w component and 10 bit signed, normalized
- // integers for the z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
- typedef struct _XMDECN4
- {
- union
- {
- struct
- {
- INT x : 10; // -511/511 to 511/511
- INT y : 10; // -511/511 to 511/511
- INT z : 10; // -511/511 to 511/511
- INT w : 2; // -1/1 to 1/1
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMDECN4() {};
- _XMDECN4(UINT Packed) : v(Packed) {};
- _XMDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMDECN4(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMDECN4& operator= (CONST _XMDECN4& DecN4);
- _XMDECN4& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMDECN4;
- // 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer
- // The 4D Vector is packed into 32 bits as follows: a 2 bit signed,
- // integer for the w component and 10 bit signed integers for the
- // z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
- typedef struct _XMDEC4
- {
- union
- {
- struct
- {
- INT x : 10; // -511 to 511
- INT y : 10; // -511 to 511
- INT z : 10; // -511 to 511
- INT w : 2; // -1 to 1
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMDEC4() {};
- _XMDEC4(UINT Packed) : v(Packed) {};
- _XMDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMDEC4(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMDEC4& operator= (CONST _XMDEC4& Dec4);
- _XMDEC4& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMDEC4;
- // 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer
- // The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned,
- // normalized integer for the w component and 10 bit unsigned, normalized
- // integers for the z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
- typedef struct _XMUDECN4
- {
- union
- {
- struct
- {
- UINT x : 10; // 0/1023 to 1023/1023
- UINT y : 10; // 0/1023 to 1023/1023
- UINT z : 10; // 0/1023 to 1023/1023
- UINT w : 2; // 0/3 to 3/3
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMUDECN4() {};
- _XMUDECN4(UINT Packed) : v(Packed) {};
- _XMUDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUDECN4(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMUDECN4& operator= (CONST _XMUDECN4& UDecN4);
- _XMUDECN4& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMUDECN4;
- // 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer
- // The 4D Vector is packed into 32 bits as follows: a 2 bit unsigned,
- // integer for the w component and 10 bit unsigned integers
- // for the z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
- typedef struct _XMUDEC4
- {
- union
- {
- struct
- {
- UINT x : 10; // 0 to 1023
- UINT y : 10; // 0 to 1023
- UINT z : 10; // 0 to 1023
- UINT w : 2; // 0 to 3
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMUDEC4() {};
- _XMUDEC4(UINT Packed) : v(Packed) {};
- _XMUDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUDEC4(CONST FLOAT *pArray);
- operator UINT () { return v; }
- _XMUDEC4& operator= (CONST _XMUDEC4& UDec4);
- _XMUDEC4& operator= (CONST UINT Packed);
- #endif // __cplusplus
- } XMUDEC4;
- // 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer
- // The normalized 4D Vector is packed into 64 bits as follows: a 4 bit unsigned,
- // normalized integer for the w component and 20 bit signed, normalized
- // integers for the z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
- typedef struct _XMXICON4
- {
- union
- {
- struct
- {
- INT64 x : 20; // -524287/524287 to 524287/524287
- INT64 y : 20; // -524287/524287 to 524287/524287
- INT64 z : 20; // -524287/524287 to 524287/524287
- UINT64 w : 4; // 0/15 to 15/15
- };
- UINT64 v;
- };
- #ifdef __cplusplus
- _XMXICON4() {};
- _XMXICON4(UINT64 Packed) : v(Packed) {};
- _XMXICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMXICON4(CONST FLOAT *pArray);
- operator UINT64 () { return v; }
- _XMXICON4& operator= (CONST _XMXICON4& XIcoN4);
- _XMXICON4& operator= (CONST UINT64 Packed);
- #endif // __cplusplus
- } XMXICON4;
- // 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer
- // The 4D Vector is packed into 64 bits as follows: a 4 bit unsigned
- // integer for the w component and 20 bit signed integers for the
- // z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
- typedef struct _XMXICO4
- {
- union
- {
- struct
- {
- INT64 x : 20; // -524287 to 524287
- INT64 y : 20; // -524287 to 524287
- INT64 z : 20; // -524287 to 524287
- UINT64 w : 4; // 0 to 15
- };
- UINT64 v;
- };
- #ifdef __cplusplus
- _XMXICO4() {};
- _XMXICO4(UINT64 Packed) : v(Packed) {};
- _XMXICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMXICO4(CONST FLOAT *pArray);
- operator UINT64 () { return v; }
- _XMXICO4& operator= (CONST _XMXICO4& XIco4);
- _XMXICO4& operator= (CONST UINT64 Packed);
- #endif // __cplusplus
- } XMXICO4;
- // 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer
- // The normalized 4D Vector is packed into 64 bits as follows: a 4 bit signed,
- // normalized integer for the w component and 20 bit signed, normalized
- // integers for the z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
- typedef struct _XMICON4
- {
- union
- {
- struct
- {
- INT64 x : 20; // -524287/524287 to 524287/524287
- INT64 y : 20; // -524287/524287 to 524287/524287
- INT64 z : 20; // -524287/524287 to 524287/524287
- INT64 w : 4; // -7/7 to 7/7
- };
- UINT64 v;
- };
- #ifdef __cplusplus
- _XMICON4() {};
- _XMICON4(UINT64 Packed) : v(Packed) {};
- _XMICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMICON4(CONST FLOAT *pArray);
- operator UINT64 () { return v; }
- _XMICON4& operator= (CONST _XMICON4& IcoN4);
- _XMICON4& operator= (CONST UINT64 Packed);
- #endif // __cplusplus
- } XMICON4;
- // 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer
- // The 4D Vector is packed into 64 bits as follows: a 4 bit signed,
- // integer for the w component and 20 bit signed integers for the
- // z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
- typedef struct _XMICO4
- {
- union
- {
- struct
- {
- INT64 x : 20; // -524287 to 524287
- INT64 y : 20; // -524287 to 524287
- INT64 z : 20; // -524287 to 524287
- INT64 w : 4; // -7 to 7
- };
- UINT64 v;
- };
- #ifdef __cplusplus
- _XMICO4() {};
- _XMICO4(UINT64 Packed) : v(Packed) {};
- _XMICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMICO4(CONST FLOAT *pArray);
- operator UINT64 () { return v; }
- _XMICO4& operator= (CONST _XMICO4& Ico4);
- _XMICO4& operator= (CONST UINT64 Packed);
- #endif // __cplusplus
- } XMICO4;
- // 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer
- // The normalized 4D Vector is packed into 64 bits as follows: a 4 bit unsigned,
- // normalized integer for the w component and 20 bit unsigned, normalized
- // integers for the z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
- typedef struct _XMUICON4
- {
- union
- {
- struct
- {
- UINT64 x : 20; // 0/1048575 to 1048575/1048575
- UINT64 y : 20; // 0/1048575 to 1048575/1048575
- UINT64 z : 20; // 0/1048575 to 1048575/1048575
- UINT64 w : 4; // 0/15 to 15/15
- };
- UINT64 v;
- };
- #ifdef __cplusplus
- _XMUICON4() {};
- _XMUICON4(UINT64 Packed) : v(Packed) {};
- _XMUICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUICON4(CONST FLOAT *pArray);
- operator UINT64 () { return v; }
- _XMUICON4& operator= (CONST _XMUICON4& UIcoN4);
- _XMUICON4& operator= (CONST UINT64 Packed);
- #endif // __cplusplus
- } XMUICON4;
- // 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer
- // The 4D Vector is packed into 64 bits as follows: a 4 bit unsigned
- // integer for the w component and 20 bit unsigned integers for the
- // z, y, and x components. The w component is stored in the
- // most significant bits and the x component in the least significant bits
- // (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
- typedef struct _XMUICO4
- {
- union
- {
- struct
- {
- UINT64 x : 20; // 0 to 1048575
- UINT64 y : 20; // 0 to 1048575
- UINT64 z : 20; // 0 to 1048575
- UINT64 w : 4; // 0 to 15
- };
- UINT64 v;
- };
- #ifdef __cplusplus
- _XMUICO4() {};
- _XMUICO4(UINT64 Packed) : v(Packed) {};
- _XMUICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUICO4(CONST FLOAT *pArray);
- operator UINT64 () { return v; }
- _XMUICO4& operator= (CONST _XMUICO4& UIco4);
- _XMUICO4& operator= (CONST UINT64 Packed);
- #endif // __cplusplus
- } XMUICO4;
- // ARGB Color; 8-8-8-8 bit unsigned normalized integer components packed into
- // a 32 bit integer. The normalized color is packed into 32 bits using 8 bit
- // unsigned, normalized integers for the alpha, red, green, and blue components.
- // The alpha component is stored in the most significant bits and the blue
- // component in the least significant bits (A8R8G8B8):
- // [32] aaaaaaaa rrrrrrrr gggggggg bbbbbbbb [0]
- typedef struct _XMCOLOR
- {
- union
- {
- struct
- {
- UINT b : 8; // Blue: 0/255 to 255/255
- UINT g : 8; // Green: 0/255 to 255/255
- UINT r : 8; // Red: 0/255 to 255/255
- UINT a : 8; // Alpha: 0/255 to 255/255
- };
- UINT c;
- };
- #ifdef __cplusplus
- _XMCOLOR() {};
- _XMCOLOR(UINT Color) : c(Color) {};
- _XMCOLOR(FLOAT _r, FLOAT _g, FLOAT _b, FLOAT _a);
- _XMCOLOR(CONST FLOAT *pArray);
- operator UINT () { return c; }
- _XMCOLOR& operator= (CONST _XMCOLOR& Color);
- _XMCOLOR& operator= (CONST UINT Color);
- #endif // __cplusplus
- } XMCOLOR;
- // 4D Vector; 8 bit signed normalized integer components
- typedef struct _XMBYTEN4
- {
- union
- {
- struct
- {
- CHAR x;
- CHAR y;
- CHAR z;
- CHAR w;
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMBYTEN4() {};
- _XMBYTEN4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMBYTEN4(UINT Packed) : v(Packed) {};
- _XMBYTEN4(CONST CHAR *pArray);
- _XMBYTEN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMBYTEN4(CONST FLOAT *pArray);
- _XMBYTEN4& operator= (CONST _XMBYTEN4& ByteN4);
- #endif // __cplusplus
- } XMBYTEN4;
- // 4D Vector; 8 bit signed integer components
- typedef struct _XMBYTE4
- {
- union
- {
- struct
- {
- CHAR x;
- CHAR y;
- CHAR z;
- CHAR w;
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMBYTE4() {};
- _XMBYTE4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMBYTE4(UINT Packed) : v(Packed) {};
- _XMBYTE4(CONST CHAR *pArray);
- _XMBYTE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMBYTE4(CONST FLOAT *pArray);
- _XMBYTE4& operator= (CONST _XMBYTE4& Byte4);
- #endif // __cplusplus
- } XMBYTE4;
- // 4D Vector; 8 bit unsigned normalized integer components
- typedef struct _XMUBYTEN4
- {
- union
- {
- struct
- {
- BYTE x;
- BYTE y;
- BYTE z;
- BYTE w;
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMUBYTEN4() {};
- _XMUBYTEN4(BYTE _x, BYTE _y, BYTE _z, BYTE _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMUBYTEN4(UINT Packed) : v(Packed) {};
- _XMUBYTEN4(CONST BYTE *pArray);
- _XMUBYTEN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUBYTEN4(CONST FLOAT *pArray);
- _XMUBYTEN4& operator= (CONST _XMUBYTEN4& UByteN4);
- #endif // __cplusplus
- } XMUBYTEN4;
- // 4D Vector; 8 bit unsigned integer components
- typedef struct _XMUBYTE4
- {
- union
- {
- struct
- {
- BYTE x;
- BYTE y;
- BYTE z;
- BYTE w;
- };
- UINT v;
- };
- #ifdef __cplusplus
- _XMUBYTE4() {};
- _XMUBYTE4(BYTE _x, BYTE _y, BYTE _z, BYTE _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMUBYTE4(UINT Packed) : v(Packed) {};
- _XMUBYTE4(CONST BYTE *pArray);
- _XMUBYTE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUBYTE4(CONST FLOAT *pArray);
- _XMUBYTE4& operator= (CONST _XMUBYTE4& UByte4);
- #endif // __cplusplus
- } XMUBYTE4;
- // 4D vector; 4 bit unsigned integer components
- typedef struct _XMUNIBBLE4
- {
- union
- {
- struct
- {
- USHORT x : 4;
- USHORT y : 4;
- USHORT z : 4;
- USHORT w : 4;
- };
- USHORT v;
- };
- #ifdef __cplusplus
- _XMUNIBBLE4() {};
- _XMUNIBBLE4(USHORT Packed) : v(Packed) {};
- _XMUNIBBLE4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMUNIBBLE4(CONST CHAR *pArray);
- _XMUNIBBLE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUNIBBLE4(CONST FLOAT *pArray);
- operator USHORT () { return v; }
- _XMUNIBBLE4& operator= (CONST _XMUNIBBLE4& UNibble4);
- _XMUNIBBLE4& operator= (CONST USHORT Packed);
- #endif // __cplusplus
- } XMUNIBBLE4;
- // 4D vector: 5/5/5/1 unsigned integer components
- typedef struct _XMU555
- {
- union
- {
- struct
- {
- USHORT x : 5;
- USHORT y : 5;
- USHORT z : 5;
- USHORT w : 1;
- };
- USHORT v;
- };
- #ifdef __cplusplus
- _XMU555() {};
- _XMU555(USHORT Packed) : v(Packed) {};
- _XMU555(CHAR _x, CHAR _y, CHAR _z, BOOL _w) : x(_x), y(_y), z(_z), w(_w ? 0x1 : 0) {};
- _XMU555(CONST CHAR *pArray, BOOL _w);
- _XMU555(FLOAT _x, FLOAT _y, FLOAT _z, BOOL _w);
- _XMU555(CONST FLOAT *pArray, BOOL _w);
- operator USHORT () { return v; }
- _XMU555& operator= (CONST _XMU555& U555);
- _XMU555& operator= (CONST USHORT Packed);
- #endif // __cplusplus
- } XMU555;
- // 3x3 Matrix: 32 bit floating point components
- typedef struct _XMFLOAT3X3
- {
- union
- {
- struct
- {
- FLOAT _11, _12, _13;
- FLOAT _21, _22, _23;
- FLOAT _31, _32, _33;
- };
- FLOAT m[3][3];
- };
- #ifdef __cplusplus
- _XMFLOAT3X3() {};
- _XMFLOAT3X3(FLOAT m00, FLOAT m01, FLOAT m02,
- FLOAT m10, FLOAT m11, FLOAT m12,
- FLOAT m20, FLOAT m21, FLOAT m22);
- _XMFLOAT3X3(CONST FLOAT *pArray);
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
- _XMFLOAT3X3& operator= (CONST _XMFLOAT3X3& Float3x3);
- #endif // __cplusplus
- } XMFLOAT3X3;
- // 4x3 Matrix: 32 bit floating point components
- typedef struct _XMFLOAT4X3
- {
- union
- {
- struct
- {
- FLOAT _11, _12, _13;
- FLOAT _21, _22, _23;
- FLOAT _31, _32, _33;
- FLOAT _41, _42, _43;
- };
- FLOAT m[4][3];
- };
- #ifdef __cplusplus
- _XMFLOAT4X3() {};
- _XMFLOAT4X3(FLOAT m00, FLOAT m01, FLOAT m02,
- FLOAT m10, FLOAT m11, FLOAT m12,
- FLOAT m20, FLOAT m21, FLOAT m22,
- FLOAT m30, FLOAT m31, FLOAT m32);
- _XMFLOAT4X3(CONST FLOAT *pArray);
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
- _XMFLOAT4X3& operator= (CONST _XMFLOAT4X3& Float4x3);
- #endif // __cplusplus
- } XMFLOAT4X3;
- // 4x3 Matrix: 32 bit floating point components aligned on a 16 byte boundary
- #ifdef __cplusplus
- __declspec(align(16)) struct XMFLOAT4X3A : public XMFLOAT4X3
- {
- XMFLOAT4X3A() : XMFLOAT4X3() {};
- XMFLOAT4X3A(FLOAT m00, FLOAT m01, FLOAT m02,
- FLOAT m10, FLOAT m11, FLOAT m12,
- FLOAT m20, FLOAT m21, FLOAT m22,
- FLOAT m30, FLOAT m31, FLOAT m32) :
- XMFLOAT4X3(m00,m01,m02,m10,m11,m12,m20,m21,m22,m30,m31,m32) {};
- XMFLOAT4X3A(CONST FLOAT *pArray) : XMFLOAT4X3(pArray) {}
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
- XMFLOAT4X3A& operator= (CONST XMFLOAT4X3A& Float4x3);
- };
- #else
- typedef __declspec(align(16)) XMFLOAT4X3 XMFLOAT4X3A;
- #endif // __cplusplus
- // 4x4 Matrix: 32 bit floating point components
- typedef struct _XMFLOAT4X4
- {
- union
- {
- struct
- {
- FLOAT _11, _12, _13, _14;
- FLOAT _21, _22, _23, _24;
- FLOAT _31, _32, _33, _34;
- FLOAT _41, _42, _43, _44;
- };
- FLOAT m[4][4];
- };
- #ifdef __cplusplus
- _XMFLOAT4X4() {};
- _XMFLOAT4X4(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33);
- _XMFLOAT4X4(CONST FLOAT *pArray);
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
- _XMFLOAT4X4& operator= (CONST _XMFLOAT4X4& Float4x4);
- #endif // __cplusplus
- } XMFLOAT4X4;
- // 4x4 Matrix: 32 bit floating point components aligned on a 16 byte boundary
- #ifdef __cplusplus
- __declspec(align(16)) struct XMFLOAT4X4A : public XMFLOAT4X4
- {
- XMFLOAT4X4A() : XMFLOAT4X4() {};
- XMFLOAT4X4A(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33)
- : XMFLOAT4X4(m00,m01,m02,m03,m10,m11,m12,m13,m20,m21,m22,m23,m30,m31,m32,m33) {};
- XMFLOAT4X4A(CONST FLOAT *pArray) : XMFLOAT4X4(pArray) {}
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
- XMFLOAT4X4A& operator= (CONST XMFLOAT4X4A& Float4x4);
- };
- #else
- typedef __declspec(align(16)) XMFLOAT4X4 XMFLOAT4X4A;
- #endif // __cplusplus
- #if !defined(_XM_X86_) && !defined(_XM_X64_)
- #pragma bitfield_order(pop)
- #endif // !_XM_X86_ && !_XM_X64_
- #pragma warning(pop)
- /****************************************************************************
- *
- * Data conversion operations
- *
- ****************************************************************************/
- #if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_)
- #else
- XMVECTOR XMConvertVectorIntToFloat(FXMVECTOR VInt, UINT DivExponent);
- XMVECTOR XMConvertVectorFloatToInt(FXMVECTOR VFloat, UINT MulExponent);
- XMVECTOR XMConvertVectorUIntToFloat(FXMVECTOR VUInt, UINT DivExponent);
- XMVECTOR XMConvertVectorFloatToUInt(FXMVECTOR VFloat, UINT MulExponent);
- #endif
- FLOAT XMConvertHalfToFloat(HALF Value);
- FLOAT* XMConvertHalfToFloatStream(_Out_bytecap_x_(sizeof(FLOAT)+OutputStride*(HalfCount-1)) FLOAT* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(HALF)+InputStride*(HalfCount-1)) CONST HALF* pInputStream,
- _In_ UINT InputStride, _In_ UINT HalfCount);
- HALF XMConvertFloatToHalf(FLOAT Value);
- HALF* XMConvertFloatToHalfStream(_Out_bytecap_x_(sizeof(HALF)+OutputStride*(FloatCount-1)) HALF* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(FLOAT)+InputStride*(FloatCount-1)) CONST FLOAT* pInputStream,
- _In_ UINT InputStride, _In_ UINT FloatCount);
- #if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_)
- #else
- XMVECTOR XMVectorSetBinaryConstant(UINT C0, UINT C1, UINT C2, UINT C3);
- XMVECTOR XMVectorSplatConstant(INT IntConstant, UINT DivExponent);
- XMVECTOR XMVectorSplatConstantInt(INT IntConstant);
- #endif
- /****************************************************************************
- *
- * Load operations
- *
- ****************************************************************************/
- XMVECTOR XMLoadInt(_In_ CONST UINT* pSource);
- XMVECTOR XMLoadFloat(_In_ CONST FLOAT* pSource);
- XMVECTOR XMLoadInt2(_In_count_c_(2) CONST UINT* pSource);
- XMVECTOR XMLoadInt2A(_In_count_c_(2) CONST UINT* PSource);
- XMVECTOR XMLoadFloat2(_In_ CONST XMFLOAT2* pSource);
- XMVECTOR XMLoadFloat2A(_In_ CONST XMFLOAT2A* pSource);
- XMVECTOR XMLoadHalf2(_In_ CONST XMHALF2* pSource);
- XMVECTOR XMLoadShortN2(_In_ CONST XMSHORTN2* pSource);
- XMVECTOR XMLoadShort2(_In_ CONST XMSHORT2* pSource);
- XMVECTOR XMLoadUShortN2(_In_ CONST XMUSHORTN2* pSource);
- XMVECTOR XMLoadUShort2(_In_ CONST XMUSHORT2* pSource);
- XMVECTOR XMLoadInt3(_In_count_c_(3) CONST UINT* pSource);
- XMVECTOR XMLoadInt3A(_In_count_c_(3) CONST UINT* pSource);
- XMVECTOR XMLoadFloat3(_In_ CONST XMFLOAT3* pSource);
- XMVECTOR XMLoadFloat3A(_In_ CONST XMFLOAT3A* pSource);
- XMVECTOR XMLoadHenDN3(_In_ CONST XMHENDN3* pSource);
- XMVECTOR XMLoadHenD3(_In_ CONST XMHEND3* pSource);
- XMVECTOR XMLoadUHenDN3(_In_ CONST XMUHENDN3* pSource);
- XMVECTOR XMLoadUHenD3(_In_ CONST XMUHEND3* pSource);
- XMVECTOR XMLoadDHenN3(_In_ CONST XMDHENN3* pSource);
- XMVECTOR XMLoadDHen3(_In_ CONST XMDHEN3* pSource);
- XMVECTOR XMLoadUDHenN3(_In_ CONST XMUDHENN3* pSource);
- XMVECTOR XMLoadUDHen3(_In_ CONST XMUDHEN3* pSource);
- XMVECTOR XMLoadU565(_In_ CONST XMU565* pSource);
- XMVECTOR XMLoadFloat3PK(_In_ CONST XMFLOAT3PK* pSource);
- XMVECTOR XMLoadFloat3SE(_In_ CONST XMFLOAT3SE* pSource);
- XMVECTOR XMLoadInt4(_In_count_c_(4) CONST UINT* pSource);
- XMVECTOR XMLoadInt4A(_In_count_c_(4) CONST UINT* pSource);
- XMVECTOR XMLoadFloat4(_In_ CONST XMFLOAT4* pSource);
- XMVECTOR XMLoadFloat4A(_In_ CONST XMFLOAT4A* pSource);
- XMVECTOR XMLoadHalf4(_In_ CONST XMHALF4* pSource);
- XMVECTOR XMLoadShortN4(_In_ CONST XMSHORTN4* pSource);
- XMVECTOR XMLoadShort4(_In_ CONST XMSHORT4* pSource);
- XMVECTOR XMLoadUShortN4(_In_ CONST XMUSHORTN4* pSource);
- XMVECTOR XMLoadUShort4(_In_ CONST XMUSHORT4* pSource);
- XMVECTOR XMLoadXIcoN4(_In_ CONST XMXICON4* pSource);
- XMVECTOR XMLoadXIco4(_In_ CONST XMXICO4* pSource);
- XMVECTOR XMLoadIcoN4(_In_ CONST XMICON4* pSource);
- XMVECTOR XMLoadIco4(_In_ CONST XMICO4* pSource);
- XMVECTOR XMLoadUIcoN4(_In_ CONST XMUICON4* pSource);
- XMVECTOR XMLoadUIco4(_In_ CONST XMUICO4* pSource);
- XMVECTOR XMLoadXDecN4(_In_ CONST XMXDECN4* pSource);
- XMVECTOR XMLoadXDec4(_In_ CONST XMXDEC4* pSource);
- XMVECTOR XMLoadDecN4(_In_ CONST XMDECN4* pSource);
- XMVECTOR XMLoadDec4(_In_ CONST XMDEC4* pSource);
- XMVECTOR XMLoadUDecN4(_In_ CONST XMUDECN4* pSource);
- XMVECTOR XMLoadUDec4(_In_ CONST XMUDEC4* pSource);
- XMVECTOR XMLoadByteN4(_In_ CONST XMBYTEN4* pSource);
- XMVECTOR XMLoadByte4(_In_ CONST XMBYTE4* pSource);
- XMVECTOR XMLoadUByteN4(_In_ CONST XMUBYTEN4* pSource);
- XMVECTOR XMLoadUByte4(_In_ CONST XMUBYTE4* pSource);
- XMVECTOR XMLoadUNibble4(_In_ CONST XMUNIBBLE4* pSource);
- XMVECTOR XMLoadU555(_In_ CONST XMU555* pSource);
- XMVECTOR XMLoadColor(_In_ CONST XMCOLOR* pSource);
- XMMATRIX XMLoadFloat3x3(_In_ CONST XMFLOAT3X3* pSource);
- XMMATRIX XMLoadFloat4x3(_In_ CONST XMFLOAT4X3* pSource);
- XMMATRIX XMLoadFloat4x3A(_In_ CONST XMFLOAT4X3A* pSource);
- XMMATRIX XMLoadFloat4x4(_In_ CONST XMFLOAT4X4* pSource);
- XMMATRIX XMLoadFloat4x4A(_In_ CONST XMFLOAT4X4A* pSource);
- /****************************************************************************
- *
- * Store operations
- *
- ****************************************************************************/
- VOID XMStoreInt(_Out_ UINT* pDestination, FXMVECTOR V);
- VOID XMStoreFloat(_Out_ FLOAT* pDestination, FXMVECTOR V);
- VOID XMStoreInt2(_Out_cap_c_(2) UINT* pDestination, FXMVECTOR V);
- VOID XMStoreInt2A(_Out_cap_c_(2) UINT* pDestination, FXMVECTOR V);
- VOID XMStoreFloat2(_Out_ XMFLOAT2* pDestination, FXMVECTOR V);
- VOID XMStoreFloat2A(_Out_ XMFLOAT2A* pDestination, FXMVECTOR V);
- VOID XMStoreHalf2(_Out_ XMHALF2* pDestination, FXMVECTOR V);
- VOID XMStoreShortN2(_Out_ XMSHORTN2* pDestination, FXMVECTOR V);
- VOID XMStoreShort2(_Out_ XMSHORT2* pDestination, FXMVECTOR V);
- VOID XMStoreUShortN2(_Out_ XMUSHORTN2* pDestination, FXMVECTOR V);
- VOID XMStoreUShort2(_Out_ XMUSHORT2* pDestination, FXMVECTOR V);
- VOID XMStoreInt3(_Out_cap_c_(3) UINT* pDestination, FXMVECTOR V);
- VOID XMStoreInt3A(_Out_cap_c_(3) UINT* pDestination, FXMVECTOR V);
- VOID XMStoreFloat3(_Out_ XMFLOAT3* pDestination, FXMVECTOR V);
- VOID XMStoreFloat3A(_Out_ XMFLOAT3A* pDestination, FXMVECTOR V);
- VOID XMStoreHenDN3(_Out_ XMHENDN3* pDestination, FXMVECTOR V);
- VOID XMStoreHenD3(_Out_ XMHEND3* pDestination, FXMVECTOR V);
- VOID XMStoreUHenDN3(_Out_ XMUHENDN3* pDestination, FXMVECTOR V);
- VOID XMStoreUHenD3(_Out_ XMUHEND3* pDestination, FXMVECTOR V);
- VOID XMStoreDHenN3(_Out_ XMDHENN3* pDestination, FXMVECTOR V);
- VOID XMStoreDHen3(_Out_ XMDHEN3* pDestination, FXMVECTOR V);
- VOID XMStoreUDHenN3(_Out_ XMUDHENN3* pDestination, FXMVECTOR V);
- VOID XMStoreUDHen3(_Out_ XMUDHEN3* pDestination, FXMVECTOR V);
- VOID XMStoreU565(_Out_ XMU565* pDestination, FXMVECTOR V);
- VOID XMStoreFloat3PK(_Out_ XMFLOAT3PK* pDestination, FXMVECTOR V);
- VOID XMStoreFloat3SE(_Out_ XMFLOAT3SE* pDestination, FXMVECTOR V);
- VOID XMStoreInt4(_Out_cap_c_(4) UINT* pDestination, FXMVECTOR V);
- VOID XMStoreInt4A(_Out_cap_c_(4) UINT* pDestination, FXMVECTOR V);
- VOID XMStoreInt4NC(_Out_ UINT* pDestination, FXMVECTOR V);
- VOID XMStoreFloat4(_Out_ XMFLOAT4* pDestination, FXMVECTOR V);
- VOID XMStoreFloat4A(_Out_ XMFLOAT4A* pDestination, FXMVECTOR V);
- VOID XMStoreFloat4NC(_Out_ XMFLOAT4* pDestination, FXMVECTOR V);
- VOID XMStoreHalf4(_Out_ XMHALF4* pDestination, FXMVECTOR V);
- VOID XMStoreShortN4(_Out_ XMSHORTN4* pDestination, FXMVECTOR V);
- VOID XMStoreShort4(_Out_ XMSHORT4* pDestination, FXMVECTOR V);
- VOID XMStoreUShortN4(_Out_ XMUSHORTN4* pDestination, FXMVECTOR V);
- VOID XMStoreUShort4(_Out_ XMUSHORT4* pDestination, FXMVECTOR V);
- VOID XMStoreXIcoN4(_Out_ XMXICON4* pDestination, FXMVECTOR V);
- VOID XMStoreXIco4(_Out_ XMXICO4* pDestination, FXMVECTOR V);
- VOID XMStoreIcoN4(_Out_ XMICON4* pDestination, FXMVECTOR V);
- VOID XMStoreIco4(_Out_ XMICO4* pDestination, FXMVECTOR V);
- VOID XMStoreUIcoN4(_Out_ XMUICON4* pDestination, FXMVECTOR V);
- VOID XMStoreUIco4(_Out_ XMUICO4* pDestination, FXMVECTOR V);
- VOID XMStoreXDecN4(_Out_ XMXDECN4* pDestination, FXMVECTOR V);
- VOID XMStoreXDec4(_Out_ XMXDEC4* pDestination, FXMVECTOR V);
- VOID XMStoreDecN4(_Out_ XMDECN4* pDestination, FXMVECTOR V);
- VOID XMStoreDec4(_Out_ XMDEC4* pDestination, FXMVECTOR V);
- VOID XMStoreUDecN4(_Out_ XMUDECN4* pDestination, FXMVECTOR V);
- VOID XMStoreUDec4(_Out_ XMUDEC4* pDestination, FXMVECTOR V);
- VOID XMStoreByteN4(_Out_ XMBYTEN4* pDestination, FXMVECTOR V);
- VOID XMStoreByte4(_Out_ XMBYTE4* pDestination, FXMVECTOR V);
- VOID XMStoreUByteN4(_Out_ XMUBYTEN4* pDestination, FXMVECTOR V);
- VOID XMStoreUByte4(_Out_ XMUBYTE4* pDestination, FXMVECTOR V);
- VOID XMStoreUNibble4(_Out_ XMUNIBBLE4* pDestination, FXMVECTOR V);
- VOID XMStoreU555(_Out_ XMU555* pDestination, FXMVECTOR V);
- VOID XMStoreColor(_Out_ XMCOLOR* pDestination, FXMVECTOR V);
- VOID XMStoreFloat3x3(_Out_ XMFLOAT3X3* pDestination, CXMMATRIX M);
- VOID XMStoreFloat3x3NC(_Out_ XMFLOAT3X3* pDestination, CXMMATRIX M);
- VOID XMStoreFloat4x3(_Out_ XMFLOAT4X3* pDestination, CXMMATRIX M);
- VOID XMStoreFloat4x3A(_Out_ XMFLOAT4X3A* pDestination, CXMMATRIX M);
- VOID XMStoreFloat4x3NC(_Out_ XMFLOAT4X3* pDestination, CXMMATRIX M);
- VOID XMStoreFloat4x4(_Out_ XMFLOAT4X4* pDestination, CXMMATRIX M);
- VOID XMStoreFloat4x4A(_Out_ XMFLOAT4X4A* pDestination, CXMMATRIX M);
- VOID XMStoreFloat4x4NC(_Out_ XMFLOAT4X4* pDestination, CXMMATRIX M);
- /****************************************************************************
- *
- * General vector operations
- *
- ****************************************************************************/
- XMVECTOR XMVectorZero();
- XMVECTOR XMVectorSet(FLOAT x, FLOAT y, FLOAT z, FLOAT w);
- XMVECTOR XMVectorSetInt(UINT x, UINT y, UINT z, UINT w);
- XMVECTOR XMVectorReplicate(FLOAT Value);
- XMVECTOR XMVectorReplicatePtr(_In_ CONST FLOAT *pValue);
- XMVECTOR XMVectorReplicateInt(UINT Value);
- XMVECTOR XMVectorReplicateIntPtr(_In_ CONST UINT *pValue);
- XMVECTOR XMVectorTrueInt();
- XMVECTOR XMVectorFalseInt();
- XMVECTOR XMVectorSplatX(FXMVECTOR V);
- XMVECTOR XMVectorSplatY(FXMVECTOR V);
- XMVECTOR XMVectorSplatZ(FXMVECTOR V);
- XMVECTOR XMVectorSplatW(FXMVECTOR V);
- XMVECTOR XMVectorSplatOne();
- XMVECTOR XMVectorSplatInfinity();
- XMVECTOR XMVectorSplatQNaN();
- XMVECTOR XMVectorSplatEpsilon();
- XMVECTOR XMVectorSplatSignMask();
- FLOAT XMVectorGetByIndex(FXMVECTOR V,UINT i);
- FLOAT XMVectorGetX(FXMVECTOR V);
- FLOAT XMVectorGetY(FXMVECTOR V);
- FLOAT XMVectorGetZ(FXMVECTOR V);
- FLOAT XMVectorGetW(FXMVECTOR V);
- VOID XMVectorGetByIndexPtr(_Out_ FLOAT *f, FXMVECTOR V, UINT i);
- VOID XMVectorGetXPtr(_Out_ FLOAT *x, FXMVECTOR V);
- VOID XMVectorGetYPtr(_Out_ FLOAT *y, FXMVECTOR V);
- VOID XMVectorGetZPtr(_Out_ FLOAT *z, FXMVECTOR V);
- VOID XMVectorGetWPtr(_Out_ FLOAT *w, FXMVECTOR V);
- UINT XMVectorGetIntByIndex(FXMVECTOR V,UINT i);
- UINT XMVectorGetIntX(FXMVECTOR V);
- UINT XMVectorGetIntY(FXMVECTOR V);
- UINT XMVectorGetIntZ(FXMVECTOR V);
- UINT XMVectorGetIntW(FXMVECTOR V);
- VOID XMVectorGetIntByIndexPtr(_Out_ UINT *x,FXMVECTOR V, UINT i);
- VOID XMVectorGetIntXPtr(_Out_ UINT *x, FXMVECTOR V);
- VOID XMVectorGetIntYPtr(_Out_ UINT *y, FXMVECTOR V);
- VOID XMVectorGetIntZPtr(_Out_ UINT *z, FXMVECTOR V);
- VOID XMVectorGetIntWPtr(_Out_ UINT *w, FXMVECTOR V);
- XMVECTOR XMVectorSetByIndex(FXMVECTOR V,FLOAT f,UINT i);
- XMVECTOR XMVectorSetX(FXMVECTOR V, FLOAT x);
- XMVECTOR XMVectorSetY(FXMVECTOR V, FLOAT y);
- XMVECTOR XMVectorSetZ(FXMVECTOR V, FLOAT z);
- XMVECTOR XMVectorSetW(FXMVECTOR V, FLOAT w);
- XMVECTOR XMVectorSetByIndexPtr(FXMVECTOR V, _In_ CONST FLOAT *f, UINT i);
- XMVECTOR XMVectorSetXPtr(FXMVECTOR V, _In_ CONST FLOAT *x);
- XMVECTOR XMVectorSetYPtr(FXMVECTOR V, _In_ CONST FLOAT *y);
- XMVECTOR XMVectorSetZPtr(FXMVECTOR V, _In_ CONST FLOAT *z);
- XMVECTOR XMVectorSetWPtr(FXMVECTOR V, _In_ CONST FLOAT *w);
- XMVECTOR XMVectorSetIntByIndex(FXMVECTOR V, UINT x,UINT i);
- XMVECTOR XMVectorSetIntX(FXMVECTOR V, UINT x);
- XMVECTOR XMVectorSetIntY(FXMVECTOR V, UINT y);
- XMVECTOR XMVectorSetIntZ(FXMVECTOR V, UINT z);
- XMVECTOR XMVectorSetIntW(FXMVECTOR V, UINT w);
- XMVECTOR XMVectorSetIntByIndexPtr(FXMVECTOR V, _In_ CONST UINT *x, UINT i);
- XMVECTOR XMVectorSetIntXPtr(FXMVECTOR V, _In_ CONST UINT *x);
- XMVECTOR XMVectorSetIntYPtr(FXMVECTOR V, _In_ CONST UINT *y);
- XMVECTOR XMVectorSetIntZPtr(FXMVECTOR V, _In_ CONST UINT *z);
- XMVECTOR XMVectorSetIntWPtr(FXMVECTOR V, _In_ CONST UINT *w);
- XMVECTOR XMVectorPermuteControl(UINT ElementIndex0, UINT ElementIndex1, UINT ElementIndex2, UINT ElementIndex3);
- XMVECTOR XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Control);
- XMVECTOR XMVectorSelectControl(UINT VectorIndex0, UINT VectorIndex1, UINT VectorIndex2, UINT VectorIndex3);
- XMVECTOR XMVectorSelect(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Control);
- XMVECTOR XMVectorMergeXY(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorMergeZW(FXMVECTOR V1, FXMVECTOR V2);
- #if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_)
- #else
- XMVECTOR XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, UINT Elements);
- XMVECTOR XMVectorRotateLeft(FXMVECTOR V, UINT Elements);
- XMVECTOR XMVectorRotateRight(FXMVECTOR V, UINT Elements);
- XMVECTOR XMVectorSwizzle(FXMVECTOR V, UINT E0, UINT E1, UINT E2, UINT E3);
- XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateElements,
- UINT Select0, UINT Select1, UINT Select2, UINT Select3);
- #endif
- XMVECTOR XMVectorEqual(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorEqualR(_Out_ UINT* pCR, FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorEqualInt(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorEqualIntR(_Out_ UINT* pCR, FXMVECTOR V, FXMVECTOR V2);
- XMVECTOR XMVectorNearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon);
- XMVECTOR XMVectorNotEqual(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorNotEqualInt(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorGreater(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorGreaterR(_Out_ UINT* pCR, FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorGreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorGreaterOrEqualR(_Out_ UINT* pCR, FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorLess(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorLessOrEqual(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorInBounds(FXMVECTOR V, FXMVECTOR Bounds);
- XMVECTOR XMVectorInBoundsR(_Out_ UINT* pCR, FXMVECTOR V, FXMVECTOR Bounds);
- XMVECTOR XMVectorIsNaN(FXMVECTOR V);
- XMVECTOR XMVectorIsInfinite(FXMVECTOR V);
- XMVECTOR XMVectorMin(FXMVECTOR V1,FXMVECTOR V2);
- XMVECTOR XMVectorMax(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorRound(FXMVECTOR V);
- XMVECTOR XMVectorTruncate(FXMVECTOR V);
- XMVECTOR XMVectorFloor(FXMVECTOR V);
- XMVECTOR XMVectorCeiling(FXMVECTOR V);
- XMVECTOR XMVectorClamp(FXMVECTOR V, FXMVECTOR Min, FXMVECTOR Max);
- XMVECTOR XMVectorSaturate(FXMVECTOR V);
- XMVECTOR XMVectorAndInt(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorAndCInt(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorOrInt(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorNorInt(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorXorInt(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorNegate(FXMVECTOR V);
- XMVECTOR XMVectorAdd(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorAddAngles(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorSubtract(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorSubtractAngles(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorMultiply(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorMultiplyAdd(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3);
- XMVECTOR XMVectorDivide(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorNegativeMultiplySubtract(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3);
- XMVECTOR XMVectorScale(FXMVECTOR V, FLOAT ScaleFactor);
- XMVECTOR XMVectorReciprocalEst(FXMVECTOR V);
- XMVECTOR XMVectorReciprocal(FXMVECTOR V);
- XMVECTOR XMVectorSqrtEst(FXMVECTOR V);
- XMVECTOR XMVectorSqrt(FXMVECTOR V);
- XMVECTOR XMVectorReciprocalSqrtEst(FXMVECTOR V);
- XMVECTOR XMVectorReciprocalSqrt(FXMVECTOR V);
- XMVECTOR XMVectorExpEst(FXMVECTOR V);
- XMVECTOR XMVectorExp(FXMVECTOR V);
- XMVECTOR XMVectorLogEst(FXMVECTOR V);
- XMVECTOR XMVectorLog(FXMVECTOR V);
- XMVECTOR XMVectorPowEst(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorPow(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorAbs(FXMVECTOR V);
- XMVECTOR XMVectorMod(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVectorModAngles(FXMVECTOR Angles);
- XMVECTOR XMVectorSin(FXMVECTOR V);
- XMVECTOR XMVectorSinEst(FXMVECTOR V);
- XMVECTOR XMVectorCos(FXMVECTOR V);
- XMVECTOR XMVectorCosEst(FXMVECTOR V);
- VOID XMVectorSinCos(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, FXMVECTOR V);
- VOID XMVectorSinCosEst(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, FXMVECTOR V);
- XMVECTOR XMVectorTan(FXMVECTOR V);
- XMVECTOR XMVectorTanEst(FXMVECTOR V);
- XMVECTOR XMVectorSinH(FXMVECTOR V);
- XMVECTOR XMVectorSinHEst(FXMVECTOR V);
- XMVECTOR XMVectorCosH(FXMVECTOR V);
- XMVECTOR XMVectorCosHEst(FXMVECTOR V);
- XMVECTOR XMVectorTanH(FXMVECTOR V);
- XMVECTOR XMVectorTanHEst(FXMVECTOR V);
- XMVECTOR XMVectorASin(FXMVECTOR V);
- XMVECTOR XMVectorASinEst(FXMVECTOR V);
- XMVECTOR XMVectorACos(FXMVECTOR V);
- XMVECTOR XMVectorACosEst(FXMVECTOR V);
- XMVECTOR XMVectorATan(FXMVECTOR V);
- XMVECTOR XMVectorATanEst(FXMVECTOR V);
- XMVECTOR XMVectorATan2(FXMVECTOR Y, FXMVECTOR X);
- XMVECTOR XMVectorATan2Est(FXMVECTOR Y, FXMVECTOR X);
- XMVECTOR XMVectorLerp(FXMVECTOR V0, FXMVECTOR V1, FLOAT t);
- XMVECTOR XMVectorLerpV(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR T);
- XMVECTOR XMVectorHermite(FXMVECTOR Position0, FXMVECTOR Tangent0, FXMVECTOR Position1, CXMVECTOR Tangent1, FLOAT t);
- XMVECTOR XMVectorHermiteV(FXMVECTOR Position0, FXMVECTOR Tangent0, FXMVECTOR Position1, CXMVECTOR Tangent1, CXMVECTOR T);
- XMVECTOR XMVectorCatmullRom(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR Position3, FLOAT t);
- XMVECTOR XMVectorCatmullRomV(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR Position3, CXMVECTOR T);
- XMVECTOR XMVectorBaryCentric(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, FLOAT f, FLOAT g);
- XMVECTOR XMVectorBaryCentricV(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR F, CXMVECTOR G);
- /****************************************************************************
- *
- * 2D vector operations
- *
- ****************************************************************************/
- BOOL XMVector2Equal(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector2EqualR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector2EqualInt(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector2EqualIntR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector2NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon);
- BOOL XMVector2NotEqual(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector2NotEqualInt(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector2Greater(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector2GreaterR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector2GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector2GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector2Less(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector2LessOrEqual(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector2InBounds(FXMVECTOR V, FXMVECTOR Bounds);
- UINT XMVector2InBoundsR(FXMVECTOR V, FXMVECTOR Bounds);
- BOOL XMVector2IsNaN(FXMVECTOR V);
- BOOL XMVector2IsInfinite(FXMVECTOR V);
- XMVECTOR XMVector2Dot(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVector2Cross(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVector2LengthSq(FXMVECTOR V);
- XMVECTOR XMVector2ReciprocalLengthEst(FXMVECTOR V);
- XMVECTOR XMVector2ReciprocalLength(FXMVECTOR V);
- XMVECTOR XMVector2LengthEst(FXMVECTOR V);
- XMVECTOR XMVector2Length(FXMVECTOR V);
- XMVECTOR XMVector2NormalizeEst(FXMVECTOR V);
- XMVECTOR XMVector2Normalize(FXMVECTOR V);
- XMVECTOR XMVector2ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax);
- XMVECTOR XMVector2ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax);
- XMVECTOR XMVector2Reflect(FXMVECTOR Incident, FXMVECTOR Normal);
- XMVECTOR XMVector2Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex);
- XMVECTOR XMVector2RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex);
- XMVECTOR XMVector2Orthogonal(FXMVECTOR V);
- XMVECTOR XMVector2AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2);
- XMVECTOR XMVector2AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2);
- XMVECTOR XMVector2AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVector2LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LinePoint2, FXMVECTOR Point);
- XMVECTOR XMVector2IntersectLine(FXMVECTOR Line1Point1, FXMVECTOR Line1Point2, FXMVECTOR Line2Point1, CXMVECTOR Line2Point2);
- XMVECTOR XMVector2Transform(FXMVECTOR V, CXMMATRIX M);
- XMFLOAT4* XMVector2TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
- XMFLOAT4* XMVector2TransformStreamNC(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
- XMVECTOR XMVector2TransformCoord(FXMVECTOR V, CXMMATRIX M);
- XMFLOAT2* XMVector2TransformCoordStream(_Out_bytecap_x_(sizeof(XMFLOAT2)+OutputStride*(VectorCount-1)) XMFLOAT2* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
- XMVECTOR XMVector2TransformNormal(FXMVECTOR V, CXMMATRIX M);
- XMFLOAT2* XMVector2TransformNormalStream(_Out_bytecap_x_(sizeof(XMFLOAT2)+OutputStride*(VectorCount-1)) XMFLOAT2* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
- /****************************************************************************
- *
- * 3D vector operations
- *
- ****************************************************************************/
- BOOL XMVector3Equal(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector3EqualR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector3EqualInt(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector3EqualIntR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector3NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon);
- BOOL XMVector3NotEqual(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector3NotEqualInt(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector3Greater(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector3GreaterR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector3GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector3GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector3Less(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector3LessOrEqual(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector3InBounds(FXMVECTOR V, FXMVECTOR Bounds);
- UINT XMVector3InBoundsR(FXMVECTOR V, FXMVECTOR Bounds);
- BOOL XMVector3IsNaN(FXMVECTOR V);
- BOOL XMVector3IsInfinite(FXMVECTOR V);
- XMVECTOR XMVector3Dot(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVector3Cross(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVector3LengthSq(FXMVECTOR V);
- XMVECTOR XMVector3ReciprocalLengthEst(FXMVECTOR V);
- XMVECTOR XMVector3ReciprocalLength(FXMVECTOR V);
- XMVECTOR XMVector3LengthEst(FXMVECTOR V);
- XMVECTOR XMVector3Length(FXMVECTOR V);
- XMVECTOR XMVector3NormalizeEst(FXMVECTOR V);
- XMVECTOR XMVector3Normalize(FXMVECTOR V);
- XMVECTOR XMVector3ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax);
- XMVECTOR XMVector3ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax);
- XMVECTOR XMVector3Reflect(FXMVECTOR Incident, FXMVECTOR Normal);
- XMVECTOR XMVector3Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex);
- XMVECTOR XMVector3RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex);
- XMVECTOR XMVector3Orthogonal(FXMVECTOR V);
- XMVECTOR XMVector3AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2);
- XMVECTOR XMVector3AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2);
- XMVECTOR XMVector3AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVector3LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LinePoint2, FXMVECTOR Point);
- VOID XMVector3ComponentsFromNormal(_Out_ XMVECTOR* pParallel, _Out_ XMVECTOR* pPerpendicular, FXMVECTOR V, FXMVECTOR Normal);
- XMVECTOR XMVector3Rotate(FXMVECTOR V, FXMVECTOR RotationQuaternion);
- XMVECTOR XMVector3InverseRotate(FXMVECTOR V, FXMVECTOR RotationQuaternion);
- XMVECTOR XMVector3Transform(FXMVECTOR V, CXMMATRIX M);
- XMFLOAT4* XMVector3TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
- XMFLOAT4* XMVector3TransformStreamNC(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
- XMVECTOR XMVector3TransformCoord(FXMVECTOR V, CXMMATRIX M);
- XMFLOAT3* XMVector3TransformCoordStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
- XMVECTOR XMVector3TransformNormal(FXMVECTOR V, CXMMATRIX M);
- XMFLOAT3* XMVector3TransformNormalStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
- XMVECTOR XMVector3Project(FXMVECTOR V, FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
- CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
- XMFLOAT3* XMVector3ProjectStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount,
- FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
- CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
- XMVECTOR XMVector3Unproject(FXMVECTOR V, FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
- CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
- XMFLOAT3* XMVector3UnprojectStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount,
- FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
- CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
- /****************************************************************************
- *
- * 4D vector operations
- *
- ****************************************************************************/
- BOOL XMVector4Equal(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector4EqualR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector4EqualInt(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector4EqualIntR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector4NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon);
- BOOL XMVector4NotEqual(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector4NotEqualInt(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector4Greater(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector4GreaterR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector4GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2);
- UINT XMVector4GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector4Less(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector4LessOrEqual(FXMVECTOR V1, FXMVECTOR V2);
- BOOL XMVector4InBounds(FXMVECTOR V, FXMVECTOR Bounds);
- UINT XMVector4InBoundsR(FXMVECTOR V, FXMVECTOR Bounds);
- BOOL XMVector4IsNaN(FXMVECTOR V);
- BOOL XMVector4IsInfinite(FXMVECTOR V);
- XMVECTOR XMVector4Dot(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVector4Cross(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3);
- XMVECTOR XMVector4LengthSq(FXMVECTOR V);
- XMVECTOR XMVector4ReciprocalLengthEst(FXMVECTOR V);
- XMVECTOR XMVector4ReciprocalLength(FXMVECTOR V);
- XMVECTOR XMVector4LengthEst(FXMVECTOR V);
- XMVECTOR XMVector4Length(FXMVECTOR V);
- XMVECTOR XMVector4NormalizeEst(FXMVECTOR V);
- XMVECTOR XMVector4Normalize(FXMVECTOR V);
- XMVECTOR XMVector4ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax);
- XMVECTOR XMVector4ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax);
- XMVECTOR XMVector4Reflect(FXMVECTOR Incident, FXMVECTOR Normal);
- XMVECTOR XMVector4Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex);
- XMVECTOR XMVector4RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex);
- XMVECTOR XMVector4Orthogonal(FXMVECTOR V);
- XMVECTOR XMVector4AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2);
- XMVECTOR XMVector4AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2);
- XMVECTOR XMVector4AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2);
- XMVECTOR XMVector4Transform(FXMVECTOR V, CXMMATRIX M);
- XMFLOAT4* XMVector4TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT4)+InputStride*(VectorCount-1)) CONST XMFLOAT4* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
- /****************************************************************************
- *
- * Matrix operations
- *
- ****************************************************************************/
- BOOL XMMatrixIsNaN(CXMMATRIX M);
- BOOL XMMatrixIsInfinite(CXMMATRIX M);
- BOOL XMMatrixIsIdentity(CXMMATRIX M);
- XMMATRIX XMMatrixMultiply(CXMMATRIX M1, CXMMATRIX M2);
- XMMATRIX XMMatrixMultiplyTranspose(CXMMATRIX M1, CXMMATRIX M2);
- XMMATRIX XMMatrixTranspose(CXMMATRIX M);
- XMMATRIX XMMatrixInverse(_Out_ XMVECTOR* pDeterminant, CXMMATRIX M);
- XMVECTOR XMMatrixDeterminant(CXMMATRIX M);
- BOOL XMMatrixDecompose(_Out_ XMVECTOR *outScale, _Out_ XMVECTOR *outRotQuat, _Out_ XMVECTOR *outTrans, CXMMATRIX M);
- XMMATRIX XMMatrixIdentity();
- XMMATRIX XMMatrixSet(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33);
- XMMATRIX XMMatrixTranslation(FLOAT OffsetX, FLOAT OffsetY, FLOAT OffsetZ);
- XMMATRIX XMMatrixTranslationFromVector(FXMVECTOR Offset);
- XMMATRIX XMMatrixScaling(FLOAT ScaleX, FLOAT ScaleY, FLOAT ScaleZ);
- XMMATRIX XMMatrixScalingFromVector(FXMVECTOR Scale);
- XMMATRIX XMMatrixRotationX(FLOAT Angle);
- XMMATRIX XMMatrixRotationY(FLOAT Angle);
- XMMATRIX XMMatrixRotationZ(FLOAT Angle);
- XMMATRIX XMMatrixRotationRollPitchYaw(FLOAT Pitch, FLOAT Yaw, FLOAT Roll);
- XMMATRIX XMMatrixRotationRollPitchYawFromVector(FXMVECTOR Angles);
- XMMATRIX XMMatrixRotationNormal(FXMVECTOR NormalAxis, FLOAT Angle);
- XMMATRIX XMMatrixRotationAxis(FXMVECTOR Axis, FLOAT Angle);
- XMMATRIX XMMatrixRotationQuaternion(FXMVECTOR Quaternion);
- XMMATRIX XMMatrixTransformation2D(FXMVECTOR ScalingOrigin, FLOAT ScalingOrientation, FXMVECTOR Scaling,
- FXMVECTOR RotationOrigin, FLOAT Rotation, CXMVECTOR Translation);
- XMMATRIX XMMatrixTransformation(FXMVECTOR ScalingOrigin, FXMVECTOR ScalingOrientationQuaternion, FXMVECTOR Scaling,
- CXMVECTOR RotationOrigin, CXMVECTOR RotationQuaternion, CXMVECTOR Translation);
- XMMATRIX XMMatrixAffineTransformation2D(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FLOAT Rotation, FXMVECTOR Translation);
- XMMATRIX XMMatrixAffineTransformation(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FXMVECTOR RotationQuaternion, CXMVECTOR Translation);
- XMMATRIX XMMatrixReflect(FXMVECTOR ReflectionPlane);
- XMMATRIX XMMatrixShadow(FXMVECTOR ShadowPlane, FXMVECTOR LightPosition);
- XMMATRIX XMMatrixLookAtLH(FXMVECTOR EyePosition, FXMVECTOR FocusPosition, FXMVECTOR UpDirection);
- XMMATRIX XMMatrixLookAtRH(FXMVECTOR EyePosition, FXMVECTOR FocusPosition, FXMVECTOR UpDirection);
- XMMATRIX XMMatrixLookToLH(FXMVECTOR EyePosition, FXMVECTOR EyeDirection, FXMVECTOR UpDirection);
- XMMATRIX XMMatrixLookToRH(FXMVECTOR EyePosition, FXMVECTOR EyeDirection, FXMVECTOR UpDirection);
- XMMATRIX XMMatrixPerspectiveLH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ);
- XMMATRIX XMMatrixPerspectiveRH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ);
- XMMATRIX XMMatrixPerspectiveFovLH(FLOAT FovAngleY, FLOAT AspectHByW, FLOAT NearZ, FLOAT FarZ);
- XMMATRIX XMMatrixPerspectiveFovRH(FLOAT FovAngleY, FLOAT AspectHByW, FLOAT NearZ, FLOAT FarZ);
- XMMATRIX XMMatrixPerspectiveOffCenterLH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ);
- XMMATRIX XMMatrixPerspectiveOffCenterRH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ);
- XMMATRIX XMMatrixOrthographicLH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ);
- XMMATRIX XMMatrixOrthographicRH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ);
- XMMATRIX XMMatrixOrthographicOffCenterLH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ);
- XMMATRIX XMMatrixOrthographicOffCenterRH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ);
- /****************************************************************************
- *
- * Quaternion operations
- *
- ****************************************************************************/
- BOOL XMQuaternionEqual(FXMVECTOR Q1, FXMVECTOR Q2);
- BOOL XMQuaternionNotEqual(FXMVECTOR Q1, FXMVECTOR Q2);
- BOOL XMQuaternionIsNaN(FXMVECTOR Q);
- BOOL XMQuaternionIsInfinite(FXMVECTOR Q);
- BOOL XMQuaternionIsIdentity(FXMVECTOR Q);
- XMVECTOR XMQuaternionDot(FXMVECTOR Q1, FXMVECTOR Q2);
- XMVECTOR XMQuaternionMultiply(FXMVECTOR Q1, FXMVECTOR Q2);
- XMVECTOR XMQuaternionLengthSq(FXMVECTOR Q);
- XMVECTOR XMQuaternionReciprocalLength(FXMVECTOR Q);
- XMVECTOR XMQuaternionLength(FXMVECTOR Q);
- XMVECTOR XMQuaternionNormalizeEst(FXMVECTOR Q);
- XMVECTOR XMQuaternionNormalize(FXMVECTOR Q);
- XMVECTOR XMQuaternionConjugate(FXMVECTOR Q);
- XMVECTOR XMQuaternionInverse(FXMVECTOR Q);
- XMVECTOR XMQuaternionLn(FXMVECTOR Q);
- XMVECTOR XMQuaternionExp(FXMVECTOR Q);
- XMVECTOR XMQuaternionSlerp(FXMVECTOR Q0, FXMVECTOR Q1, FLOAT t);
- XMVECTOR XMQuaternionSlerpV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR T);
- XMVECTOR XMQuaternionSquad(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3, FLOAT t);
- XMVECTOR XMQuaternionSquadV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3, CXMVECTOR T);
- VOID XMQuaternionSquadSetup(_Out_ XMVECTOR* pA, _Out_ XMVECTOR* pB, _Out_ XMVECTOR* pC, FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3);
- XMVECTOR XMQuaternionBaryCentric(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, FLOAT f, FLOAT g);
- XMVECTOR XMQuaternionBaryCentricV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR F, CXMVECTOR G);
- XMVECTOR XMQuaternionIdentity();
- XMVECTOR XMQuaternionRotationRollPitchYaw(FLOAT Pitch, FLOAT Yaw, FLOAT Roll);
- XMVECTOR XMQuaternionRotationRollPitchYawFromVector(FXMVECTOR Angles);
- XMVECTOR XMQuaternionRotationNormal(FXMVECTOR NormalAxis, FLOAT Angle);
- XMVECTOR XMQuaternionRotationAxis(FXMVECTOR Axis, FLOAT Angle);
- XMVECTOR XMQuaternionRotationMatrix(CXMMATRIX M);
- VOID XMQuaternionToAxisAngle(_Out_ XMVECTOR* pAxis, _Out_ FLOAT* pAngle, FXMVECTOR Q);
- /****************************************************************************
- *
- * Plane operations
- *
- ****************************************************************************/
- BOOL XMPlaneEqual(FXMVECTOR P1, FXMVECTOR P2);
- BOOL XMPlaneNearEqual(FXMVECTOR P1, FXMVECTOR P2, FXMVECTOR Epsilon);
- BOOL XMPlaneNotEqual(FXMVECTOR P1, FXMVECTOR P2);
- BOOL XMPlaneIsNaN(FXMVECTOR P);
- BOOL XMPlaneIsInfinite(FXMVECTOR P);
- XMVECTOR XMPlaneDot(FXMVECTOR P, FXMVECTOR V);
- XMVECTOR XMPlaneDotCoord(FXMVECTOR P, FXMVECTOR V);
- XMVECTOR XMPlaneDotNormal(FXMVECTOR P, FXMVECTOR V);
- XMVECTOR XMPlaneNormalizeEst(FXMVECTOR P);
- XMVECTOR XMPlaneNormalize(FXMVECTOR P);
- XMVECTOR XMPlaneIntersectLine(FXMVECTOR P, FXMVECTOR LinePoint1, FXMVECTOR LinePoint2);
- VOID XMPlaneIntersectPlane(_Out_ XMVECTOR* pLinePoint1, _Out_ XMVECTOR* pLinePoint2, FXMVECTOR P1, FXMVECTOR P2);
- XMVECTOR XMPlaneTransform(FXMVECTOR P, CXMMATRIX M);
- XMFLOAT4* XMPlaneTransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(PlaneCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT4)+InputStride*(PlaneCount-1)) CONST XMFLOAT4* pInputStream,
- _In_ UINT InputStride, _In_ UINT PlaneCount, CXMMATRIX M);
- XMVECTOR XMPlaneFromPointNormal(FXMVECTOR Point, FXMVECTOR Normal);
- XMVECTOR XMPlaneFromPoints(FXMVECTOR Point1, FXMVECTOR Point2, FXMVECTOR Point3);
- /****************************************************************************
- *
- * Color operations
- *
- ****************************************************************************/
- BOOL XMColorEqual(FXMVECTOR C1, FXMVECTOR C2);
- BOOL XMColorNotEqual(FXMVECTOR C1, FXMVECTOR C2);
- BOOL XMColorGreater(FXMVECTOR C1, FXMVECTOR C2);
- BOOL XMColorGreaterOrEqual(FXMVECTOR C1, FXMVECTOR C2);
- BOOL XMColorLess(FXMVECTOR C1, FXMVECTOR C2);
- BOOL XMColorLessOrEqual(FXMVECTOR C1, FXMVECTOR C2);
- BOOL XMColorIsNaN(FXMVECTOR C);
- BOOL XMColorIsInfinite(FXMVECTOR C);
- XMVECTOR XMColorNegative(FXMVECTOR C);
- XMVECTOR XMColorModulate(FXMVECTOR C1, FXMVECTOR C2);
- XMVECTOR XMColorAdjustSaturation(FXMVECTOR C, FLOAT Saturation);
- XMVECTOR XMColorAdjustContrast(FXMVECTOR C, FLOAT Contrast);
- /****************************************************************************
- *
- * Miscellaneous operations
- *
- ****************************************************************************/
- BOOL XMVerifyCPUSupport();
- VOID XMAssert(_In_z_ CONST CHAR* pExpression, _In_z_ CONST CHAR* pFileName, UINT LineNumber);
- XMVECTOR XMFresnelTerm(FXMVECTOR CosIncidentAngle, FXMVECTOR RefractionIndex);
- BOOL XMScalarNearEqual(FLOAT S1, FLOAT S2, FLOAT Epsilon);
- FLOAT XMScalarModAngle(FLOAT Value);
- FLOAT XMScalarSin(FLOAT Value);
- FLOAT XMScalarCos(FLOAT Value);
- VOID XMScalarSinCos(_Out_ FLOAT* pSin, _Out_ FLOAT* pCos, FLOAT Value);
- FLOAT XMScalarASin(FLOAT Value);
- FLOAT XMScalarACos(FLOAT Value);
- FLOAT XMScalarSinEst(FLOAT Value);
- FLOAT XMScalarCosEst(FLOAT Value);
- VOID XMScalarSinCosEst(_Out_ FLOAT* pSin, _Out_ FLOAT* pCos, FLOAT Value);
- FLOAT XMScalarASinEst(FLOAT Value);
- FLOAT XMScalarACosEst(FLOAT Value);
- /****************************************************************************
- *
- * Globals
- *
- ****************************************************************************/
- // The purpose of the following global constants is to prevent redundant
- // reloading of the constants when they are referenced by more than one
- // separate inline math routine called within the same function. Declaring
- // a constant locally within a routine is sufficient to prevent redundant
- // reloads of that constant when that single routine is called multiple
- // times in a function, but if the constant is used (and declared) in a
- // separate math routine it would be reloaded.
- #define XMGLOBALCONST extern CONST __declspec(selectany)
- XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients0 = {1.0f, -0.166666667f, 8.333333333e-3f, -1.984126984e-4f};
- XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients1 = {2.755731922e-6f, -2.505210839e-8f, 1.605904384e-10f, -7.647163732e-13f};
- XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients2 = {2.811457254e-15f, -8.220635247e-18f, 1.957294106e-20f, -3.868170171e-23f};
- XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients0 = {1.0f, -0.5f, 4.166666667e-2f, -1.388888889e-3f};
- XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients1 = {2.480158730e-5f, -2.755731922e-7f, 2.087675699e-9f, -1.147074560e-11f};
- XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients2 = {4.779477332e-14f, -1.561920697e-16f, 4.110317623e-19f, -8.896791392e-22f};
- XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients0 = {1.0f, 0.333333333f, 0.133333333f, 5.396825397e-2f};
- XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients1 = {2.186948854e-2f, 8.863235530e-3f, 3.592128167e-3f, 1.455834485e-3f};
- XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients2 = {5.900274264e-4f, 2.391290764e-4f, 9.691537707e-5f, 3.927832950e-5f};
- XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients0 = {-0.05806367563904f, -0.41861972469416f, 0.22480114791621f, 2.17337241360606f};
- XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients1 = {0.61657275907170f, 4.29696498283455f, -1.18942822255452f, -6.53784832094831f};
- XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients2 = {-1.36926553863413f, -4.48179294237210f, 1.41810672941833f, 5.48179257935713f};
- XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients0 = {1.0f, 0.333333334f, 0.2f, 0.142857143f};
- XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients1 = {1.111111111e-1f, 9.090909091e-2f, 7.692307692e-2f, 6.666666667e-2f};
- XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients2 = {5.882352941e-2f, 5.263157895e-2f, 4.761904762e-2f, 4.347826087e-2f};
- XMGLOBALCONST XMVECTORF32 g_XMSinEstCoefficients = {1.0f, -1.66521856991541e-1f, 8.199913018755e-3f, -1.61475937228e-4f};
- XMGLOBALCONST XMVECTORF32 g_XMCosEstCoefficients = {1.0f, -4.95348008918096e-1f, 3.878259962881e-2f, -9.24587976263e-4f};
- XMGLOBALCONST XMVECTORF32 g_XMTanEstCoefficients = {2.484f, -1.954923183e-1f, 2.467401101f, XM_1DIVPI};
- XMGLOBALCONST XMVECTORF32 g_XMATanEstCoefficients = {7.689891418951e-1f, 1.104742493348f, 8.661844266006e-1f, XM_PIDIV2};
- XMGLOBALCONST XMVECTORF32 g_XMASinEstCoefficients = {-1.36178272886711f, 2.37949493464538f, -8.08228565650486e-1f, 2.78440142746736e-1f};
- XMGLOBALCONST XMVECTORF32 g_XMASinEstConstants = {1.00000011921f, XM_PIDIV2, 0.0f, 0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMPiConstants0 = {XM_PI, XM_2PI, XM_1DIVPI, XM_1DIV2PI};
- XMGLOBALCONST XMVECTORF32 g_XMIdentityR0 = {1.0f, 0.0f, 0.0f, 0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMIdentityR1 = {0.0f, 1.0f, 0.0f, 0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMIdentityR2 = {0.0f, 0.0f, 1.0f, 0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMIdentityR3 = {0.0f, 0.0f, 0.0f, 1.0f};
- XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR0 = {-1.0f,0.0f, 0.0f, 0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR1 = {0.0f,-1.0f, 0.0f, 0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR2 = {0.0f, 0.0f,-1.0f, 0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR3 = {0.0f, 0.0f, 0.0f,-1.0f};
- XMGLOBALCONST XMVECTORI32 g_XMNegativeZero = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
- XMGLOBALCONST XMVECTORI32 g_XMNegate3 = {0x80000000, 0x80000000, 0x80000000, 0x00000000};
- XMGLOBALCONST XMVECTORI32 g_XMMask3 = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000};
- XMGLOBALCONST XMVECTORI32 g_XMMaskX = {0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000};
- XMGLOBALCONST XMVECTORI32 g_XMMaskY = {0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000};
- XMGLOBALCONST XMVECTORI32 g_XMMaskZ = {0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000};
- XMGLOBALCONST XMVECTORI32 g_XMMaskW = {0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF};
- XMGLOBALCONST XMVECTORF32 g_XMOne = { 1.0f, 1.0f, 1.0f, 1.0f};
- XMGLOBALCONST XMVECTORF32 g_XMOne3 = { 1.0f, 1.0f, 1.0f, 0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMZero = { 0.0f, 0.0f, 0.0f, 0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMNegativeOne = {-1.0f,-1.0f,-1.0f,-1.0f};
- XMGLOBALCONST XMVECTORF32 g_XMOneHalf = { 0.5f, 0.5f, 0.5f, 0.5f};
- XMGLOBALCONST XMVECTORF32 g_XMNegativeOneHalf = {-0.5f,-0.5f,-0.5f,-0.5f};
- XMGLOBALCONST XMVECTORF32 g_XMNegativeTwoPi = {-XM_2PI, -XM_2PI, -XM_2PI, -XM_2PI};
- XMGLOBALCONST XMVECTORF32 g_XMNegativePi = {-XM_PI, -XM_PI, -XM_PI, -XM_PI};
- XMGLOBALCONST XMVECTORF32 g_XMHalfPi = {XM_PIDIV2, XM_PIDIV2, XM_PIDIV2, XM_PIDIV2};
- XMGLOBALCONST XMVECTORF32 g_XMPi = {XM_PI, XM_PI, XM_PI, XM_PI};
- XMGLOBALCONST XMVECTORF32 g_XMReciprocalPi = {XM_1DIVPI, XM_1DIVPI, XM_1DIVPI, XM_1DIVPI};
- XMGLOBALCONST XMVECTORF32 g_XMTwoPi = {XM_2PI, XM_2PI, XM_2PI, XM_2PI};
- XMGLOBALCONST XMVECTORF32 g_XMReciprocalTwoPi = {XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI};
- XMGLOBALCONST XMVECTORF32 g_XMEpsilon = {1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f};
- XMGLOBALCONST XMVECTORI32 g_XMInfinity = {0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000};
- XMGLOBALCONST XMVECTORI32 g_XMQNaN = {0x7FC00000, 0x7FC00000, 0x7FC00000, 0x7FC00000};
- XMGLOBALCONST XMVECTORI32 g_XMQNaNTest = {0x007FFFFF, 0x007FFFFF, 0x007FFFFF, 0x007FFFFF};
- XMGLOBALCONST XMVECTORI32 g_XMAbsMask = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF};
- XMGLOBALCONST XMVECTORI32 g_XMFltMin = {0x00800000, 0x00800000, 0x00800000, 0x00800000};
- XMGLOBALCONST XMVECTORI32 g_XMFltMax = {0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF};
- XMGLOBALCONST XMVECTORI32 g_XMNegOneMask = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
- XMGLOBALCONST XMVECTORI32 g_XMMaskA8R8G8B8 = {0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000};
- XMGLOBALCONST XMVECTORI32 g_XMFlipA8R8G8B8 = {0x00000000, 0x00000000, 0x00000000, 0x80000000};
- XMGLOBALCONST XMVECTORF32 g_XMFixAA8R8G8B8 = {0.0f,0.0f,0.0f,(float)(0x80000000U)};
- XMGLOBALCONST XMVECTORF32 g_XMNormalizeA8R8G8B8 = {1.0f/(255.0f*(float)(0x10000)),1.0f/(255.0f*(float)(0x100)),1.0f/255.0f,1.0f/(255.0f*(float)(0x1000000))};
- XMGLOBALCONST XMVECTORI32 g_XMMaskA2B10G10R10 = {0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000};
- XMGLOBALCONST XMVECTORI32 g_XMFlipA2B10G10R10 = {0x00000200, 0x00080000, 0x20000000, 0x80000000};
- XMGLOBALCONST XMVECTORF32 g_XMFixAA2B10G10R10 = {-512.0f,-512.0f*(float)(0x400),-512.0f*(float)(0x100000),(float)(0x80000000U)};
- XMGLOBALCONST XMVECTORF32 g_XMNormalizeA2B10G10R10 = {1.0f/511.0f,1.0f/(511.0f*(float)(0x400)),1.0f/(511.0f*(float)(0x100000)),1.0f/(3.0f*(float)(0x40000000))};
- XMGLOBALCONST XMVECTORI32 g_XMMaskX16Y16 = {0x0000FFFF, 0xFFFF0000, 0x00000000, 0x00000000};
- XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16 = {0x00008000, 0x00000000, 0x00000000, 0x00000000};
- XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16 = {-32768.0f,0.0f,0.0f,0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16 = {1.0f/32767.0f,1.0f/(32767.0f*65536.0f),0.0f,0.0f};
- XMGLOBALCONST XMVECTORI32 g_XMMaskX16Y16Z16W16 = {0x0000FFFF, 0x0000FFFF, 0xFFFF0000, 0xFFFF0000};
- XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16Z16W16 = {0x00008000, 0x00008000, 0x00000000, 0x00000000};
- XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16Z16W16 = {-32768.0f,-32768.0f,0.0f,0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16Z16W16 = {1.0f/32767.0f,1.0f/32767.0f,1.0f/(32767.0f*65536.0f),1.0f/(32767.0f*65536.0f)};
- XMGLOBALCONST XMVECTORF32 g_XMNoFraction = {8388608.0f,8388608.0f,8388608.0f,8388608.0f};
- XMGLOBALCONST XMVECTORI32 g_XMMaskByte = {0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF};
- XMGLOBALCONST XMVECTORF32 g_XMNegateX = {-1.0f, 1.0f, 1.0f, 1.0f};
- XMGLOBALCONST XMVECTORF32 g_XMNegateY = { 1.0f,-1.0f, 1.0f, 1.0f};
- XMGLOBALCONST XMVECTORF32 g_XMNegateZ = { 1.0f, 1.0f,-1.0f, 1.0f};
- XMGLOBALCONST XMVECTORF32 g_XMNegateW = { 1.0f, 1.0f, 1.0f,-1.0f};
- XMGLOBALCONST XMVECTORI32 g_XMSelect0101 = {XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1};
- XMGLOBALCONST XMVECTORI32 g_XMSelect1010 = {XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0};
- XMGLOBALCONST XMVECTORI32 g_XMOneHalfMinusEpsilon = { 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD};
- XMGLOBALCONST XMVECTORI32 g_XMSelect1000 = {XM_SELECT_1, XM_SELECT_0, XM_SELECT_0, XM_SELECT_0};
- XMGLOBALCONST XMVECTORI32 g_XMSelect1100 = {XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0};
- XMGLOBALCONST XMVECTORI32 g_XMSelect1110 = {XM_SELECT_1, XM_SELECT_1, XM_SELECT_1, XM_SELECT_0};
- XMGLOBALCONST XMVECTORI32 g_XMSwizzleXYXY = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0Y};
- XMGLOBALCONST XMVECTORI32 g_XMSwizzleXYZX = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X};
- XMGLOBALCONST XMVECTORI32 g_XMSwizzleYXZW = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0Z, XM_PERMUTE_0W};
- XMGLOBALCONST XMVECTORI32 g_XMSwizzleYZXW = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0W};
- XMGLOBALCONST XMVECTORI32 g_XMSwizzleZXYW = {XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W};
- XMGLOBALCONST XMVECTORI32 g_XMPermute0X0Y1X1Y = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_1Y};
- XMGLOBALCONST XMVECTORI32 g_XMPermute0Z0W1Z1W = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_1Z, XM_PERMUTE_1W};
- XMGLOBALCONST XMVECTORF32 g_XMFixupY16 = {1.0f,1.0f/65536.0f,0.0f,0.0f};
- XMGLOBALCONST XMVECTORF32 g_XMFixupY16W16 = {1.0f,1.0f,1.0f/65536.0f,1.0f/65536.0f};
- XMGLOBALCONST XMVECTORI32 g_XMFlipY = {0,0x80000000,0,0};
- XMGLOBALCONST XMVECTORI32 g_XMFlipZ = {0,0,0x80000000,0};
- XMGLOBALCONST XMVECTORI32 g_XMFlipW = {0,0,0,0x80000000};
- XMGLOBALCONST XMVECTORI32 g_XMFlipYZ = {0,0x80000000,0x80000000,0};
- XMGLOBALCONST XMVECTORI32 g_XMFlipZW = {0,0,0x80000000,0x80000000};
- XMGLOBALCONST XMVECTORI32 g_XMFlipYW = {0,0x80000000,0,0x80000000};
- XMGLOBALCONST XMVECTORI32 g_XMMaskHenD3 = {0x7FF,0x7ff<<11,0x3FF<<22,0};
- XMGLOBALCONST XMVECTORI32 g_XMMaskDHen3 = {0x3FF,0x7ff<<10,0x7FF<<21,0};
- XMGLOBALCONST XMVECTORF32 g_XMAddUHenD3 = {0,0,32768.0f*65536.0f,0};
- XMGLOBALCONST XMVECTORF32 g_XMAddHenD3 = {-1024.0f,-1024.0f*2048.0f,0,0};
- XMGLOBALCONST XMVECTORF32 g_XMAddDHen3 = {-512.0f,-1024.0f*1024.0f,0,0};
- XMGLOBALCONST XMVECTORF32 g_XMMulHenD3 = {1.0f,1.0f/2048.0f,1.0f/(2048.0f*2048.0f),0};
- XMGLOBALCONST XMVECTORF32 g_XMMulDHen3 = {1.0f,1.0f/1024.0f,1.0f/(1024.0f*2048.0f),0};
- XMGLOBALCONST XMVECTORI32 g_XMXorHenD3 = {0x400,0x400<<11,0,0};
- XMGLOBALCONST XMVECTORI32 g_XMXorDHen3 = {0x200,0x400<<10,0,0};
- XMGLOBALCONST XMVECTORI32 g_XMMaskIco4 = {0xFFFFF,0xFFFFF000,0xFFFFF,0xF0000000};
- XMGLOBALCONST XMVECTORI32 g_XMXorXIco4 = {0x80000,0,0x80000,0x80000000};
- XMGLOBALCONST XMVECTORI32 g_XMXorIco4 = {0x80000,0,0x80000,0};
- XMGLOBALCONST XMVECTORF32 g_XMAddXIco4 = {-8.0f*65536.0f,0,-8.0f*65536.0f,32768.0f*65536.0f};
- XMGLOBALCONST XMVECTORF32 g_XMAddUIco4 = {0,32768.0f*65536.0f,0,32768.0f*65536.0f};
- XMGLOBALCONST XMVECTORF32 g_XMAddIco4 = {-8.0f*65536.0f,0,-8.0f*65536.0f,0};
- XMGLOBALCONST XMVECTORF32 g_XMMulIco4 = {1.0f,1.0f/4096.0f,1.0f,1.0f/(4096.0f*65536.0f)};
- XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<30};
- XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = {0x200,0x200<<10,0x200<<20,0};
- XMGLOBALCONST XMVECTORF32 g_XMAddUDec4 = {0,0,0,32768.0f*65536.0f};
- XMGLOBALCONST XMVECTORF32 g_XMAddDec4 = {-512.0f,-512.0f*1024.0f,-512.0f*1024.0f*1024.0f,0};
- XMGLOBALCONST XMVECTORF32 g_XMMulDec4 = {1.0f,1.0f/1024.0f,1.0f/(1024.0f*1024.0f),1.0f/(1024.0f*1024.0f*1024.0f)};
- XMGLOBALCONST XMVECTORI32 g_XMMaskByte4 = {0xFF,0xFF00,0xFF0000,0xFF000000};
- XMGLOBALCONST XMVECTORI32 g_XMXorByte4 = {0x80,0x8000,0x800000,0x00000000};
- XMGLOBALCONST XMVECTORF32 g_XMAddByte4 = {-128.0f,-128.0f*256.0f,-128.0f*65536.0f,0};
- /****************************************************************************
- *
- * Implementation
- *
- ****************************************************************************/
- #pragma warning(push)
- #pragma warning(disable:4214 4204 4365 4616 6001)
- #if !defined(__cplusplus) && !defined(_XBOX) && defined(_XM_ISVS2005_)
- /* Work around VC 2005 bug where math.h defines logf with a semicolon at the end.
- * Note this is fixed as of Visual Studio 2005 Service Pack 1
- */
- #undef logf
- #define logf(x) ((float)log((double)(x)))
- #endif // !defined(__cplusplus) && !defined(_XBOX) && defined(_XM_ISVS2005_)
- //------------------------------------------------------------------------------
- #if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
- XMFINLINE XMVECTOR XMVectorSetBinaryConstant(UINT C0, UINT C1, UINT C2, UINT C3)
- {
- #if defined(_XM_NO_INTRINSICS_)
- XMVECTORU32 vResult;
- vResult.u[0] = (0-(C0&1)) & 0x3F800000;
- vResult.u[1] = (0-(C1&1)) & 0x3F800000;
- vResult.u[2] = (0-(C2&1)) & 0x3F800000;
- vResult.u[3] = (0-(C3&1)) & 0x3F800000;
- return vResult.v;
- #else // XM_SSE_INTRINSICS_
- static const XMVECTORU32 g_vMask1 = {1,1,1,1};
- // Move the parms to a vector
- __m128i vTemp = _mm_set_epi32(C3,C2,C1,C0);
- // Mask off the low bits
- vTemp = _mm_and_si128(vTemp,g_vMask1);
- // 0xFFFFFFFF on true bits
- vTemp = _mm_cmpeq_epi32(vTemp,g_vMask1);
- // 0xFFFFFFFF -> 1.0f, 0x00000000 -> 0.0f
- vTemp = _mm_and_si128(vTemp,g_XMOne);
- return reinterpret_cast<const __m128 *>(&vTemp)[0];
- #endif
- }
- //------------------------------------------------------------------------------
- XMFINLINE XMVECTOR XMVectorSplatConstant(INT IntConstant, UINT DivExponent)
- {
- #if defined(_XM_NO_INTRINSICS_)
- XMASSERT( IntConstant >= -16 && IntConstant <= 15 );
- XMASSERT(DivExponent<32);
- {
- XMVECTORI32 V = { IntConstant, IntConstant, IntConstant, IntConstant };
- return XMConvertVectorIntToFloat( V.v, DivExponent);
- }
- #else // XM_SSE_INTRINSICS_
- XMASSERT( IntConstant >= -16 && IntConstant <= 15 );
- XMASSERT(DivExponent<32);
- // Splat the int
- __m128i vScale = _mm_set1_epi32(IntConstant);
- // Convert to a float
- XMVECTOR vResult = _mm_cvtepi32_ps(vScale);
- // Convert DivExponent into 1.0f/(1<<DivExponent)
- UINT uScale = 0x3F800000U - (DivExponent << 23);
- // Splat the scalar value (It's really a float)
- vScale = _mm_set1_epi32(uScale);
- // Multiply by the reciprocal (Perform a right shift by DivExponent)
- vResult = _mm_mul_ps(vResult,reinterpret_cast<const __m128 *>(&vScale)[0]);
- return vResult;
- #endif
- }
- //------------------------------------------------------------------------------
- XMFINLINE XMVECTOR XMVectorSplatConstantInt(INT IntConstant)
- {
- #if defined(_XM_NO_INTRINSICS_)
- XMASSERT( IntConstant >= -16 && IntConstant <= 15 );
- {
- XMVECTORI32 V = { IntConstant, IntConstant, IntConstant, IntConstant };
- return V.v;
- }
- #else // XM_SSE_INTRINSICS_
- XMASSERT( IntConstant >= -16 && IntConstant <= 15 );
- __m128i V = _mm_set1_epi32( IntConstant );
- return reinterpret_cast<__m128 *>(&V)[0];
- #endif
- }
- //------------------------------------------------------------------------------
- XMFINLINE XMVECTOR XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, UINT Elements)
- {
- return XMVectorPermute(V1, V2, XMVectorPermuteControl((Elements), ((Elements) + 1), ((Elements) + 2), ((Elements) + 3)));
- }
- //------------------------------------------------------------------------------
- XMFINLINE XMVECTOR XMVectorRotateLeft(FXMVECTOR V, UINT Elements)
- {
- #if defined(_XM_NO_INTRINSICS_)
- XMASSERT( Elements < 4 );
- {
- XMVECTORF32 vResult = { V.vector4_f32[Elements & 3], V.vector4_f32[(Elements + 1) & 3],
- V.vector4_f32[(Elements + 2) & 3], V.vector4_f32[(Elements + 3) & 3] };
- return vResult.v;
- }
- #else // XM_SSE_INTRINSICS_
- FLOAT fx = XMVectorGetByIndex(V,(Elements) & 3);
- FLOAT fy = XMVectorGetByIndex(V,((Elements) + 1) & 3);
- FLOAT fz = XMVectorGetByIndex(V,((Elements) + 2) & 3);
- FLOAT fw = XMVectorGetByIndex(V,((Elements) + 3) & 3);
- return _mm_set_ps( fw, fz, fy, fx );
- #endif
- }
- //------------------------------------------------------------------------------
- XMFINLINE XMVECTOR XMVectorRotateRight(FXMVECTOR V, UINT Elements)
- {
- #if defined(_XM_NO_INTRINSICS_)
- XMASSERT( Elements < 4 );
- {
- XMVECTORF32 vResult = { V.vector4_f32[(4 - (Elements)) & 3], V.vector4_f32[(5 - (Elements)) & 3],
- V.vector4_f32[(6 - (Elements)) & 3], V.vector4_f32[(7 - (Elements)) & 3] };
- return vResult.v;
- }
- #else // XM_SSE_INTRINSICS_
- FLOAT fx = XMVectorGetByIndex(V,(4 - (Elements)) & 3);
- FLOAT fy = XMVectorGetByIndex(V,(5 - (Elements)) & 3);
- FLOAT fz = XMVectorGetByIndex(V,(6 - (Elements)) & 3);
- FLOAT fw = XMVectorGetByIndex(V,(7 - (Elements)) & 3);
- return _mm_set_ps( fw, fz, fy, fx );
- #endif
- }
- //------------------------------------------------------------------------------
- XMFINLINE XMVECTOR XMVectorSwizzle(FXMVECTOR V, UINT E0, UINT E1, UINT E2, UINT E3)
- {
- #if defined(_XM_NO_INTRINSICS_)
- XMASSERT( (E0 < 4) && (E1 < 4) && (E2 < 4) && (E3 < 4) );
- {
- XMVECTORF32 vResult = { V.vector4_f32[E0], V.vector4_f32[E1], V.vector4_f32[E2], V.vector4_f32[E3] };
- return vResult.v;
- }
- #else // XM_SSE_INTRINSICS_
- FLOAT fx = XMVectorGetByIndex(V,E0);
- FLOAT fy = XMVectorGetByIndex(V,E1);
- FLOAT fz = XMVectorGetByIndex(V,E2);
- FLOAT fw = XMVectorGetByIndex(V,E3);
- return _mm_set_ps( fw, fz, fy, fx );
- #endif
- }
- //------------------------------------------------------------------------------
- XMFINLINE XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateElements,
- UINT Select0, UINT Select1, UINT Select2, UINT Select3)
- {
- XMVECTOR Control = XMVectorSelectControl(Select0&1, Select1&1, Select2&1, Select3&1);
- return XMVectorSelect( VD, XMVectorRotateLeft(VS, VSLeftRotateElements), Control );
- }
- // Implemented for VMX128 intrinsics as #defines aboves
- #endif _XM_NO_INTRINSICS_ || _XM_SSE_INTRINSICS_
- //------------------------------------------------------------------------------
- #include "xnamathconvert.inl"
- #include "xnamathvector.inl"
- #include "xnamathmatrix.inl"
- #include "xnamathmisc.inl"
- #pragma warning(pop)
- #endif // __XNAMATH_H__
|