aboutsummaryrefslogtreecommitdiff
path: root/sdk/common
diff options
context:
space:
mode:
authorAnton Novoselov <[email protected]>2017-08-01 12:53:38 +0300
committerAnton Novoselov <[email protected]>2017-08-01 12:53:38 +0300
commit236f03c0b9a4982328ed1201978f7f69d192d9b2 (patch)
treee486f2fa39dba203563895541e92c60ed3e25759 /sdk/common
parentAdded screens to welcome page (diff)
downloadblast-236f03c0b9a4982328ed1201978f7f69d192d9b2.tar.xz
blast-236f03c0b9a4982328ed1201978f7f69d192d9b2.zip
Blast 1.1 release (windows / linux)
see docs/release_notes.txt for details
Diffstat (limited to 'sdk/common')
-rw-r--r--sdk/common/NvBlastArray.h67
-rw-r--r--sdk/common/NvBlastAssert.cpp37
-rw-r--r--sdk/common/NvBlastAssert.h42
-rw-r--r--sdk/common/NvBlastAtomic.cpp35
-rw-r--r--sdk/common/NvBlastAtomic.h36
-rw-r--r--sdk/common/NvBlastDLink.h36
-rw-r--r--sdk/common/NvBlastFixedArray.h36
-rw-r--r--sdk/common/NvBlastFixedBitmap.h36
-rw-r--r--sdk/common/NvBlastFixedBoolArray.h36
-rw-r--r--sdk/common/NvBlastFixedPriorityQueue.h36
-rw-r--r--sdk/common/NvBlastGeometry.h189
-rw-r--r--sdk/common/NvBlastHashMap.h55
-rw-r--r--sdk/common/NvBlastHashSet.h54
-rw-r--r--sdk/common/NvBlastIncludeWindows.h31
-rw-r--r--sdk/common/NvBlastIndexFns.h36
-rw-r--r--sdk/common/NvBlastIteratorBase.h36
-rw-r--r--sdk/common/NvBlastMath.h54
-rw-r--r--sdk/common/NvBlastMemory.h38
-rw-r--r--sdk/common/NvBlastPreprocessorInternal.h53
-rw-r--r--sdk/common/NvBlastTime.cpp36
-rw-r--r--sdk/common/NvBlastTime.h31
-rw-r--r--sdk/common/NvBlastTimers.cpp36
22 files changed, 835 insertions, 211 deletions
diff --git a/sdk/common/NvBlastArray.h b/sdk/common/NvBlastArray.h
new file mode 100644
index 0000000..48048d1
--- /dev/null
+++ b/sdk/common/NvBlastArray.h
@@ -0,0 +1,67 @@
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
+
+#ifndef NVBLASTARRAY_H
+#define NVBLASTARRAY_H
+
+
+#include "NvBlastAllocator.h"
+#include "PsInlineArray.h"
+
+
+namespace Nv
+{
+namespace Blast
+{
+
+/**
+Wrapped PxShared Array that uses NvBlastGlobals AllocatorCalllback.
+*/
+template <class T>
+struct Array
+{
+ typedef physx::shdfnd::Array<T, Allocator> type;
+};
+
+
+/**
+Wrapped PxShared InlineArray that uses NvBlastGlobals AllocatorCalllback.
+
+InlineArraya is array that pre-allocates for N elements.
+*/
+template <class T, uint32_t N>
+struct InlineArray
+{
+ typedef physx::shdfnd::InlineArray<T, N, Allocator> type;
+};
+
+} // namespace Blast
+} // namespace Nv
+
+
+#endif // #ifndef NVBLASTARRAY_H
diff --git a/sdk/common/NvBlastAssert.cpp b/sdk/common/NvBlastAssert.cpp
index 7731a53..0f2b316 100644
--- a/sdk/common/NvBlastAssert.cpp
+++ b/sdk/common/NvBlastAssert.cpp
@@ -1,12 +1,29 @@
-/*
- * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
- *
- * NVIDIA CORPORATION and its licensors retain all intellectual property
- * and proprietary rights in and to this software, related documentation
- * and any modifications thereto. Any use, reproduction, disclosure or
- * distribution of this software and related documentation without an express
- * license agreement from NVIDIA CORPORATION is strictly prohibited.
- */
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
#include "NvBlastAssert.h"
@@ -40,7 +57,7 @@ void NvBlastAssertHandler(const char* expr, const char* file, int line, bool& ig
if (ignore)
return;
__debugbreak();
-#elif (NV_WINDOWS_FAMILY && NV_CHECKED) || NV_CLANG
+#elif (NV_WINDOWS_FAMILY && NV_CHECKED)
__debugbreak();
#else
abort();
diff --git a/sdk/common/NvBlastAssert.h b/sdk/common/NvBlastAssert.h
index b1b7ca5..f121acc 100644
--- a/sdk/common/NvBlastAssert.h
+++ b/sdk/common/NvBlastAssert.h
@@ -1,12 +1,30 @@
-/*
- * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
- *
- * NVIDIA CORPORATION and its licensors retain all intellectual property
- * and proprietary rights in and to this software, related documentation
- * and any modifications thereto. Any use, reproduction, disclosure or
- * distribution of this software and related documentation without an express
- * license agreement from NVIDIA CORPORATION is strictly prohibited.
- */
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTASSERT_H
#define NVBLASTASSERT_H
@@ -17,7 +35,7 @@
#if !NV_ENABLE_ASSERTS
#define NVBLAST_ASSERT(exp) ((void)0)
-#define NVBLAST_ALWAYS_ASSERT_MESSAGE(exp) ((void)0)
+#define NVBLAST_ALWAYS_ASSERT_MESSAGE(message) ((void)0)
#define NVBLAST_ASSERT_WITH_MESSAGE(condition, message) ((void)0)
#else
#if NV_VC
@@ -33,12 +51,12 @@
if (!(exp) && !_ignore) NvBlastAssertHandler(#exp, __FILE__, __LINE__, _ignore); \
NVBLAST_CODE_ANALYSIS_ASSUME(exp); \
} ((void)0)
-#define NVBLAST_ALWAYS_ASSERT_MESSAGE(exp) \
+#define NVBLAST_ALWAYS_ASSERT_MESSAGE(message) \
{ \
static bool _ignore = false; \
if(!_ignore) \
{ \
- NvBlastAssertHandler(exp, __FILE__, __LINE__, _ignore); \
+ NvBlastAssertHandler(message, __FILE__, __LINE__, _ignore); \
} \
} ((void)0)
#define NVBLAST_ASSERT_WITH_MESSAGE(exp, message) \
diff --git a/sdk/common/NvBlastAtomic.cpp b/sdk/common/NvBlastAtomic.cpp
index 6b9d94b..4a79fbf 100644
--- a/sdk/common/NvBlastAtomic.cpp
+++ b/sdk/common/NvBlastAtomic.cpp
@@ -1,12 +1,29 @@
-/*
- * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
- *
- * NVIDIA CORPORATION and its licensors retain all intellectual property
- * and proprietary rights in and to this software, related documentation
- * and any modifications thereto. Any use, reproduction, disclosure or
- * distribution of this software and related documentation without an express
- * license agreement from NVIDIA CORPORATION is strictly prohibited.
- */
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
#include "NvBlastAtomic.h"
diff --git a/sdk/common/NvBlastAtomic.h b/sdk/common/NvBlastAtomic.h
index a3e6755..6eed1c0 100644
--- a/sdk/common/NvBlastAtomic.h
+++ b/sdk/common/NvBlastAtomic.h
@@ -1,12 +1,30 @@
-/*
- * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
- *
- * NVIDIA CORPORATION and its licensors retain all intellectual property
- * and proprietary rights in and to this software, related documentation
- * and any modifications thereto. Any use, reproduction, disclosure or
- * distribution of this software and related documentation without an express
- * license agreement from NVIDIA CORPORATION is strictly prohibited.
- */
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTATOMIC_H
#define NVBLASTATOMIC_H
diff --git a/sdk/common/NvBlastDLink.h b/sdk/common/NvBlastDLink.h
index bfcee24..b7bfaaa 100644
--- a/sdk/common/NvBlastDLink.h
+++ b/sdk/common/NvBlastDLink.h
@@ -1,12 +1,30 @@
-/*
- * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
- *
- * NVIDIA CORPORATION and its licensors retain all intellectual property
- * and proprietary rights in and to this software, related documentation
- * and any modifications thereto. Any use, reproduction, disclosure or
- * distribution of this software and related documentation without an express
- * license agreement from NVIDIA CORPORATION is strictly prohibited.
- */
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTDLINK_H
#define NVBLASTDLINK_H
diff --git a/sdk/common/NvBlastFixedArray.h b/sdk/common/NvBlastFixedArray.h
index 654158b..837b901 100644
--- a/sdk/common/NvBlastFixedArray.h
+++ b/sdk/common/NvBlastFixedArray.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTFIXEDARRAY_H
#define NVBLASTFIXEDARRAY_H
diff --git a/sdk/common/NvBlastFixedBitmap.h b/sdk/common/NvBlastFixedBitmap.h
index af835cf..b1743ed 100644
--- a/sdk/common/NvBlastFixedBitmap.h
+++ b/sdk/common/NvBlastFixedBitmap.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTFIXEDBITMAP_H
#define NVBLASTFIXEDBITMAP_H
diff --git a/sdk/common/NvBlastFixedBoolArray.h b/sdk/common/NvBlastFixedBoolArray.h
index 253bed6..deb9733 100644
--- a/sdk/common/NvBlastFixedBoolArray.h
+++ b/sdk/common/NvBlastFixedBoolArray.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTFIXEDBOOLARRAY_H
#define NVBLASTFIXEDBOOLARRAY_H
diff --git a/sdk/common/NvBlastFixedPriorityQueue.h b/sdk/common/NvBlastFixedPriorityQueue.h
index 5079edb..1855147 100644
--- a/sdk/common/NvBlastFixedPriorityQueue.h
+++ b/sdk/common/NvBlastFixedPriorityQueue.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTFIXEDPRIORITYQUEUE_H
#define NVBLASTFIXEDPRIORITYQUEUE_H
diff --git a/sdk/common/NvBlastGeometry.h b/sdk/common/NvBlastGeometry.h
index e83ff95..97220f5 100644
--- a/sdk/common/NvBlastGeometry.h
+++ b/sdk/common/NvBlastGeometry.h
@@ -1,12 +1,29 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
#ifndef NVBLASTGEOMETRY_H
@@ -14,36 +31,98 @@
#include "NvBlastTypes.h"
#include "NvBlastMath.h"
+#include "NvBlastAssert.h"
-#include<limits>
+#include <limits>
namespace Nv {
namespace Blast{
-NV_FORCE_INLINE uint32_t findNodeByPositionLinked(const float point[4],
+
+/**
+Find the closest node to point in the graph. Uses primarily distance to chunk centroids.
+Bond normals are expected to be directed from the lower to higher node index.
+Cannot be used for graph actors with only the world chunk in the graph.
+
+\param[in] point the point to test against
+\param[in] firstGraphNodeIndex the entry point for familyGraphNodeIndexLinks
+\param[in] familyGraphNodeIndexLinks the list index links of the actor's graph
+\param[in] adjacencyPartition the actor's SupportGraph adjacency partition
+\param[in] adjacentNodeIndices the actor's SupportGraph adjacent node indices
+\param[in] adjacentBondIndices the actor's SupportGraph adjacent bond indices
+\param[in] assetBonds the actor's asset bonds
+\param[in] bondHealths the actor's bond healths
+\param[in] assetChunks the actor's asset chunks
+\param[in] supportChunkHealths the actor's graph chunks healths
+\param[in] chunkIndices maps node index to chunk index in SupportGraph
+
+\return the index of the node closest to point
+*/
+NV_FORCE_INLINE uint32_t findClosestNode(const float point[4],
const uint32_t firstGraphNodeIndex, const uint32_t* familyGraphNodeIndexLinks,
const uint32_t* adjacencyPartition, const uint32_t* adjacentNodeIndices, const uint32_t* adjacentBondIndices,
- const NvBlastBond* bonds, const float* bondHealths)
+ const NvBlastBond* assetBonds, const float* bondHealths,
+ const NvBlastChunk* assetChunks, const float* supportChunkHealths, const uint32_t* chunkIndices)
{
+ // firstGraphNodeIndex could still be the world chunk, however
+ // there should be no way a single-node actor that is just the world chunk exists.
uint32_t nodeIndex = firstGraphNodeIndex;
+ // Since there should always be a regular chunk in the graph, it is possible to initialize closestNode
+ // as world chunk index but it would always evaluate to some meaningful node index eventually.
uint32_t closestNode = nodeIndex;
float minDist = std::numeric_limits<float>().max();
+ // find the closest healthy chunk in the graph by its centroid to point distance
while (!Nv::Blast::isInvalidIndex(nodeIndex))
{
+ if (supportChunkHealths[nodeIndex] > 0.0f)
+ {
+ uint32_t chunkIndex = chunkIndices[nodeIndex];
+ if (!isInvalidIndex(chunkIndex)) // Invalid if this is the world chunk
+ {
+ const NvBlastChunk& chunk = assetChunks[chunkIndex];
+ const float* centroid = chunk.centroid;
+
+ float d[3]; VecMath::sub(point, centroid, d);
+ float dist = VecMath::dot(d, d);
+
+ if (dist < minDist)
+ {
+ minDist = dist;
+ closestNode = nodeIndex;
+ }
+ }
+ }
+ nodeIndex = familyGraphNodeIndexLinks[nodeIndex];
+ }
+
+ // as long as the world chunk is not input as a single-node graph actor
+ NVBLAST_ASSERT(!isInvalidIndex(chunkIndices[closestNode]));
+
+ bool iterateOnBonds = true;
+ if (iterateOnBonds)
+ {
+ // improve geometric accuracy by looking on which side of the closest bond the point lies
+ // expects bond normals to point from the smaller to the larger node index
+
+ nodeIndex = closestNode;
+ minDist = std::numeric_limits<float>().max();
+
const uint32_t startIndex = adjacencyPartition[nodeIndex];
const uint32_t stopIndex = adjacencyPartition[nodeIndex + 1];
for (uint32_t adjacentIndex = startIndex; adjacentIndex < stopIndex; adjacentIndex++)
{
const uint32_t neighbourIndex = adjacentNodeIndices[adjacentIndex];
- if (nodeIndex < neighbourIndex)
+ const uint32_t neighbourChunk = chunkIndices[neighbourIndex];
+ if (!isInvalidIndex(neighbourChunk)) // Invalid if neighbor is the world chunk
{
const uint32_t bondIndex = adjacentBondIndices[adjacentIndex];
- if (bondHealths[bondIndex] > 0.0f)
+ // do not follow broken bonds, since it means that neighbor is not actually connected in the graph
+ if (bondHealths[bondIndex] > 0.0f && supportChunkHealths[neighbourIndex] > 0.0f)
{
- const NvBlastBond& bond = bonds[bondIndex];
+ const NvBlastBond& bond = assetBonds[bondIndex];
const float* centroid = bond.centroid;
float d[3]; VecMath::sub(point, centroid, d);
@@ -53,39 +132,67 @@ NV_FORCE_INLINE uint32_t findNodeByPositionLinked(const float point[4],
{
minDist = dist;
float s = VecMath::dot(d, bond.normal);
- closestNode = s < 0 ? nodeIndex : neighbourIndex;
+ if (nodeIndex < neighbourIndex)
+ {
+ closestNode = s < 0.0f ? nodeIndex : neighbourIndex;
+ }
+ else
+ {
+ closestNode = s < 0.0f ? neighbourIndex : nodeIndex;
+ }
}
}
}
}
- nodeIndex = familyGraphNodeIndexLinks[nodeIndex];
}
return closestNode;
}
-NV_FORCE_INLINE uint32_t findNodeByPosition(const float point[4],
- const uint32_t graphNodesCount, const uint32_t* graphNodeIndices,
+/**
+Find the closest node to point in the graph. Uses primarily distance to bond centroids.
+Slower compared to chunk based lookup but may yield better accuracy in some cases.
+Bond normals are expected to be directed from the lower to higher node index.
+Cannot be used for graph actors with only the world chunk in the graph.
+
+\param[in] point the point to test against
+\param[in] firstGraphNodeIndex the entry point for familyGraphNodeIndexLinks
+\param[in] familyGraphNodeIndexLinks the list index links of the actor's graph
+\param[in] adjacencyPartition the actor's SupportGraph adjacency partition
+\param[in] adjacentNodeIndices the actor's SupportGraph adjacent node indices
+\param[in] adjacentBondIndices the actor's SupportGraph adjacent bond indices
+\param[in] assetBonds the actor's asset bonds
+\param[in] bondHealths the actor's bond healths
+\param[in] chunkIndices maps node index to chunk index in SupportGraph
+
+\return the index of the node closest to point
+*/
+NV_FORCE_INLINE uint32_t findClosestNode(const float point[4],
+ const uint32_t firstGraphNodeIndex, const uint32_t* familyGraphNodeIndexLinks,
const uint32_t* adjacencyPartition, const uint32_t* adjacentNodeIndices, const uint32_t* adjacentBondIndices,
- const NvBlastBond* bonds, const float* bondHealths)
+ const NvBlastBond* bonds, const float* bondHealths, const uint32_t* chunkIndices)
{
- uint32_t closestNode = graphNodesCount > 2 ? invalidIndex<uint32_t>() : graphNodeIndices[0];
+ // firstGraphNodeIndex could still be the world chunk, however
+ // there should be no way a single-node actor that is just the world chunk exists.
+ uint32_t nodeIndex = firstGraphNodeIndex;
+ // Since there should always be a regular chunk in the graph, it is possible to initialize closestNode
+ // as world chunk index but it would always evaluate to some meaningful node index eventually.
+ uint32_t closestNode = nodeIndex;
float minDist = std::numeric_limits<float>().max();
- for (uint32_t i = 0; i < graphNodesCount; i++)
+ while (!Nv::Blast::isInvalidIndex(nodeIndex))
{
- const uint32_t nodeIndex = graphNodeIndices[i];
const uint32_t startIndex = adjacencyPartition[nodeIndex];
const uint32_t stopIndex = adjacencyPartition[nodeIndex + 1];
for (uint32_t adjacentIndex = startIndex; adjacentIndex < stopIndex; adjacentIndex++)
{
- const uint32_t bondIndex = adjacentBondIndices[adjacentIndex];
- if (bondHealths[bondIndex] > 0.0f)
+ const uint32_t neighbourIndex = adjacentNodeIndices[adjacentIndex];
+ if (nodeIndex < neighbourIndex)
{
- const uint32_t neighbourIndex = adjacentNodeIndices[adjacentIndex];
- if (nodeIndex < neighbourIndex)
+ const uint32_t bondIndex = adjacentBondIndices[adjacentIndex];
+ if (bondHealths[bondIndex] > 0.0f)
{
const NvBlastBond& bond = bonds[bondIndex];
@@ -96,25 +203,33 @@ NV_FORCE_INLINE uint32_t findNodeByPosition(const float point[4],
if (dist < minDist)
{
minDist = dist;
- float s = VecMath::dot(d, bond.normal);
- closestNode = s < 0 ? nodeIndex : neighbourIndex;
+ // if any of the nodes is the world chunk, use the valid one instead
+ if (isInvalidIndex(chunkIndices[neighbourIndex]))
+ {
+ closestNode = nodeIndex;
+ }
+ else if (isInvalidIndex(chunkIndices[nodeIndex]))
+ {
+ closestNode = neighbourIndex;
+ }
+ else
+ {
+ float s = VecMath::dot(d, bond.normal);
+ closestNode = s < 0 ? nodeIndex : neighbourIndex;
+ }
}
}
}
}
+ nodeIndex = familyGraphNodeIndexLinks[nodeIndex];
}
+
+ // as long as the world chunk is not input as a single-node graph actor
+ NVBLAST_ASSERT(!isInvalidIndex(chunkIndices[closestNode]));
return closestNode;
}
-NV_FORCE_INLINE uint32_t findNodeByPosition(const float point[4],
- const uint32_t graphNodesCount, const uint32_t* graphNodeIndices,
- const NvBlastSupportGraph& graph,
- const NvBlastBond* bonds, const float* bondHealths)
-{
- return findNodeByPosition(point, graphNodesCount, graphNodeIndices, graph.adjacencyPartition, graph.adjacentNodeIndices, graph.adjacentBondIndices, bonds, bondHealths);
-}
-
} // namespace Blast
} // namespace Nv
diff --git a/sdk/common/NvBlastHashMap.h b/sdk/common/NvBlastHashMap.h
new file mode 100644
index 0000000..ddfaa04
--- /dev/null
+++ b/sdk/common/NvBlastHashMap.h
@@ -0,0 +1,55 @@
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
+
+#ifndef NVBLASTHASHMAP_H
+#define NVBLASTHASHMAP_H
+
+
+#include "NvBlastAllocator.h"
+#include "PsHashMap.h"
+
+
+namespace Nv
+{
+namespace Blast
+{
+
+/**
+Wrapped PxShared HashMap that uses NvBlastGlobals AllocatorCalllback.
+*/
+template <class Key, class Value, class HashFn = physx::shdfnd::Hash<Key>>
+struct HashMap
+{
+ typedef physx::shdfnd::HashMap<Key, Value, HashFn, Allocator> type;
+};
+
+} // namespace Blast
+} // namespace Nv
+
+
+#endif // #ifndef NVBLASTHASHMAP_H
diff --git a/sdk/common/NvBlastHashSet.h b/sdk/common/NvBlastHashSet.h
new file mode 100644
index 0000000..3f31462
--- /dev/null
+++ b/sdk/common/NvBlastHashSet.h
@@ -0,0 +1,54 @@
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
+
+#ifndef NVBLASTHASHSET_H
+#define NVBLASTHASHSET_H
+
+
+#include "NvBlastAllocator.h"
+#include "PsHashSet.h"
+
+namespace Nv
+{
+namespace Blast
+{
+
+/**
+Wrapped PxShared HashSet that uses NvBlastGlobals AllocatorCalllback.
+*/
+template <class Key, class HashFn = physx::shdfnd::Hash<Key>>
+struct HashSet
+{
+ typedef physx::shdfnd::HashSet<Key, HashFn, Allocator> type;
+};
+
+} // namespace Blast
+} // namespace Nv
+
+
+#endif // #ifndef NVBLASTHASHSET_H
diff --git a/sdk/common/NvBlastIncludeWindows.h b/sdk/common/NvBlastIncludeWindows.h
index 9115fd4..86a5818 100644
--- a/sdk/common/NvBlastIncludeWindows.h
+++ b/sdk/common/NvBlastIncludeWindows.h
@@ -3,15 +3,28 @@
//
// Notice
// NVIDIA Corporation and its licensors retain all intellectual property and
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTINCLUDEWINDOWS_H
#define NVBLASTINCLUDEWINDOWS_H
diff --git a/sdk/common/NvBlastIndexFns.h b/sdk/common/NvBlastIndexFns.h
index a800a73..b4154ad 100644
--- a/sdk/common/NvBlastIndexFns.h
+++ b/sdk/common/NvBlastIndexFns.h
@@ -1,12 +1,30 @@
-/*
- * Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved.
- *
- * NVIDIA CORPORATION and its licensors retain all intellectual property
- * and proprietary rights in and to this software, related documentation
- * and any modifications thereto. Any use, reproduction, disclosure or
- * distribution of this software and related documentation without an express
- * license agreement from NVIDIA CORPORATION is strictly prohibited.
- */
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2008-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTINDEXFNS_H
#define NVBLASTINDEXFNS_H
diff --git a/sdk/common/NvBlastIteratorBase.h b/sdk/common/NvBlastIteratorBase.h
index 9053f4b..2de8d09 100644
--- a/sdk/common/NvBlastIteratorBase.h
+++ b/sdk/common/NvBlastIteratorBase.h
@@ -1,12 +1,30 @@
-/*
- * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
- *
- * NVIDIA CORPORATION and its licensors retain all intellectual property
- * and proprietary rights in and to this software, related documentation
- * and any modifications thereto. Any use, reproduction, disclosure or
- * distribution of this software and related documentation without an express
- * license agreement from NVIDIA CORPORATION is strictly prohibited.
- */
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTITERATORBASE_H
#define NVBLASTITERATORBASE_H
diff --git a/sdk/common/NvBlastMath.h b/sdk/common/NvBlastMath.h
index 0a29f14..4a4522e 100644
--- a/sdk/common/NvBlastMath.h
+++ b/sdk/common/NvBlastMath.h
@@ -1,12 +1,30 @@
-/*
- * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
- *
- * NVIDIA CORPORATION and its licensors retain all intellectual property
- * and proprietary rights in and to this software, related documentation
- * and any modifications thereto. Any use, reproduction, disclosure or
- * distribution of this software and related documentation without an express
- * license agreement from NVIDIA CORPORATION is strictly prohibited.
- */
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTMATH_H
#define NVBLASTMATH_H
@@ -60,13 +78,25 @@ NV_INLINE float dot(const float a[3], const float b[3])
return r;
}
+NV_INLINE float length(const float a[3])
+{
+ return sqrtf(dot(a, a));
+}
+
+NV_INLINE float dist(const float a[3], const float b[3])
+{
+ float v[3];
+ sub(a, b, v);
+ return length(v);
+}
+
NV_INLINE float normal(const float a[3], float r[3])
{
- float length = sqrtf(dot(a, a));
+ float d = length(a);
for (int i = 0; i < 3; i++)
- r[i] = a[i] / length;
+ r[i] = a[i] / d;
- return length;
+ return d;
}
diff --git a/sdk/common/NvBlastMemory.h b/sdk/common/NvBlastMemory.h
index 0fb6a06..e21854e 100644
--- a/sdk/common/NvBlastMemory.h
+++ b/sdk/common/NvBlastMemory.h
@@ -1,12 +1,30 @@
-/*
- * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
- *
- * NVIDIA CORPORATION and its licensors retain all intellectual property
- * and proprietary rights in and to this software, related documentation
- * and any modifications thereto. Any use, reproduction, disclosure or
- * distribution of this software and related documentation without an express
- * license agreement from NVIDIA CORPORATION is strictly prohibited.
- */
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTMEMORY_H
#define NVBLASTMEMORY_H
@@ -104,7 +122,7 @@ align16(_lastOffset + _lastSize)
#include <malloc.h>
#define NvBlastAlloca(x) _alloca(x)
#elif NV_LINUX || NV_ANDROID
-#include <malloc.h>
+#include <alloca.h>
#define NvBlastAlloca(x) alloca(x)
#elif NV_APPLE_FAMILY
#include <alloca.h>
diff --git a/sdk/common/NvBlastPreprocessorInternal.h b/sdk/common/NvBlastPreprocessorInternal.h
index 2d3e185..c6ef511 100644
--- a/sdk/common/NvBlastPreprocessorInternal.h
+++ b/sdk/common/NvBlastPreprocessorInternal.h
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTPREPROCESSORINTERNAL_H
#define NVBLASTPREPROCESSORINTERNAL_H
@@ -15,12 +33,21 @@
#include "NvPreprocessor.h"
+/**
+Macros for more convenient logging
+*/
+#define NVBLASTLL_LOG_ERROR(_logFn, _msg) if (_logFn != nullptr) { _logFn(NvBlastMessage::Error, _msg, __FILE__, __LINE__); } ((void)0)
+#define NVBLASTLL_LOG_WARNING(_logFn, _msg) if (_logFn != nullptr) { _logFn(NvBlastMessage::Warning, _msg, __FILE__, __LINE__); } ((void)0)
+#define NVBLASTLL_LOG_INFO(_logFn, _msg) if (_logFn != nullptr) { _logFn(NvBlastMessage::Info, _msg, __FILE__, __LINE__); } ((void)0)
+#define NVBLASTLL_LOG_DEBUG(_logFn, _msg) if (_logFn != nullptr) { _logFn(NvBlastMessage::Debug, _msg, __FILE__, __LINE__); } ((void)0)
+
+
/** Blast will check function parameters for debug and checked builds. */
-#define NVBLAST_CHECK_PARAMS (NV_DEBUG || NV_CHECKED)
+#define NVBLASTLL_CHECK_PARAMS (NV_DEBUG || NV_CHECKED)
-#if NVBLAST_CHECK_PARAMS
-#define NVBLAST_CHECK(_expr, _logFn, _msg, _onFail) \
+#if NVBLASTLL_CHECK_PARAMS
+#define NVBLASTLL_CHECK(_expr, _logFn, _msg, _onFail) \
{ \
if(!(_expr)) \
{ \
@@ -29,7 +56,7 @@
} \
}
#else
-#define NVBLAST_CHECK(_expr, _logFn, _msg, _onFail) NV_UNUSED(_logFn)
+#define NVBLASTLL_CHECK(_expr, _logFn, _msg, _onFail) NV_UNUSED(_logFn)
#endif
diff --git a/sdk/common/NvBlastTime.cpp b/sdk/common/NvBlastTime.cpp
index b16e573..035d45e 100644
--- a/sdk/common/NvBlastTime.cpp
+++ b/sdk/common/NvBlastTime.cpp
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#include "NvBlastTime.h"
#include "NvBlast.h"
diff --git a/sdk/common/NvBlastTime.h b/sdk/common/NvBlastTime.h
index 47af36b..3cac5f7 100644
--- a/sdk/common/NvBlastTime.h
+++ b/sdk/common/NvBlastTime.h
@@ -3,15 +3,28 @@
//
// Notice
// NVIDIA Corporation and its licensors retain all intellectual property and
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#ifndef NVBLASTTIME_H
#define NVBLASTTIME_H
diff --git a/sdk/common/NvBlastTimers.cpp b/sdk/common/NvBlastTimers.cpp
index ec93134..4527e1f 100644
--- a/sdk/common/NvBlastTimers.cpp
+++ b/sdk/common/NvBlastTimers.cpp
@@ -1,12 +1,30 @@
-/*
-* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
-*
-* NVIDIA CORPORATION and its licensors retain all intellectual property
-* and proprietary rights in and to this software, related documentation
-* and any modifications thereto. Any use, reproduction, disclosure or
-* distribution of this software and related documentation without an express
-* license agreement from NVIDIA CORPORATION is strictly prohibited.
-*/
+// This code contains NVIDIA Confidential Information and is disclosed to you
+// under a form of NVIDIA software license agreement provided separately to you.
+//
+// Notice
+// NVIDIA Corporation and its licensors retain all intellectual property and
+// proprietary rights in and to this software and related documentation and
+// any modifications thereto. Any use, reproduction, disclosure, or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA Corporation is strictly prohibited.
+//
+// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
+// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
+// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
+// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// Information and code furnished is believed to be accurate and reliable.
+// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
+// information or for any infringement of patents or other rights of third parties that may
+// result from its use. No license is granted by implication or otherwise under any patent
+// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
+// This code supersedes and replaces all information previously supplied.
+// NVIDIA Corporation products are not authorized for use as critical
+// components in life support devices or systems without express written approval of
+// NVIDIA Corporation.
+//
+// Copyright (c) 2016-2017 NVIDIA Corporation. All rights reserved.
+
#include "NvBlast.h"
#include "NvBlastTime.h"