-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a37c65
commit 0d4660f
Showing
24 changed files
with
430 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1 KB
(100%)
...AndWrapers/newtonUnreal/newton/Binaries/ThirdParty/newtonLibrary/Win64/ExampleLibrary.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-672 KB
(84%)
.../newtonUnreal/newton/Source/ThirdParty/newtonLibrary/ExampleLibrary/x64/Release/vc143.pdb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTriangulatePolygon.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* Copyright (c) <2003-2022> <Julio Jerez, Newton Game Dynamics> | ||
* | ||
* This software is provided 'as-is', without any express or implied | ||
* warranty. In no event will the authors be held liable for any damages | ||
* arising from the use of this software. | ||
* | ||
* Permission is granted to anyone to use this software for any purpose, | ||
* including commercial applications, and to alter it and redistribute it | ||
* freely, subject to the following restrictions: | ||
* | ||
* 1. The origin of this software must not be misrepresented; you must not | ||
* claim that you wrote the original software. If you use this software | ||
* in a product, an acknowledgment in the product documentation would be | ||
* appreciated but is not required. | ||
* | ||
* 2. Altered source versions must be plainly marked as such, and must not be | ||
* misrepresented as being the original software. | ||
* | ||
* 3. This notice may not be removed or altered from any source distribution. | ||
*/ | ||
|
||
#include "ndCoreStdafx.h" | ||
#include "ndPolyhedra.h" | ||
#include "ndTriangulatePolygon.h" | ||
|
||
void ndTriangulatePolygon(ndVector* const points, ndInt32 count, ndArray<ndInt32>& triangles) | ||
{ | ||
triangles.SetCount(0); | ||
if (count < 3) | ||
{ | ||
return; | ||
} | ||
if (count == 3) | ||
{ | ||
triangles.PushBack(0); | ||
triangles.PushBack(1); | ||
triangles.PushBack(2); | ||
return; | ||
} | ||
|
||
ndInt32 index[256]; | ||
ndFixSizeArray<ndBigVector, 256> vertexBuffer; | ||
for (ndInt32 i = 0; i < count; ++i) | ||
{ | ||
index[i] = i; | ||
vertexBuffer.PushBack(points[i]); | ||
} | ||
|
||
ndPolyhedra polyhedra; | ||
polyhedra.BeginFace(); | ||
polyhedra.AddFace(count, index); | ||
polyhedra.EndFace(); | ||
|
||
ndPolyhedra leftOversOut; | ||
polyhedra.Triangulate(&vertexBuffer[0].m_x, sizeof(ndBigVector), &leftOversOut); | ||
|
||
ndInt32 mark = polyhedra.IncLRU(); | ||
ndPolyhedra::Iterator it(polyhedra); | ||
for (it.Begin(); it; it++) | ||
{ | ||
ndEdge* const edge = &it.GetNode()->GetInfo(); | ||
if (edge->m_mark != mark && (edge->m_incidentFace > 0)) | ||
{ | ||
ndAssert(edge == edge->m_next->m_next->m_next); | ||
edge->m_mark = mark; | ||
edge->m_next->m_mark = mark; | ||
edge->m_next->m_next->m_mark = mark; | ||
triangles.PushBack(edge->m_incidentVertex); | ||
triangles.PushBack(edge->m_next->m_incidentVertex); | ||
triangles.PushBack(edge->m_next->m_next->m_incidentVertex); | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...s/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/Public/dCore/ndTriangulatePolygon.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Copyright (c) <2003-2022> <Julio Jerez, Newton Game Dynamics> | ||
* | ||
* This software is provided 'as-is', without any express or implied | ||
* warranty. In no event will the authors be held liable for any damages | ||
* arising from the use of this software. | ||
* | ||
* Permission is granted to anyone to use this software for any purpose, | ||
* including commercial applications, and to alter it and redistribute it | ||
* freely, subject to the following restrictions: | ||
* | ||
* 1. The origin of this software must not be misrepresented; you must not | ||
* claim that you wrote the original software. If you use this software | ||
* in a product, an acknowledgment in the product documentation would be | ||
* appreciated but is not required. | ||
* | ||
* 2. Altered source versions must be plainly marked as such, and must not be | ||
* misrepresented as being the original software. | ||
* | ||
* 3. This notice may not be removed or altered from any source distribution. | ||
*/ | ||
|
||
#ifndef __ND_TRIANGULATE_POLYGON_H__ | ||
#define __ND_TRIANGULATE_POLYGON_H__ | ||
|
||
#include "ndCoreStdafx.h" | ||
#include "ndArray.h" | ||
#include "ndVector.h" | ||
|
||
D_CORE_API void ndTriangulatePolygon(ndVector* const vertexCloud2d, ndInt32 count, ndArray<ndInt32>& triangles); | ||
|
||
#endif |
Binary file modified
BIN
+1 KB
(100%)
...rapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.dll
Binary file not shown.
Binary file modified
BIN
+432 Bytes
(100%)
...rapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.lib
Binary file not shown.
Binary file modified
BIN
-2.63 MB
(79%)
...rapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/ExampleLibrary.pdb
Binary file not shown.
Binary file modified
BIN
-4.02 KB
(100%)
.../toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.lib
Binary file not shown.
Binary file modified
BIN
-224 KB
(82%)
.../toolsAndWrapers/newtonUnreal/newton/Source/ThirdParty/newtonLibrary/x64/Release/hacd.pdb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.