@@ -1290,13 +1290,13 @@ inline ContainmentType XM_CALLCONV BoundingBox::Contains( FXMVECTOR V0, FXMVECTO
1290
1290
XMVECTOR vCenter = XMLoadFloat3 ( &Center );
1291
1291
XMVECTOR vExtents = XMLoadFloat3 ( &Extents );
1292
1292
1293
- XMVECTOR d = XMVector3LengthSq ( V0 - vCenter );
1293
+ XMVECTOR d = XMVectorAbs ( V0 - vCenter );
1294
1294
XMVECTOR Inside = XMVectorLessOrEqual ( d, vExtents );
1295
1295
1296
- d = XMVector3LengthSq ( V1 - vCenter );
1296
+ d = XMVectorAbs ( V1 - vCenter );
1297
1297
Inside = XMVectorAndInt ( Inside, XMVectorLessOrEqual ( d, vExtents ) );
1298
1298
1299
- d = XMVector3LengthSq ( V2 - vCenter );
1299
+ d = XMVectorAbs ( V2 - vCenter );
1300
1300
Inside = XMVectorAndInt ( Inside, XMVectorLessOrEqual ( d, vExtents ) );
1301
1301
1302
1302
return ( XMVector3EqualInt ( Inside, XMVectorTrueInt () ) ) ? CONTAINS : INTERSECTS;
@@ -1406,7 +1406,7 @@ inline ContainmentType BoundingBox::Contains( const BoundingOrientedBox& box ) c
1406
1406
for ( size_t i=0 ; i < BoundingOrientedBox::CORNER_COUNT; ++i )
1407
1407
{
1408
1408
XMVECTOR C = XMVector3Rotate ( oExtents * g_BoxOffset[i], oOrientation ) + oCenter;
1409
- XMVECTOR d = XMVector3LengthSq ( C );
1409
+ XMVECTOR d = XMVectorAbs (C );
1410
1410
Inside = XMVectorAndInt ( Inside, XMVectorLessOrEqual ( d, vExtents ) );
1411
1411
}
1412
1412
@@ -1434,7 +1434,7 @@ inline ContainmentType BoundingBox::Contains( const BoundingFrustum& fr ) const
1434
1434
for ( size_t i=0 ; i < BoundingFrustum::CORNER_COUNT; ++i )
1435
1435
{
1436
1436
XMVECTOR Point = XMLoadFloat3 ( &Corners[i] );
1437
- XMVECTOR d = XMVector3LengthSq ( Point - vCenter );
1437
+ XMVECTOR d = XMVectorAbs ( Point - vCenter );
1438
1438
Inside = XMVectorAndInt ( Inside, XMVectorLessOrEqual ( d, vExtents ) );
1439
1439
}
1440
1440
@@ -2547,11 +2547,11 @@ inline bool XM_CALLCONV BoundingOrientedBox::Intersects( FXMVECTOR Origin, FXMVE
2547
2547
{
2548
2548
assert ( DirectX::Internal::XMVector3IsUnit ( Direction ) );
2549
2549
2550
- static const XMVECTORI32 SelectY =
2550
+ static const XMVECTORU32 SelectY =
2551
2551
{
2552
2552
XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0
2553
2553
};
2554
- static const XMVECTORI32 SelectZ =
2554
+ static const XMVECTORU32 SelectZ =
2555
2555
{
2556
2556
XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0
2557
2557
};
@@ -3365,11 +3365,11 @@ inline bool BoundingFrustum::Intersects( const BoundingBox& box ) const
3365
3365
_Use_decl_annotations_
3366
3366
inline bool BoundingFrustum::Intersects ( const BoundingOrientedBox& box ) const
3367
3367
{
3368
- static const XMVECTORI32 SelectY =
3368
+ static const XMVECTORU32 SelectY =
3369
3369
{
3370
3370
XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0
3371
3371
};
3372
- static const XMVECTORI32 SelectZ =
3372
+ static const XMVECTORU32 SelectZ =
3373
3373
{
3374
3374
XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0
3375
3375
};
@@ -4426,23 +4426,23 @@ inline bool XM_CALLCONV Intersects( FXMVECTOR Origin, FXMVECTOR Direction, FXMVE
4426
4426
_Use_decl_annotations_
4427
4427
inline bool XM_CALLCONV Intersects ( FXMVECTOR A0, FXMVECTOR A1, FXMVECTOR A2, GXMVECTOR B0, HXMVECTOR B1, HXMVECTOR B2 )
4428
4428
{
4429
- static const XMVECTORI32 SelectY =
4429
+ static const XMVECTORU32 SelectY =
4430
4430
{
4431
4431
XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0
4432
4432
};
4433
- static const XMVECTORI32 SelectZ =
4433
+ static const XMVECTORU32 SelectZ =
4434
4434
{
4435
4435
XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0
4436
4436
};
4437
- static const XMVECTORI32 Select0111 =
4437
+ static const XMVECTORU32 Select0111 =
4438
4438
{
4439
4439
XM_SELECT_0, XM_SELECT_1, XM_SELECT_1, XM_SELECT_1
4440
4440
};
4441
- static const XMVECTORI32 Select1011 =
4441
+ static const XMVECTORU32 Select1011 =
4442
4442
{
4443
4443
XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_1
4444
4444
};
4445
- static const XMVECTORI32 Select1101 =
4445
+ static const XMVECTORU32 Select1101 =
4446
4446
{
4447
4447
XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1
4448
4448
};
0 commit comments