Skip to content

Commit 51802de

Browse files
committed
DirectXMath 3.07
1 parent aee6e90 commit 51802de

9 files changed

+778
-1299
lines changed

Inc/DirectXCollision.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ struct BoundingFrustum
281281
PlaneIntersectionType XM_CALLCONV Intersects( _In_ FXMVECTOR Plane ) const;
282282
// Plane-Frustum test
283283

284-
bool XM_CALLCONV Intersects( _In_ FXMVECTOR Origin, _In_ FXMVECTOR Direction, _Out_ float& Dist ) const;
284+
bool XM_CALLCONV Intersects( _In_ FXMVECTOR rayOrigin, _In_ FXMVECTOR Direction, _Out_ float& Dist ) const;
285285
// Ray-Frustum test
286286

287287
ContainmentType XM_CALLCONV ContainedBy( _In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, _In_ FXMVECTOR Plane2,

Inc/DirectXCollision.inl

+14-14
Original file line numberDiff line numberDiff line change
@@ -1290,13 +1290,13 @@ inline ContainmentType XM_CALLCONV BoundingBox::Contains( FXMVECTOR V0, FXMVECTO
12901290
XMVECTOR vCenter = XMLoadFloat3( &Center );
12911291
XMVECTOR vExtents = XMLoadFloat3( &Extents );
12921292

1293-
XMVECTOR d = XMVector3LengthSq( V0 - vCenter );
1293+
XMVECTOR d = XMVectorAbs( V0 - vCenter );
12941294
XMVECTOR Inside = XMVectorLessOrEqual( d, vExtents );
12951295

1296-
d = XMVector3LengthSq( V1 - vCenter );
1296+
d = XMVectorAbs( V1 - vCenter );
12971297
Inside = XMVectorAndInt( Inside, XMVectorLessOrEqual( d, vExtents ) );
12981298

1299-
d = XMVector3LengthSq( V2 - vCenter );
1299+
d = XMVectorAbs( V2 - vCenter );
13001300
Inside = XMVectorAndInt( Inside, XMVectorLessOrEqual( d, vExtents ) );
13011301

13021302
return ( XMVector3EqualInt( Inside, XMVectorTrueInt() ) ) ? CONTAINS : INTERSECTS;
@@ -1406,7 +1406,7 @@ inline ContainmentType BoundingBox::Contains( const BoundingOrientedBox& box ) c
14061406
for( size_t i=0; i < BoundingOrientedBox::CORNER_COUNT; ++i )
14071407
{
14081408
XMVECTOR C = XMVector3Rotate( oExtents * g_BoxOffset[i], oOrientation ) + oCenter;
1409-
XMVECTOR d = XMVector3LengthSq( C );
1409+
XMVECTOR d = XMVectorAbs(C);
14101410
Inside = XMVectorAndInt( Inside, XMVectorLessOrEqual( d, vExtents ) );
14111411
}
14121412

@@ -1434,7 +1434,7 @@ inline ContainmentType BoundingBox::Contains( const BoundingFrustum& fr ) const
14341434
for( size_t i=0; i < BoundingFrustum::CORNER_COUNT; ++i )
14351435
{
14361436
XMVECTOR Point = XMLoadFloat3( &Corners[i] );
1437-
XMVECTOR d = XMVector3LengthSq( Point - vCenter );
1437+
XMVECTOR d = XMVectorAbs( Point - vCenter );
14381438
Inside = XMVectorAndInt( Inside, XMVectorLessOrEqual( d, vExtents ) );
14391439
}
14401440

@@ -2547,11 +2547,11 @@ inline bool XM_CALLCONV BoundingOrientedBox::Intersects( FXMVECTOR Origin, FXMVE
25472547
{
25482548
assert( DirectX::Internal::XMVector3IsUnit( Direction ) );
25492549

2550-
static const XMVECTORI32 SelectY =
2550+
static const XMVECTORU32 SelectY =
25512551
{
25522552
XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0
25532553
};
2554-
static const XMVECTORI32 SelectZ =
2554+
static const XMVECTORU32 SelectZ =
25552555
{
25562556
XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0
25572557
};
@@ -3365,11 +3365,11 @@ inline bool BoundingFrustum::Intersects( const BoundingBox& box ) const
33653365
_Use_decl_annotations_
33663366
inline bool BoundingFrustum::Intersects( const BoundingOrientedBox& box ) const
33673367
{
3368-
static const XMVECTORI32 SelectY =
3368+
static const XMVECTORU32 SelectY =
33693369
{
33703370
XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0
33713371
};
3372-
static const XMVECTORI32 SelectZ =
3372+
static const XMVECTORU32 SelectZ =
33733373
{
33743374
XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0
33753375
};
@@ -4426,23 +4426,23 @@ inline bool XM_CALLCONV Intersects( FXMVECTOR Origin, FXMVECTOR Direction, FXMVE
44264426
_Use_decl_annotations_
44274427
inline bool XM_CALLCONV Intersects( FXMVECTOR A0, FXMVECTOR A1, FXMVECTOR A2, GXMVECTOR B0, HXMVECTOR B1, HXMVECTOR B2 )
44284428
{
4429-
static const XMVECTORI32 SelectY =
4429+
static const XMVECTORU32 SelectY =
44304430
{
44314431
XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0
44324432
};
4433-
static const XMVECTORI32 SelectZ =
4433+
static const XMVECTORU32 SelectZ =
44344434
{
44354435
XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0
44364436
};
4437-
static const XMVECTORI32 Select0111 =
4437+
static const XMVECTORU32 Select0111 =
44384438
{
44394439
XM_SELECT_0, XM_SELECT_1, XM_SELECT_1, XM_SELECT_1
44404440
};
4441-
static const XMVECTORI32 Select1011 =
4441+
static const XMVECTORU32 Select1011 =
44424442
{
44434443
XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_1
44444444
};
4445-
static const XMVECTORI32 Select1101 =
4445+
static const XMVECTORU32 Select1101 =
44464446
{
44474447
XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1
44484448
};

0 commit comments

Comments
 (0)