Skip to content

Commit

Permalink
DirectXMath 3.07
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed May 23, 2016
1 parent aee6e90 commit 51802de
Show file tree
Hide file tree
Showing 9 changed files with 778 additions and 1,299 deletions.
2 changes: 1 addition & 1 deletion Inc/DirectXCollision.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ struct BoundingFrustum
PlaneIntersectionType XM_CALLCONV Intersects( _In_ FXMVECTOR Plane ) const;
// Plane-Frustum test

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

ContainmentType XM_CALLCONV ContainedBy( _In_ FXMVECTOR Plane0, _In_ FXMVECTOR Plane1, _In_ FXMVECTOR Plane2,
Expand Down
28 changes: 14 additions & 14 deletions Inc/DirectXCollision.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1290,13 +1290,13 @@ inline ContainmentType XM_CALLCONV BoundingBox::Contains( FXMVECTOR V0, FXMVECTO
XMVECTOR vCenter = XMLoadFloat3( &Center );
XMVECTOR vExtents = XMLoadFloat3( &Extents );

XMVECTOR d = XMVector3LengthSq( V0 - vCenter );
XMVECTOR d = XMVectorAbs( V0 - vCenter );
XMVECTOR Inside = XMVectorLessOrEqual( d, vExtents );

d = XMVector3LengthSq( V1 - vCenter );
d = XMVectorAbs( V1 - vCenter );
Inside = XMVectorAndInt( Inside, XMVectorLessOrEqual( d, vExtents ) );

d = XMVector3LengthSq( V2 - vCenter );
d = XMVectorAbs( V2 - vCenter );
Inside = XMVectorAndInt( Inside, XMVectorLessOrEqual( d, vExtents ) );

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

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

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

static const XMVECTORI32 SelectY =
static const XMVECTORU32 SelectY =
{
XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0
};
static const XMVECTORI32 SelectZ =
static const XMVECTORU32 SelectZ =
{
XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0
};
Expand Down Expand Up @@ -3365,11 +3365,11 @@ inline bool BoundingFrustum::Intersects( const BoundingBox& box ) const
_Use_decl_annotations_
inline bool BoundingFrustum::Intersects( const BoundingOrientedBox& box ) const
{
static const XMVECTORI32 SelectY =
static const XMVECTORU32 SelectY =
{
XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0
};
static const XMVECTORI32 SelectZ =
static const XMVECTORU32 SelectZ =
{
XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0
};
Expand Down Expand Up @@ -4426,23 +4426,23 @@ inline bool XM_CALLCONV Intersects( FXMVECTOR Origin, FXMVECTOR Direction, FXMVE
_Use_decl_annotations_
inline bool XM_CALLCONV Intersects( FXMVECTOR A0, FXMVECTOR A1, FXMVECTOR A2, GXMVECTOR B0, HXMVECTOR B1, HXMVECTOR B2 )
{
static const XMVECTORI32 SelectY =
static const XMVECTORU32 SelectY =
{
XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0
};
static const XMVECTORI32 SelectZ =
static const XMVECTORU32 SelectZ =
{
XM_SELECT_0, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0
};
static const XMVECTORI32 Select0111 =
static const XMVECTORU32 Select0111 =
{
XM_SELECT_0, XM_SELECT_1, XM_SELECT_1, XM_SELECT_1
};
static const XMVECTORI32 Select1011 =
static const XMVECTORU32 Select1011 =
{
XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_1
};
static const XMVECTORI32 Select1101 =
static const XMVECTORU32 Select1101 =
{
XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1
};
Expand Down
Loading

0 comments on commit 51802de

Please sign in to comment.