{"TotalCount":1696,"Files":[{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/BridgeTriangleConvexcastCallback.cs","FileName":"BridgeTriangleConvexcastCallback.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System.Diagnostics;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletDynamics;\nusing System;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class BridgeTriangleConvexcastCallback : TriangleConvexcastCallback, IDisposable\n{\n\tpublic BridgeTriangleConvexcastCallback()\n\t{\n\t} // for pool\n\n\tpublic BridgeTriangleConvexcastCallback(ConvexShape castShape, ref IndexedMatrix from, ref IndexedMatrix to, ConvexResultCallback resultCallback, CollisionObject collisionObject, ConcaveShape triangleMesh, ref IndexedMatrix triangleToWorld) : base(castShape, ref from, ref to, ref triangleToWorld, triangleMesh.GetMargin())\n\t{\n\t\tm_resultCallback = resultCallback;\n\t\tm_collisionObject = collisionObject;\n\t\tm_triangleMesh = triangleMesh;\n\t}\n\n\tpublic void Initialize(ConvexShape castShape, ref IndexedMatrix from, ref IndexedMatrix to, ConvexResultCallback resultCallback, CollisionObject collisionObject, ConcaveShape triangleMesh, ref IndexedMatrix triangleToWorld)\n\t{\n\t\tbase.Initialize(castShape, ref from, ref to, ref triangleToWorld, triangleMesh.GetMargin());\n\t\tm_resultCallback = resultCallback;\n\t\tm_collisionObject = collisionObject;\n\t\tm_triangleMesh = triangleMesh;\n\t}\n\n\tpublic override float ReportHit(ref IndexedVector3 hitNormalLocal, ref IndexedVector3 hitPointLocal, float hitFraction, int partId, int triangleIndex)\n\t{\n\t\tLocalShapeInfo shapeInfo = new LocalShapeInfo();\n\t\tshapeInfo.m_shapePart = partId;\n\t\tshapeInfo.m_triangleIndex = triangleIndex;\n\t\tif (hitFraction \u003C= m_resultCallback.m_closestHitFraction)\n\t\t{\n\t\t\tLocalConvexResult convexResult = new LocalConvexResult(m_collisionObject, ref shapeInfo, ref hitNormalLocal, ref hitPointLocal, hitFraction);\n\t\t\tbool normalInWorldSpace = m_triangleMesh is TriangleMeshShape;\n\t\t\treturn m_resultCallback.AddSingleResult(ref convexResult, normalInWorldSpace);\n\t\t}\n\n\t\treturn hitFraction;\n\t}\n\n\tpublic void Dispose()\n\t{\n\t\tCleanup();\n\t\tBulletGlobals.BridgeTriangleConvexcastCallbackPool.Free(this);\n\t}\n\n\tConvexResultCallback m_resultCallback;\n\tCollisionObject m_collisionObject;\n\tConcaveShape m_triangleMesh;\n};"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/CONTACT_KEY_TOKEN.cs","FileName":"CONTACT_KEY_TOKEN.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n *\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\nThis source file is part of GIMPACT Library.\n\nFor the latest info, see http://gimpact.sourceforge.net/\n\nCopyright (c) 2007 Francisco Leon Najera. C.C. 80087371.\nemail: projectileman@yahoo.com\n\n\nThis software is provided \u0027as-is\u0027, without any express or implied warranty.\nIn no event will the authors be held liable for any damages arising from the use of this software.\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it freely,\nsubject to the following restrictions:\n\n1. 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.\n2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n*/\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class CONTACT_KEY_TOKEN\n{\n\tpublic uint m_key;\n\tpublic int m_value;\n\tpublic CONTACT_KEY_TOKEN()\n\t{\n\t}\n\n\tpublic CONTACT_KEY_TOKEN(uint key, int token)\n\t{\n\t\tm_key = key;\n\t\tm_value = token;\n\t}\n\n\tpublic CONTACT_KEY_TOKEN(CONTACT_KEY_TOKEN rtoken)\n\t{\n\t\tm_key = rtoken.m_key;\n\t\tm_value = rtoken.m_value;\n\t}\n\n\tpublic static int SortPredicate(CONTACT_KEY_TOKEN lhs, CONTACT_KEY_TOKEN rhs)\n\t{\n\t\treturn lhs.m_key \u003C rhs.m_key ? 1 : -1;\n\t}\n//public bool operator \u003C(CONTACT_KEY_TOKEN other)\n//{\n//    return (m_key \u003C other.m_key);\n//}\n//public bool operator \u003E(CONTACT_KEY_TOKEN other)\n//{\n//    return (m_key \u003E other.m_key);\n//}\n};"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/ContactManifoldTypes.cs","FileName":"ContactManifoldTypes.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System;\nusing System.Diagnostics;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal enum ContactManifoldTypes\n{\n\tMIN_CONTACT_MANIFOLD_TYPE = 1024,\n\tBT_PERSISTENT_MANIFOLD_TYPE\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/ConvexConvexCreateFunc.cs","FileName":"ConvexConvexCreateFunc.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System.Diagnostics;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class ConvexConvexCreateFunc : CollisionAlgorithmCreateFunc\n{\n\tpublic ConvexConvexCreateFunc(ISimplexSolverInterface simplexSolver, IConvexPenetrationDepthSolver depthSolver)\n\t{\n\t\tm_numPerturbationIterations = 0;\n\t\tm_minimumPointsPerturbationThreshold = 3;\n\t\tm_simplexSolver = simplexSolver;\n\t\tm_pdSolver = depthSolver;\n\t}\n\n\tpublic override CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1)\n\t{\n\t\tConvexConvexAlgorithm cca = BulletGlobals.ConvexConvexAlgorithmPool.Get();\n\t\tcca.Initialize(ci.GetManifold(), ci, body0, body1, m_simplexSolver, m_pdSolver, m_numPerturbationIterations, m_minimumPointsPerturbationThreshold);\n\t\treturn cca;\n\t}\n\n\tpublic IConvexPenetrationDepthSolver m_pdSolver;\n\tpublic ISimplexSolverInterface m_simplexSolver;\n\tpublic int m_numPerturbationIterations;\n\tpublic int m_minimumPointsPerturbationThreshold;\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/ConvexPointCloudShape.cs","FileName":"ConvexPointCloudShape.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class ConvexPointCloudShape : PolyhedralConvexAabbCachingShape\n{\n\tpublic ConvexPointCloudShape()\n\t{\n\t\tm_localScaling = new IndexedVector3(1);\n\t\tm_shapeType = BroadphaseNativeTypes.CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE;\n\t\tm_unscaledPoints = null;\n\t\tm_numPoints = 0;\n\t}\n\n\tpublic ConvexPointCloudShape(IList\u003CIndexedVector3\u003E points, int numPoints, ref IndexedVector3 localScaling, bool computeAabb)\n\t{\n\t\tm_localScaling = localScaling;\n\t\tm_shapeType = BroadphaseNativeTypes.CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE;\n\t\tm_unscaledPoints = points;\n\t\tm_numPoints = numPoints;\n\t\tif (computeAabb)\n\t\t{\n\t\t\tRecalcLocalAabb();\n\t\t}\n\t}\n\n\tpublic void SetPoints(IList\u003CIndexedVector3\u003E points, int numPoints, bool computeAabb)\n\t{\n\t\tIndexedVector3 localScaling = new IndexedVector3(1);\n\t\tSetPoints(points, numPoints, computeAabb, ref localScaling);\n\t}\n\n\tpublic void SetPoints(IList\u003CIndexedVector3\u003E points, int numPoints, bool computeAabb, ref IndexedVector3 localScaling)\n\t{\n\t\tm_unscaledPoints = points;\n\t\tm_numPoints = numPoints;\n\t\tm_localScaling = localScaling;\n\t\tif (computeAabb)\n\t\t{\n\t\t\tRecalcLocalAabb();\n\t\t}\n\t}\n\n\tpublic IList\u003CIndexedVector3\u003E GetUnscaledPoints()\n\t{\n\t\treturn m_unscaledPoints;\n\t}\n\n\tpublic int GetNumPoints()\n\t{\n\t\treturn m_numPoints;\n\t}\n\n\tpublic IndexedVector3 GetScaledPoint(int index)\n\t{\n\t\treturn m_unscaledPoints[index] * m_localScaling;\n\t}\n\n\tpublic override IndexedVector3 LocalGetSupportingVertex(ref IndexedVector3 vec)\n\t{\n\t\tIndexedVector3 supVertex = LocalGetSupportingVertexWithoutMargin(ref vec);\n\t\tif (GetMargin() != 0f)\n\t\t{\n\t\t\tIndexedVector3 vecnorm = vec;\n\t\t\tif (vecnorm.LengthSquared() \u003C (MathUtil.SIMD_EPSILON * MathUtil.SIMD_EPSILON))\n\t\t\t{\n\t\t\t\tvecnorm = new IndexedVector3(-1f);\n\t\t\t}\n\n\t\t\tvecnorm.Normalize();\n\t\t\tsupVertex \u002B= GetMargin() * vecnorm;\n\t\t}\n\n\t\treturn supVertex;\n\t}\n\n\tpublic override IndexedVector3 LocalGetSupportingVertexWithoutMargin(ref IndexedVector3 vec0)\n\t{\n\t\tIndexedVector3 supVec = IndexedVector3.Zero;\n\t\tfloat newDot, maxDot = float.MinValue;\n\t\tIndexedVector3 vec = vec0;\n\t\tfloat lenSqr = vec.LengthSquared();\n\t\tif (lenSqr \u003C 0.0001f)\n\t\t{\n\t\t\tvec = new IndexedVector3(1, 0, 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvec.Normalize();\n\t\t}\n\n\t\tfor (int i = 0; i \u003C m_numPoints; i\u002B\u002B)\n\t\t{\n\t\t\tIndexedVector3 vtx = GetScaledPoint(i);\n\t\t\tnewDot = IndexedVector3.Dot(vec, vtx);\n\t\t\tif (newDot \u003E maxDot)\n\t\t\t{\n\t\t\t\tmaxDot = newDot;\n\t\t\t\tsupVec = vtx;\n\t\t\t}\n\t\t}\n\n\t\treturn supVec;\n\t}\n\n\tpublic override void BatchedUnitVectorGetSupportingVertexWithoutMargin(IndexedVector3[] vectors, IndexedVector4[] supportVerticesOut, int numVectors)\n\t{\n\t\tfloat newDot;\n\t\t//use \u0027w\u0027 component of supportVerticesOut?\n\t\t{\n\t\t\tfor (int i = 0; i \u003C numVectors; i\u002B\u002B)\n\t\t\t{\n\t\t\t\tIndexedVector4 temp = supportVerticesOut[i];\n\t\t\t\ttemp.W = float.MinValue;\n\t\t\t\tsupportVerticesOut[i] = temp;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i \u003C m_unscaledPoints.Count; i\u002B\u002B)\n\t\t{\n\t\t\tIndexedVector3 vtx = GetScaledPoint(i);\n\t\t\tfor (int j = 0; j \u003C numVectors; j\u002B\u002B)\n\t\t\t{\n\t\t\t\tIndexedVector3 vec = vectors[j];\n\t\t\t\tnewDot = IndexedVector3.Dot(vec, vtx);\n\t\t\t\tif (newDot \u003E supportVerticesOut[j].W)\n\t\t\t\t{\n\t\t\t\t\t//WARNING: don\u0027t swap next lines, the w component would get overwritten!\n\t\t\t\t\tsupportVerticesOut[j] = new IndexedVector4(vtx, newDot);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//debugging\n\tpublic override String GetName()\n\t{\n\t\treturn \u0022ConvexPointCloud\u0022;\n\t}\n\n\tpublic override int GetNumVertices()\n\t{\n\t\treturn m_unscaledPoints.Count;\n\t}\n\n\tpublic override int GetNumEdges()\n\t{\n\t\treturn 0;\n\t}\n\n\tpublic override void GetEdge(int i, out IndexedVector3 pa, out IndexedVector3 pb)\n\t{\n\t\t{\n\t\t}\n\n\t\tpa = IndexedVector3.Zero;\n\t\tpb = IndexedVector3.Zero;\n\t}\n\n\tpublic override void GetVertex(int i, out IndexedVector3 vtx)\n\t{\n\t\tvtx = m_unscaledPoints[i] * m_localScaling;\n\t}\n\n\tpublic override int GetNumPlanes()\n\t{\n\t\treturn 0;\n\t}\n\n\tpublic override void GetPlane(out IndexedVector3 planeNormal, out IndexedVector3 planeSupport, int i)\n\t{\n\t\t{\n\t\t}\n\n\t\tplaneNormal = IndexedVector3.Zero;\n\t\tplaneSupport = IndexedVector3.Zero;\n\t}\n\n\tpublic override bool IsInside(ref IndexedVector3 pt, float tolerance)\n\t{\n\t\t{\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic override void SetLocalScaling(ref IndexedVector3 scaling)\n\t{\n\t\tm_localScaling = scaling;\n\t\tRecalcLocalAabb();\n\t}\n\n\tprivate IList\u003CIndexedVector3\u003E m_unscaledPoints;\n\tint m_numPoints;\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/CylinderShapeX.cs","FileName":"CylinderShapeX.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class CylinderShapeX : CylinderShape\n{\n\tpublic CylinderShapeX(IndexedVector3 halfExtents) : this(ref halfExtents)\n\t{\n\t}\n\n\tpublic CylinderShapeX(ref IndexedVector3 halfExtents) : base(ref halfExtents)\n\t{\n\t\tm_upAxis = 0;\n\t}\n\n\tpublic override IndexedVector3 LocalGetSupportingVertexWithoutMargin(ref IndexedVector3 vec)\n\t{\n\t\treturn CylinderLocalSupportX(GetHalfExtentsWithoutMargin(), vec);\n\t}\n\n\tpublic override void BatchedUnitVectorGetSupportingVertexWithoutMargin(IndexedVector3[] vectors, IndexedVector4[] supportVerticesOut, int numVectors)\n\t{\n\t\tIndexedVector3 halfExtents = GetHalfExtentsWithoutMargin();\n\t\tfor (int i = 0; i \u003C numVectors; i\u002B\u002B)\n\t\t{\n\t\t\tsupportVerticesOut[i] = new IndexedVector4(CylinderLocalSupportX(halfExtents, vectors[i]), 0);\n\t\t}\n\t}\n\n\t//debugging\n\tpublic override String GetName()\n\t{\n\t\treturn \u0022CylinderX\u0022;\n\t}\n\n\tpublic override float GetRadius()\n\t{\n\t\treturn GetHalfExtentsWithMargin().Y;\n\t}\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/EmptyAlgorithm.cs","FileName":"EmptyAlgorithm.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class EmptyAlgorithm : CollisionAlgorithm\n{\n\tpublic EmptyAlgorithm(CollisionAlgorithmConstructionInfo ci)\n\t{\n\t}\n\n\tpublic override void ProcessCollision(CollisionObject body0, CollisionObject body1, DispatcherInfo dispatchInfo, ManifoldResult resultOut)\n\t{\n\t}\n\n\tpublic override float CalculateTimeOfImpact(CollisionObject body0, CollisionObject body1, DispatcherInfo dispatchInfo, ManifoldResult resultOut)\n\t{\n\t\treturn 1f;\n\t}\n\n\tpublic override void GetAllContactManifolds(PersistentManifoldArray manifoldArray)\n\t{\n\t}\n\n\tpublic override void Cleanup()\n\t{\n\t}\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/GIM_BVH_DATA_ARRAY.cs","FileName":"GIM_BVH_DATA_ARRAY.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n *\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\nThis source file is part of GIMPACT Library.\n\nFor the latest info, see http://gimpact.sourceforge.net/\n\nCopyright (c) 2007 Francisco Leon Najera. C.C. 80087371.\nemail: projectileman@yahoo.com\n\n\nThis software is provided \u0027as-is\u0027, without any express or implied warranty.\nIn no event will the authors be held liable for any damages arising from the use of this software.\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it freely,\nsubject to the following restrictions:\n\n1. 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.\n2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n*/\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System.Diagnostics;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class GIM_BVH_DATA_ARRAY : ObjectArray\u003CGIM_BVH_DATA\u003E\n{\n\tpublic GIM_BVH_DATA_ARRAY()\n\t{\n\t}\n\n\tpublic GIM_BVH_DATA_ARRAY(int reserve) : base(reserve)\n\t{\n\t}\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/GImpactCreateFunc.cs","FileName":"GImpactCreateFunc.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n *\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\nThis source file is part of GIMPACT Library.\n\nFor the latest info, see http://gimpact.sourceforge.net/\n\nCopyright (c) 2007 Francisco Leon Najera. C.C. 80087371.\nemail: projectileman@yahoo.com\n\n\nThis software is provided \u0027as-is\u0027, without any express or implied warranty.\nIn no event will the authors be held liable for any damages arising from the use of this software.\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it freely,\nsubject to the following restrictions:\n\n1. 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.\n2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n*/\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\nusing System;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class GImpactCreateFunc : CollisionAlgorithmCreateFunc\n{\n\tpublic override CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1)\n\t{\n\t\tGImpactCollisionAlgorithm algo = BulletGlobals.GImpactCollisionAlgorithmPool.Get();\n\t\talgo.Initialize(ci, body0, body1);\n\t\treturn algo;\n\t}\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/GImpactQuantizedBvh.cs","FileName":"GImpactQuantizedBvh.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n *\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\nThis source file is part of GIMPACT Library.\n\nFor the latest info, see http://gimpact.sourceforge.net/\n\nCopyright (c) 2007 Francisco Leon Najera. C.C. 80087371.\nemail: projectileman@yahoo.com\n\n\nThis software is provided \u0027as-is\u0027, without any express or implied warranty.\nIn no event will the authors be held liable for any damages arising from the use of this software.\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it freely,\nsubject to the following restrictions:\n\n1. 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.\n2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n*/\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System.Diagnostics;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class GImpactQuantizedBvh\n{\n\tprotected QuantizedBvhTree m_box_tree = new QuantizedBvhTree();\n\tprotected IPrimitiveManagerBase m_primitive_manager;\n\tstatic bool QuantizedNodeCollision(GImpactQuantizedBvh boxset0, GImpactQuantizedBvh boxset1, BT_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0, int node0, int node1, bool complete_primitive_tests)\n\t{\n\t\tAABB box0;\n\t\tboxset0.GetNodeBound(node0, out box0);\n\t\tAABB box1;\n\t\tboxset1.GetNodeBound(node1, out box1);\n\t\treturn box0.OverlappingTransCache(ref box1, ref trans_cache_1to0, complete_primitive_tests);\n\t//\tbox1.appy_transform_trans_cache(trans_cache_1to0);\n\t//\treturn box0.has_collision(box1);\n\t}\n\n\t//stackless refit\n\tprotected void Refit()\n\t{\n\t\tint nodecount = GetNodeCount();\n\t\twhile (nodecount-- != 0)\n\t\t{\n\t\t\tif (IsLeafNode(nodecount))\n\t\t\t{\n\t\t\t\tAABB leafbox;\n\t\t\t\tm_primitive_manager.GetPrimitiveBox(GetNodeData(nodecount), out leafbox);\n\t\t\t\tSetNodeBound(nodecount, ref leafbox);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//const GIM_BVH_TREE_NODE * nodepointer = get_node_pointer(nodecount);\n\t\t\t\t//get left bound\n\t\t\t\tAABB bound = new AABB();\n\t\t\t\tbound.Invalidate();\n\t\t\t\tAABB temp_box;\n\t\t\t\tint child_node = GetLeftNode(nodecount);\n\t\t\t\tif (child_node != 0)\n\t\t\t\t{\n\t\t\t\t\tGetNodeBound(child_node, out temp_box);\n\t\t\t\t\tbound.Merge(ref temp_box);\n\t\t\t\t}\n\n\t\t\t\tchild_node = GetRightNode(nodecount);\n\t\t\t\tif (child_node != 0)\n\t\t\t\t{\n\t\t\t\t\tGetNodeBound(child_node, out temp_box);\n\t\t\t\t\tbound.Merge(ref temp_box);\n\t\t\t\t}\n\n\t\t\t\tSetNodeBound(nodecount, ref bound);\n\t\t\t}\n\t\t}\n\t}\n\n\t//! this constructor doesn\u0027t build the tree. you must call\tbuildSet\n\tpublic GImpactQuantizedBvh()\n\t{\n\t}\n\n\t//! this constructor doesn\u0027t build the tree. you must call\tbuildSet\n\tpublic GImpactQuantizedBvh(IPrimitiveManagerBase primitive_manager)\n\t{\n\t\tm_primitive_manager = primitive_manager;\n\t}\n\n\tpublic AABB GetGlobalBox()\n\t{\n\t\tAABB totalbox;\n\t\tGetNodeBound(0, out totalbox);\n\t\treturn totalbox;\n\t}\n\n\tpublic void SetPrimitiveManager(IPrimitiveManagerBase primitive_manager)\n\t{\n\t\tm_primitive_manager = primitive_manager;\n\t}\n\n\tpublic IPrimitiveManagerBase GetPrimitiveManager()\n\t{\n\t\treturn m_primitive_manager;\n\t}\n\n\t//! node manager prototype functions\n\t//! this attemps to refit the box set.\n\tpublic void Update()\n\t{\n\t\tRefit();\n\t}\n\n\t//! this rebuild the entire set\n\tpublic void BuildSet()\n\t{\n\t\t//obtain primitive boxes\n\t\tint listSize = m_primitive_manager.GetPrimitiveCount();\n\t\tGIM_BVH_DATA_ARRAY primitive_boxes = new GIM_BVH_DATA_ARRAY(listSize);\n\t\t// forces boxes to be allocated\n\t\tprimitive_boxes.Resize(listSize);\n\t\tGIM_BVH_DATA[] rawArray = primitive_boxes.GetRawArray();\n\t\tfor (int i = 0; i \u003C listSize; i\u002B\u002B)\n\t\t{\n\t\t\tm_primitive_manager.GetPrimitiveBox(i, out rawArray[i].m_bound);\n\t\t\trawArray[i].m_data = i;\n\t\t}\n\n\t\tm_box_tree.BuildTree(primitive_boxes);\n\t}\n\n\t//! returns the indices of the primitives in the m_primitive_manager\n\tpublic bool BoxQuery(ref AABB box, ObjectArray\u003Cint\u003E collided_results)\n\t{\n\t\tint curIndex = 0;\n\t\tint numNodes = GetNodeCount();\n\t\t//quantize box\n\t\tUShortVector3 quantizedMin;\n\t\tUShortVector3 quantizedMax;\n\t\tm_box_tree.QuantizePoint(out quantizedMin, ref box.m_min);\n\t\tm_box_tree.QuantizePoint(out quantizedMax, ref box.m_max);\n\t\twhile (curIndex \u003C numNodes)\n\t\t{\n\t\t\t//catch bugs in tree data\n\t\t\tbool aabbOverlap = m_box_tree.TestQuantizedBoxOverlap(curIndex, ref quantizedMin, ref quantizedMax);\n\t\t\tbool isLeafNode = IsLeafNode(curIndex);\n\t\t\tif (isLeafNode \u0026\u0026 aabbOverlap)\n\t\t\t{\n\t\t\t\tcollided_results.Add(GetNodeData(curIndex));\n\t\t\t}\n\n\t\t\tif (aabbOverlap || isLeafNode)\n\t\t\t{\n\t\t\t\t//next subnode\n\t\t\t\tcurIndex\u002B\u002B;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//skip node\n\t\t\t\tcurIndex \u002B= GetEscapeNodeIndex(curIndex);\n\t\t\t}\n\t\t}\n\n\t\tif (collided_results.Count \u003E 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}\n\n\t//! returns the indices of the primitives in the m_primitive_manager\n\tpublic bool BoxQueryTrans(ref AABB box, ref IndexedMatrix transform, ObjectArray\u003Cint\u003E collided_results)\n\t{\n\t\tAABB transbox = box;\n\t\ttransbox.ApplyTransform(ref transform);\n\t\treturn BoxQuery(ref transbox, collided_results);\n\t}\n\n\t//! returns the indices of the primitives in the m_primitive_manager\n\tpublic bool RayQuery(ref IndexedVector3 ray_dir, ref IndexedVector3 ray_origin, ObjectArray\u003Cint\u003E collided_results)\n\t{\n\t\tint curIndex = 0;\n\t\tint numNodes = GetNodeCount();\n\t\twhile (curIndex \u003C numNodes)\n\t\t{\n\t\t\tAABB bound;\n\t\t\tGetNodeBound(curIndex, out bound);\n\t\t\t//catch bugs in tree data\n\t\t\tbool aabbOverlap = bound.CollideRay(ref ray_origin, ref ray_dir);\n\t\t\tbool isLeafNode = IsLeafNode(curIndex);\n\t\t\tif (isLeafNode \u0026\u0026 aabbOverlap)\n\t\t\t{\n\t\t\t\tcollided_results.Add(GetNodeData(curIndex));\n\t\t\t}\n\n\t\t\tif (aabbOverlap || isLeafNode)\n\t\t\t{\n\t\t\t\t//next subnode\n\t\t\t\tcurIndex\u002B\u002B;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//skip node\n\t\t\t\tcurIndex \u002B= GetEscapeNodeIndex(curIndex);\n\t\t\t}\n\t\t}\n\n\t\tif (collided_results.Count \u003E 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}\n\n\t//! tells if this set has hierarcht\n\tpublic bool HasHierarchy()\n\t{\n\t\treturn true;\n\t}\n\n\t//! tells if this set is a trimesh\n\tpublic bool IsTrimesh()\n\t{\n\t\treturn m_primitive_manager.IsTrimesh();\n\t}\n\n\t//! node count\n\tpublic int GetNodeCount()\n\t{\n\t\treturn m_box_tree.GetNodeCount();\n\t}\n\n\t//! tells if the node is a leaf\n\tpublic bool IsLeafNode(int nodeindex)\n\t{\n\t\treturn m_box_tree.IsLeafNode(nodeindex);\n\t}\n\n\tpublic int GetNodeData(int nodeindex)\n\t{\n\t\treturn m_box_tree.GetNodeData(nodeindex);\n\t}\n\n\tpublic void GetNodeBound(int nodeindex, out AABB bound)\n\t{\n\t\tm_box_tree.GetNodeBound(nodeindex, out bound);\n\t}\n\n\tpublic void SetNodeBound(int nodeindex, ref AABB bound)\n\t{\n\t\tm_box_tree.SetNodeBound(nodeindex, ref bound);\n\t}\n\n\tpublic int GetLeftNode(int nodeindex)\n\t{\n\t\treturn m_box_tree.GetLeftNode(nodeindex);\n\t}\n\n\tpublic int GetRightNode(int nodeindex)\n\t{\n\t\treturn m_box_tree.GetRightNode(nodeindex);\n\t}\n\n\tpublic int GetEscapeNodeIndex(int nodeindex)\n\t{\n\t\treturn m_box_tree.GetEscapeNodeIndex(nodeindex);\n\t}\n\n\tpublic void GetNodeTriangle(int nodeindex, PrimitiveTriangle triangle)\n\t{\n\t\tm_primitive_manager.GetPrimitiveTriangle(GetNodeData(nodeindex), triangle);\n\t}\n\n\t//SIMD_FORCE_INLINE const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index = 0) const\n\t//{\n\t//    return m_box_tree.get_node_pointer(index);\n\t//}\n\tpublic static float GetAverageTreeCollisionTime()\n\t{\n\t\treturn 1.0f;\n\t}\n\n\tpublic static void FindQuantizedCollisionPairsRecursive(GImpactQuantizedBvh boxset0, GImpactQuantizedBvh boxset1, PairSet collision_pairs, ref BT_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0, int node0, int node1, bool complete_primitive_tests)\n\t{\n\t\tif (QuantizedNodeCollision(boxset0, boxset1, trans_cache_1to0, node0, node1, complete_primitive_tests) == false)\n\t\t\treturn; //avoid colliding internal nodes\n\t\tif (boxset0.IsLeafNode(node0))\n\t\t{\n\t\t\tif (boxset1.IsLeafNode(node1))\n\t\t\t{\n\t\t\t\t// collision result\n\t\t\t\tcollision_pairs.PushPair(boxset0.GetNodeData(node0), boxset1.GetNodeData(node1));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//collide left recursive\n\t\t\t\tFindQuantizedCollisionPairsRecursive(boxset0, boxset1, collision_pairs, ref trans_cache_1to0, node0, boxset1.GetLeftNode(node1), false);\n\t\t\t\t//collide right recursive\n\t\t\t\tFindQuantizedCollisionPairsRecursive(boxset0, boxset1, collision_pairs, ref trans_cache_1to0, node0, boxset1.GetRightNode(node1), false);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (boxset1.IsLeafNode(node1))\n\t\t\t{\n\t\t\t\t//collide left recursive\n\t\t\t\tFindQuantizedCollisionPairsRecursive(boxset0, boxset1, collision_pairs, ref trans_cache_1to0, boxset0.GetLeftNode(node0), node1, false);\n\t\t\t\t//collide right recursive\n\t\t\t\tFindQuantizedCollisionPairsRecursive(boxset0, boxset1, collision_pairs, ref trans_cache_1to0, boxset0.GetRightNode(node0), node1, false);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//collide left0 left1\n\t\t\t\tFindQuantizedCollisionPairsRecursive(boxset0, boxset1, collision_pairs, ref trans_cache_1to0, boxset0.GetLeftNode(node0), boxset1.GetLeftNode(node1), false);\n\t\t\t\t//collide left0 right1\n\t\t\t\tFindQuantizedCollisionPairsRecursive(boxset0, boxset1, collision_pairs, ref trans_cache_1to0, boxset0.GetLeftNode(node0), boxset1.GetRightNode(node1), false);\n\t\t\t\t//collide right0 left1\n\t\t\t\tFindQuantizedCollisionPairsRecursive(boxset0, boxset1, collision_pairs, ref trans_cache_1to0, boxset0.GetRightNode(node0), boxset1.GetLeftNode(node1), false);\n\t\t\t\t//collide right0 right1\n\t\t\t\tFindQuantizedCollisionPairsRecursive(boxset0, boxset1, collision_pairs, ref trans_cache_1to0, boxset0.GetRightNode(node0), boxset1.GetRightNode(node1), false);\n\t\t\t} // else if node1 is not a leaf\n\t\t} // else if node0 is not a leaf\n\t}\n\n\tpublic static void FindCollision(GImpactQuantizedBvh boxset0, ref IndexedMatrix trans0, GImpactQuantizedBvh boxset1, ref IndexedMatrix trans1, PairSet collision_pairs)\n\t{\n\t\tif (boxset0.GetNodeCount() == 0 || boxset1.GetNodeCount() == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tBT_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0 = new BT_BOX_BOX_TRANSFORM_CACHE();\n\t\ttrans_cache_1to0.CalcFromHomogenic(ref trans0, ref trans1);\n\t\tFindQuantizedCollisionPairsRecursive(boxset0, boxset1, collision_pairs, ref trans_cache_1to0, 0, 0, true);\n\t}\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/GImpactTriangleCallback.cs","FileName":"GImpactTriangleCallback.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n *\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\nThis source file is part of GIMPACT Library.\n\nFor the latest info, see http://gimpact.sourceforge.net/\n\nCopyright (c) 2007 Francisco Leon Najera. C.C. 80087371.\nemail: projectileman@yahoo.com\n\n\nThis software is provided \u0027as-is\u0027, without any express or implied warranty.\nIn no event will the authors be held liable for any damages arising from the use of this software.\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it freely,\nsubject to the following restrictions:\n\n1. 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.\n2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n*/\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\nusing System;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\nclass GImpactTriangleCallback : ITriangleCallback\n{\n\tpublic GImpactCollisionAlgorithm algorithm;\n\tpublic CollisionObject body0;\n\tpublic CollisionObject body1;\n\tpublic GImpactShapeInterface gimpactshape0;\n\tpublic bool swapped;\n\tpublic float margin;\n\tpublic virtual void ProcessTriangle(IndexedVector3[] triangle, int partId, int triangleIndex)\n\t{\n\t\tTriangleShapeEx tri1 = new TriangleShapeEx(ref triangle[0], ref triangle[1], ref triangle[2]);\n\t\ttri1.SetMargin(margin);\n\t\tif (swapped)\n\t\t{\n\t\t\talgorithm.SetPart0(partId);\n\t\t\talgorithm.SetFace0(triangleIndex);\n\t\t}\n\t\telse\n\t\t{\n\t\t\talgorithm.SetPart1(partId);\n\t\t\talgorithm.SetFace1(triangleIndex);\n\t\t}\n\n\t\talgorithm.GImpactVsShape(body0, body1, gimpactshape0, tri1, swapped);\n\t}\n\n\tpublic void Cleanup()\n\t{\n\t}\n\n\tpublic bool graphics()\n\t{\n\t\treturn false;\n\t}\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/IOverlapCallback.cs","FileName":"IOverlapCallback.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System;\nusing System.Diagnostics;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal interface IOverlapCallback\n{\n\t//return true for deletion of the pair\n\tbool ProcessOverlap(BroadphasePair pair);\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/IOverlappingPairCache.cs","FileName":"IOverlappingPairCache.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System;\nusing System.Diagnostics;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal interface IOverlappingPairCache : IOverlappingPairCallback\n{\n\t//BroadphasePair getOverlappingPairArrayPtr();\n\tObjectArray\u003CBroadphasePair\u003E GetOverlappingPairArray();\n\tvoid CleanOverlappingPair(BroadphasePair pair, IDispatcher dispatcher);\n\tint GetNumOverlappingPairs();\n\tvoid CleanProxyFromPairs(BroadphaseProxy proxy, IDispatcher dispatcher);\n\tvoid SetOverlapFilterCallback(IOverlapFilterCallback callback);\n\tvoid ProcessAllOverlappingPairs(IOverlapCallback callback, IDispatcher dispatcher);\n\tBroadphasePair FindPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1);\n\tbool HasDeferredRemoval();\n\tvoid SetInternalGhostPairCallback(IOverlappingPairCallback ghostPairCallback);\n\tvoid SortOverlappingPairs(IDispatcher dispatcher);\n\tvoid Cleanup();\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/LocalInfoAdder.cs","FileName":"LocalInfoAdder.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System.Diagnostics;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletDynamics;\nusing System;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class LocalInfoAdder : ConvexResultCallback\n{\n\tpublic ConvexResultCallback m_userCallback;\n\tpublic int m_i;\n\tpublic LocalInfoAdder(int i, ConvexResultCallback user)\n\t{\n\t\tm_userCallback = user;\n\t\tm_i = i;\n\t\tm_closestHitFraction = user.m_closestHitFraction;\n\t}\n\n\tpublic override bool NeedsCollision(BroadphaseProxy proxy0)\n\t{\n\t\treturn m_userCallback.NeedsCollision(proxy0);\n\t}\n\n\tpublic override float AddSingleResult(ref LocalConvexResult r, bool b)\n\t{\n\t\tLocalShapeInfo shapeInfo = new LocalShapeInfo();\n\t\tshapeInfo.m_shapePart = -1;\n\t\tshapeInfo.m_triangleIndex = m_i;\n\t\tr.m_localShapeInfo = shapeInfo;\n\t\t// FIXME - THIS MAY BREAK....\n\t\t//if (r.m_localShapeInfo == null)\n\t\t//{\n\t\t//    r.m_localShapeInfo = shapeInfo;\n\t\t//}\n\t\tfloat result = m_userCallback.AddSingleResult(ref r, b);\n\t\tm_closestHitFraction = m_userCallback.m_closestHitFraction;\n\t\treturn result;\n\t}\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/ManifoldPoint.cs","FileName":"ManifoldPoint.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class ManifoldPoint\n{\n\tpublic ManifoldPoint()\n\t{\n\t}\n\n\tpublic void Initialise(ref IndexedVector3 pointA, ref IndexedVector3 pointB, ref IndexedVector3 normal, float distance)\n\t{\n\t\t/* Don\u0027t initialize default values twice in C# */\n\t\tm_lateralFrictionDir1 = IndexedVector3.Zero;\n\t\tm_lateralFrictionDir2 = IndexedVector3.Zero;\n\t\tm_lifeTime = 0;\n\t\tm_appliedImpulseLateral1 = 0f;\n\t\tm_appliedImpulseLateral2 = 0f;\n\t\tm_contactMotion1 = 0f;\n\t\tm_contactMotion2 = 0f;\n\t\tm_contactCFM1 = 0f;\n\t\tm_contactCFM2 = 0f;\n\t\tm_lateralFrictionInitialized = false;\n\t\tm_userPersistentData = null;\n\t\tm_appliedImpulse = 0f;\n\t\tm_partId0 = 0;\n\t\tm_partId1 = 0;\n\t\tm_index0 = 0;\n\t\tm_index1 = 0;\n\t\tm_combinedRestitution = 0f;\n\t\tm_combinedFriction = 0f;\n\t\tm_positionWorldOnA = IndexedVector3.Zero;\n\t\tm_positionWorldOnB = IndexedVector3.Zero;\n\t\tm_localPointA = pointA;\n\t\tm_localPointB = pointB;\n\t\tm_normalWorldOnB = normal;\n\t\tm_distance1 = distance;\n\t\tm_constraintRow[0].Reset();\n\t\tm_constraintRow[1].Reset();\n\t\tm_constraintRow[2].Reset();\n\t}\n\n\tpublic float GetDistance()\n\t{\n\t\treturn m_distance1;\n\t}\n\n\tpublic void SetDistance(float value)\n\t{\n\t\tm_distance1 = value;\n\t}\n\n\tpublic int GetLifeTime()\n\t{\n\t\treturn m_lifeTime;\n\t}\n\n\tpublic void SetLifeTime(int value)\n\t{\n\t\tm_lifeTime = value;\n\t}\n\n\tpublic void SetPositionWorldOnA(IndexedVector3 value)\n\t{\n\t\tm_positionWorldOnA = value;\n\t}\n\n\tpublic void SetPositionWorldOnA(ref IndexedVector3 value)\n\t{\n\t\tm_positionWorldOnA = value;\n\t}\n\n\tpublic IndexedVector3 GetPositionWorldOnA()\n\t{\n\t\treturn m_positionWorldOnA;\n\t//\t\t\t\treturn m_positionWorldOnB \u002B m_normalWorldOnB * m_distance1;\n\t}\n\n\tpublic void SetPositionWorldOnB(IndexedVector3 value)\n\t{\n\t\tm_positionWorldOnB = value;\n\t}\n\n\tpublic void SetPositionWorldOnB(ref IndexedVector3 value)\n\t{\n\t\tm_positionWorldOnB = value;\n\t}\n\n\tpublic IndexedVector3 GetPositionWorldOnB()\n\t{\n\t\treturn m_positionWorldOnB;\n\t}\n\n\tpublic float GetAppliedImpulse()\n\t{\n\t\treturn m_appliedImpulse;\n\t}\n\n\tpublic IndexedVector3 GetLocalPointA()\n\t{\n\t\treturn m_localPointA;\n\t}\n\n\tpublic void SetLocalPointA(ref IndexedVector3 value)\n\t{\n\t\tm_localPointA = value;\n\t}\n\n\tpublic IndexedVector3 GetLocalPointB()\n\t{\n\t\treturn m_localPointB;\n\t}\n\n\tpublic void SetLocalPointB(ref IndexedVector3 value)\n\t{\n\t\tm_localPointB = value;\n\t}\n\n\tpublic Object GetUserPersistentData()\n\t{\n\t\treturn m_userPersistentData;\n\t}\n\n\tpublic void SetUserPersistentData(Object o)\n\t{\n\t\tm_userPersistentData = o;\n\t}\n\n\tpublic void SetAppliedImpulse(float value)\n\t{\n\t\tif (value \u003E 30)\n\t\t{\n\t\t\tint ibreak = 0;\n\t\t}\n\n\t\tm_appliedImpulse = value;\n\t}\n\n\tpublic IndexedVector3 GetNormalWorldOnB()\n\t{\n\t\treturn m_normalWorldOnB;\n\t}\n\n\tpublic void SetNormalWorldOnB(ref IndexedVector3 value)\n\t{\n\t\tm_normalWorldOnB = value;\n\t}\n\n\tpublic float GetCombinedFriction()\n\t{\n\t\treturn m_combinedFriction;\n\t}\n\n\tpublic void SetCombinedFriction(float value)\n\t{\n\t\tm_combinedFriction = value;\n\t}\n\n\tpublic float GetCombinedResitution()\n\t{\n\t\treturn m_combinedRestitution;\n\t}\n\n\tpublic void SetCombinedRestitution(float value)\n\t{\n\t\tm_combinedRestitution = value;\n\t}\n\n\tpublic bool GetLateralFrictionInitialized()\n\t{\n\t\treturn m_lateralFrictionInitialized;\n\t}\n\n\tpublic void SetLateralFrictionInitalised(bool value)\n\t{\n\t\tm_lateralFrictionInitialized = value;\n\t}\n\n\tpublic float GetAppliedImpulseLateral1()\n\t{\n\t\treturn m_appliedImpulseLateral1;\n\t}\n\n\tpublic void SetAppliedImpulseLateral1(float value)\n\t{\n\t\tm_appliedImpulseLateral1 = value;\n\t}\n\n\tpublic float GetAppliedImpulseLateral2()\n\t{\n\t\treturn m_appliedImpulseLateral2;\n\t}\n\n\tpublic void SetAppliedImpulseLateral2(float value)\n\t{\n\t\tm_appliedImpulseLateral2 = value;\n\t}\n\n\tpublic IndexedVector3 GetLateralFrictionDir1()\n\t{\n\t\treturn m_lateralFrictionDir1;\n\t}\n\n\tpublic void SetLateralFrictionDir1(ref IndexedVector3 value)\n\t{\n\t\tm_lateralFrictionDir1 = value;\n\t}\n\n\tpublic IndexedVector3 GetLateralFrictionDir2()\n\t{\n\t\treturn m_lateralFrictionDir2;\n\t}\n\n\tpublic void SetLateralFrictionDir2(ref IndexedVector3 value)\n\t{\n\t\tm_lateralFrictionDir2 = value;\n\t}\n\n\tpublic int GetPartId0()\n\t{\n\t\treturn m_partId0;\n\t}\n\n\tpublic int GetPartId1()\n\t{\n\t\treturn m_partId1;\n\t}\n\n\tpublic int GetIndex0()\n\t{\n\t\treturn m_index0;\n\t}\n\n\tpublic int GetIndex1()\n\t{\n\t\treturn m_index1;\n\t}\n\n\tpublic void SetPartId0(int id)\n\t{\n\t\tm_partId0 = id;\n\t}\n\n\tpublic void SetPartId1(int id)\n\t{\n\t\tm_partId1 = id;\n\t}\n\n\tpublic void SetIndex0(int index)\n\t{\n\t\tm_index0 = index;\n\t}\n\n\tpublic void SetIndex1(int index)\n\t{\n\t\tm_index1 = index;\n\t}\n\n\tpublic IndexedVector3 m_localPointA;\n\tpublic IndexedVector3 m_localPointB;\n\tpublic IndexedVector3 m_positionWorldOnA;\n\tpublic IndexedVector3 m_positionWorldOnB;\n\tpublic IndexedVector3 m_normalWorldOnB;\n\tpublic float m_distance1;\n\tpublic float m_combinedFriction;\n\tpublic float m_combinedRestitution;\n\t//BP mod, store contact triangles.\n\tpublic int m_partId0;\n\tpublic int m_partId1;\n\tpublic int m_index0;\n\tpublic int m_index1;\n\tpublic Object m_userPersistentData;\n\tpublic float m_appliedImpulse;\n\tpublic bool m_lateralFrictionInitialized;\n\tpublic float m_appliedImpulseLateral1;\n\tpublic float m_appliedImpulseLateral2;\n\tpublic float m_contactMotion1;\n\tpublic float m_contactMotion2;\n\tpublic float m_contactCFM1;\n\tpublic float m_contactCFM2;\n\tpublic int m_lifeTime; //lifetime of the contactpoint in frames\n\tpublic IndexedVector3 m_lateralFrictionDir1;\n\tpublic IndexedVector3 m_lateralFrictionDir2;\n\tpublic ConstraintRow[] m_constraintRow = new ConstraintRow[3];\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/MinkowskiPenetrationDepthSolver.cs","FileName":"MinkowskiPenetrationDepthSolver.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class MinkowskiPenetrationDepthSolver : IConvexPenetrationDepthSolver\n{\n\tpublic bool CalcPenDepth(ISimplexSolverInterface simplexSolver, ConvexShape convexA, ConvexShape convexB, ref IndexedMatrix transA, ref IndexedMatrix transB, ref IndexedVector3 v, ref IndexedVector3 pa, ref IndexedVector3 pb, IDebugDraw debugDraw)\n\t{\n\t\tbool check2d = convexA.IsConvex2d() \u0026\u0026 convexB.IsConvex2d();\n\t\tfloat minProj = float.MaxValue;\n\t\tIndexedVector3 minNorm = IndexedVector3.Zero;\n\t\tIndexedVector3 minA = IndexedVector3.Zero, minB = IndexedVector3.Zero;\n\t\tIndexedVector3 seperatingAxisInA, seperatingAxisInB;\n\t\tIndexedVector3 pInA, qInB, pWorld, qWorld, w;\n\t\tIndexedVector4[] supportVerticesABatch = new IndexedVector4[NUM_UNITSPHERE_POINTS \u002B ConvexShape.MAX_PREFERRED_PENETRATION_DIRECTIONS * 2];\n\t\tIndexedVector4[] supportVerticesBBatch = new IndexedVector4[NUM_UNITSPHERE_POINTS \u002B ConvexShape.MAX_PREFERRED_PENETRATION_DIRECTIONS * 2];\n\t\tIndexedVector3[] seperatingAxisInABatch = new IndexedVector3[NUM_UNITSPHERE_POINTS \u002B ConvexShape.MAX_PREFERRED_PENETRATION_DIRECTIONS * 2];\n\t\tIndexedVector3[] seperatingAxisInBBatch = new IndexedVector3[NUM_UNITSPHERE_POINTS \u002B ConvexShape.MAX_PREFERRED_PENETRATION_DIRECTIONS * 2];\n\t\tint numSampleDirections = NUM_UNITSPHERE_POINTS;\n\t\tfor (int i = 0; i \u003C numSampleDirections; i\u002B\u002B)\n\t\t{\n\t\t\tIndexedVector3 norm = sPenetrationDirections[i];\n\t\t\tIndexedVector3 negNorm = -norm;\n\t\t\tIndexedBasisMatrix.Multiply(ref seperatingAxisInABatch[i], ref negNorm, ref transA._basis);\n\t\t\tIndexedBasisMatrix.Multiply(ref seperatingAxisInBBatch[i], ref norm, ref transB._basis);\n\t\t//seperatingAxisInABatch[i] = (-norm) * transA._basis;\n\t\t//seperatingAxisInBBatch[i] = norm * transB._basis;\n\t\t}\n\n\t\t{\n\t\t\tint numPDA = convexA.GetNumPreferredPenetrationDirections();\n\t\t\tif (numPDA \u003E 0)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i \u003C numPDA; i\u002B\u002B)\n\t\t\t\t{\n\t\t\t\t\tIndexedVector3 norm;\n\t\t\t\t\tconvexA.GetPreferredPenetrationDirection(i, out norm);\n\t\t\t\t\tIndexedBasisMatrix.Multiply(ref norm, ref transA._basis, ref norm);\n\t\t\t\t\tsPenetrationDirections[numSampleDirections] = norm;\n\t\t\t\t\tIndexedVector3 negNorm = -norm;\n\t\t\t\t\tIndexedBasisMatrix.Multiply(ref seperatingAxisInABatch[numSampleDirections], ref negNorm, ref transA._basis);\n\t\t\t\t\tIndexedBasisMatrix.Multiply(ref seperatingAxisInBBatch[numSampleDirections], ref norm, ref transB._basis);\n\t\t\t\t\tnumSampleDirections\u002B\u002B;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t{\n\t\t\tint numPDB = convexB.GetNumPreferredPenetrationDirections();\n\t\t\tif (numPDB \u003E 0)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i \u003C numPDB; i\u002B\u002B)\n\t\t\t\t{\n\t\t\t\t\tIndexedVector3 norm;\n\t\t\t\t\tconvexB.GetPreferredPenetrationDirection(i, out norm);\n\t\t\t\t\tIndexedBasisMatrix.Multiply(ref norm, ref transB._basis, ref norm);\n\t\t\t\t\tsPenetrationDirections[numSampleDirections] = norm;\n\t\t\t\t\tIndexedVector3 negNorm = -norm;\n\t\t\t\t\tIndexedBasisMatrix.Multiply(ref seperatingAxisInABatch[numSampleDirections], ref negNorm, ref transA._basis);\n\t\t\t\t\tIndexedBasisMatrix.Multiply(ref seperatingAxisInBBatch[numSampleDirections], ref norm, ref transB._basis);\n\t\t\t\t\tnumSampleDirections\u002B\u002B;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconvexA.BatchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInABatch, supportVerticesABatch, numSampleDirections);\n\t\tconvexB.BatchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInBBatch, supportVerticesBBatch, numSampleDirections);\n\t\tfor (int i = 0; i \u003C numSampleDirections; i\u002B\u002B)\n\t\t{\n\t\t\tIndexedVector3 norm = sPenetrationDirections[i];\n\t\t\tif (check2d)\n\t\t\t{\n\t\t\t\t// shouldn\u0027t this be Y ?\n\t\t\t\tnorm.Z = 0;\n\t\t\t}\n\n\t\t\tif (norm.LengthSquared() \u003E 0.01f)\n\t\t\t{\n\t\t\t\tseperatingAxisInA = seperatingAxisInABatch[i];\n\t\t\t\tseperatingAxisInB = seperatingAxisInBBatch[i];\n\t\t\t\tpInA = new IndexedVector3(supportVerticesABatch[i].X, supportVerticesABatch[i].Y, supportVerticesABatch[i].Z);\n\t\t\t\tqInB = new IndexedVector3(supportVerticesBBatch[i].X, supportVerticesBBatch[i].Y, supportVerticesBBatch[i].Z);\n\t\t\t\tIndexedMatrix.Multiply(out pWorld, ref transA, ref pInA);\n\t\t\t\tIndexedMatrix.Multiply(out qWorld, ref transB, ref qInB);\n\t\t\t\tif (check2d)\n\t\t\t\t{\n\t\t\t\t\t// shouldn\u0027t this be Y ?\n\t\t\t\t\tpWorld.Z = 0f;\n\t\t\t\t\tqWorld.Z = 0f;\n\t\t\t\t}\n\n\t\t\t\tIndexedVector3.Subtract(out w, ref qWorld, ref pWorld);\n\t\t\t\tfloat delta = IndexedVector3.Dot(ref norm, ref w);\n\t\t\t\t//find smallest delta\n\t\t\t\tif (delta \u003C minProj)\n\t\t\t\t{\n\t\t\t\t\tminProj = delta;\n\t\t\t\t\tminNorm = norm;\n\t\t\t\t\tminA = pWorld;\n\t\t\t\t\tminB = qWorld;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//add the margins\n\t\tminA \u002B= minNorm * convexA.GetMarginNonVirtual();\n\t\tminB -= minNorm * convexB.GetMarginNonVirtual();\n\t\t//no penetration\n\t\tif (minProj \u003C 0f)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tfloat extraSeparation = 0.5f;\n\t\tminProj \u002B= extraSeparation \u002B (convexA.GetMarginNonVirtual() \u002B convexB.GetMarginNonVirtual());\n\t\tGjkPairDetector gjkdet = BulletGlobals.GjkPairDetectorPool.Get();\n\t\tgjkdet.Initialize(convexA, convexB, simplexSolver, null);\n\t\tfloat offsetDist = minProj;\n\t\tIndexedVector3 offset = minNorm * offsetDist;\n\t\tClosestPointInput input = ClosestPointInput.Default();\n\t\tIndexedVector3 newOrg = transA._origin \u002B offset;\n\t\tIndexedMatrix displacedTrans = transA;\n\t\tdisplacedTrans._origin = newOrg;\n\t\tinput.m_transformA = displacedTrans;\n\t\tinput.m_transformB = transB;\n\t\tinput.m_maximumDistanceSquared = float.MaxValue;\n\t\tMinkowskiIntermediateResult res = new MinkowskiIntermediateResult();\n\t\tgjkdet.SetCachedSeperatingAxis(-minNorm);\n\t\tgjkdet.GetClosestPoints(ref input, res, debugDraw, false);\n\t\tfloat correctedMinNorm = minProj - res.m_depth;\n\t\t//the penetration depth is over-estimated, relax it\n\t\tfloat penetration_relaxation = 1f;\n\t\tminNorm *= penetration_relaxation;\n\t\tif (res.m_hasResult)\n\t\t{\n\t\t\tpa = res.m_pointInWorld - minNorm * correctedMinNorm;\n\t\t\tpb = res.m_pointInWorld;\n\t\t\tv = minNorm;\n\t\t}\n\n\t\tBulletGlobals.GjkPairDetectorPool.Free(gjkdet);\n\t\treturn res.m_hasResult;\n\t}\n\n\tprivate const int NUM_UNITSPHERE_POINTS = 42;\n\tprivate readonly static IndexedVector3[] sPenetrationDirections =\n\t{\n\t\tnew IndexedVector3(0.000000f, -0.000000f, -1.000000f),\n\t\tnew IndexedVector3(0.723608f, -0.525725f, -0.447219f),\n\t\tnew IndexedVector3(-0.276388f, -0.850649f, -0.447219f),\n\t\tnew IndexedVector3(-0.894426f, -0.000000f, -0.447216f),\n\t\tnew IndexedVector3(-0.276388f, 0.850649f, -0.447220f),\n\t\tnew IndexedVector3(0.723608f, 0.525725f, -0.447219f),\n\t\tnew IndexedVector3(0.276388f, -0.850649f, 0.447220f),\n\t\tnew IndexedVector3(-0.723608f, -0.525725f, 0.447219f),\n\t\tnew IndexedVector3(-0.723608f, 0.525725f, 0.447219f),\n\t\tnew IndexedVector3(0.276388f, 0.850649f, 0.447219f),\n\t\tnew IndexedVector3(0.894426f, 0.000000f, 0.447216f),\n\t\tnew IndexedVector3(-0.000000f, 0.000000f, 1.000000f),\n\t\tnew IndexedVector3(0.425323f, -0.309011f, -0.850654f),\n\t\tnew IndexedVector3(-0.162456f, -0.499995f, -0.850654f),\n\t\tnew IndexedVector3(0.262869f, -0.809012f, -0.525738f),\n\t\tnew IndexedVector3(0.425323f, 0.309011f, -0.850654f),\n\t\tnew IndexedVector3(0.850648f, -0.000000f, -0.525736f),\n\t\tnew IndexedVector3(-0.525730f, -0.000000f, -0.850652f),\n\t\tnew IndexedVector3(-0.688190f, -0.499997f, -0.525736f),\n\t\tnew IndexedVector3(-0.162456f, 0.499995f, -0.850654f),\n\t\tnew IndexedVector3(-0.688190f, 0.499997f, -0.525736f),\n\t\tnew IndexedVector3(0.262869f, 0.809012f, -0.525738f),\n\t\tnew IndexedVector3(0.951058f, 0.309013f, 0.000000f),\n\t\tnew IndexedVector3(0.951058f, -0.309013f, 0.000000f),\n\t\tnew IndexedVector3(0.587786f, -0.809017f, 0.000000f),\n\t\tnew IndexedVector3(0.000000f, -1.000000f, 0.000000f),\n\t\tnew IndexedVector3(-0.587786f, -0.809017f, 0.000000f),\n\t\tnew IndexedVector3(-0.951058f, -0.309013f, -0.000000f),\n\t\tnew IndexedVector3(-0.951058f, 0.309013f, -0.000000f),\n\t\tnew IndexedVector3(-0.587786f, 0.809017f, -0.000000f),\n\t\tnew IndexedVector3(-0.000000f, 1.000000f, -0.000000f),\n\t\tnew IndexedVector3(0.587786f, 0.809017f, -0.000000f),\n\t\tnew IndexedVector3(0.688190f, -0.499997f, 0.525736f),\n\t\tnew IndexedVector3(-0.262869f, -0.809012f, 0.525738f),\n\t\tnew IndexedVector3(-0.850648f, 0.000000f, 0.525736f),\n\t\tnew IndexedVector3(-0.262869f, 0.809012f, 0.525738f),\n\t\tnew IndexedVector3(0.688190f, 0.499997f, 0.525736f),\n\t\tnew IndexedVector3(0.525730f, 0.000000f, 0.850652f),\n\t\tnew IndexedVector3(0.162456f, -0.499995f, 0.850654f),\n\t\tnew IndexedVector3(-0.425323f, -0.309011f, 0.850654f),\n\t\tnew IndexedVector3(-0.425323f, 0.309011f, 0.850654f),\n\t\tnew IndexedVector3(0.162456f, 0.499995f, 0.850654f),\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero,\n\t\tIndexedVector3.Zero\n\t};\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/RemovingOverlapCallback.cs","FileName":"RemovingOverlapCallback.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class RemovingOverlapCallback : IOverlapCallback\n{\n\tpublic virtual bool ProcessOverlap(BroadphasePair pair)\n\t{\n\t\t//(void)pair;\n\t\t//btAssert(0);\n\t\treturn false;\n\t}\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/SphereBoxCollisionAlgorithm.cs","FileName":"SphereBoxCollisionAlgorithm.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class SphereBoxCollisionAlgorithm : ActivatingCollisionAlgorithm\n{\n\tpublic SphereBoxCollisionAlgorithm()\n\t{\n\t} // for pool\n\n\tpublic SphereBoxCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObject col0, CollisionObject col1, bool isSwapped) : base(ci, col0, col1)\n\t{\n\t\tm_isSwapped = isSwapped;\n\t\tm_ownManifold = false;\n\t\tm_manifoldPtr = mf;\n\t\tCollisionObject sphereObj = m_isSwapped ? col1 : col0;\n\t\tCollisionObject boxObj = m_isSwapped ? col0 : col1;\n\t\tif (m_manifoldPtr == null \u0026\u0026 m_dispatcher.NeedsCollision(sphereObj, boxObj))\n\t\t{\n\t\t\tm_manifoldPtr = m_dispatcher.GetNewManifold(sphereObj, boxObj);\n\t\t\tm_ownManifold = true;\n\t\t}\n\t}\n\n\tpublic void Initialize(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObject col0, CollisionObject col1, bool isSwapped)\n\t{\n\t\tbase.Initialize(ci, col0, col1);\n\t\tm_isSwapped = isSwapped;\n\t\tm_ownManifold = false;\n\t\tm_manifoldPtr = mf;\n\t\tCollisionObject sphereObj = m_isSwapped ? col1 : col0;\n\t\tCollisionObject boxObj = m_isSwapped ? col0 : col1;\n\t\tif (m_manifoldPtr == null \u0026\u0026 m_dispatcher.NeedsCollision(sphereObj, boxObj))\n\t\t{\n\t\t\tm_manifoldPtr = m_dispatcher.GetNewManifold(sphereObj, boxObj);\n\t\t\tm_ownManifold = true;\n\t\t}\n\t}\n\n\tpublic override void Cleanup()\n\t{\n\t\tif (m_ownManifold)\n\t\t{\n\t\t\tif (m_manifoldPtr != null)\n\t\t\t{\n\t\t\t\tm_dispatcher.ReleaseManifold(m_manifoldPtr);\n\t\t\t\tm_manifoldPtr = null;\n\t\t\t}\n\n\t\t\tm_ownManifold = false;\n\t\t}\n\n\t\tm_ownManifold = false;\n\t\tBulletGlobals.SphereBoxCollisionAlgorithmPool.Free(this);\n\t}\n\n\tpublic override void ProcessCollision(CollisionObject body0, CollisionObject body1, DispatcherInfo dispatchInfo, ManifoldResult resultOut)\n\t{\n\t\t//(void)dispatchInfo;\n\t\t//(void)resultOut;\n\t\tif (m_manifoldPtr == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tCollisionObject sphereObj = m_isSwapped ? body1 : body0;\n\t\tCollisionObject boxObj = m_isSwapped ? body0 : body1;\n\t\tIndexedVector3 pOnBox = new IndexedVector3();\n\t\t;\n\t\tIndexedVector3 normalOnSurfaceB = new IndexedVector3();\n\t\tfloat penetrationDepth = 0f;\n\t\tIndexedVector3 sphereCenter = sphereObj.GetWorldTransform()._origin;\n\t\tSphereShape sphere0 = sphereObj.GetCollisionShape() as SphereShape;\n\t\tfloat radius = sphere0.GetRadius();\n\t\tfloat maxContactDistance = m_manifoldPtr.GetContactBreakingThreshold();\n\t\tresultOut.SetPersistentManifold(m_manifoldPtr);\n\t\tif (GetSphereDistance(boxObj, ref pOnBox, ref normalOnSurfaceB, ref penetrationDepth, sphereCenter, radius, maxContactDistance))\n\t\t{\n\t\t\tresultOut.AddContactPoint(normalOnSurfaceB, pOnBox, penetrationDepth);\n\t\t}\n\n\t\tif (m_ownManifold)\n\t\t{\n\t\t\tif (m_manifoldPtr.GetNumContacts() \u003E 0)\n\t\t\t{\n\t\t\t\tresultOut.RefreshContactPoints();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic override float CalculateTimeOfImpact(CollisionObject body0, CollisionObject body1, DispatcherInfo dispatchInfo, ManifoldResult resultOut)\n\t{\n\t\treturn 1f;\n\t}\n\n\tpublic override void GetAllContactManifolds(PersistentManifoldArray manifoldArray)\n\t{\n\t\tif (m_manifoldPtr != null \u0026\u0026 m_ownManifold)\n\t\t{\n\t\t\tmanifoldArray.Add(m_manifoldPtr);\n\t\t}\n\t}\n\n\tpublic bool GetSphereDistance(CollisionObject boxObj, ref IndexedVector3 pointOnBox, ref IndexedVector3 normal, ref float penetrationDepth, IndexedVector3 sphereCenter, float fRadius, float maxContactDistance)\n\t{\n\t\tBoxShape boxShape = boxObj.GetCollisionShape() as BoxShape;\n\t\tIndexedVector3 boxHalfExtent = boxShape.GetHalfExtentsWithoutMargin();\n\t\tfloat boxMargin = boxShape.GetMargin();\n\t\tpenetrationDepth = 1.0f;\n\t\t// convert the sphere position to the box\u0027s local space\n\t\tIndexedMatrix m44T = boxObj.GetWorldTransform();\n\t\tIndexedVector3 sphereRelPos = m44T.InvXform(sphereCenter);\n\t\t// Determine the closest point to the sphere center in the box\n\t\tIndexedVector3 closestPoint = sphereRelPos;\n\t\tclosestPoint.X = (Math.Min(boxHalfExtent.X, closestPoint.X));\n\t\tclosestPoint.X = (Math.Max(-boxHalfExtent.X, closestPoint.X));\n\t\tclosestPoint.Y = (Math.Min(boxHalfExtent.Y, closestPoint.Y));\n\t\tclosestPoint.Y = (Math.Max(-boxHalfExtent.Y, closestPoint.Y));\n\t\tclosestPoint.Z = (Math.Min(boxHalfExtent.Z, closestPoint.Z));\n\t\tclosestPoint.Z = (Math.Max(-boxHalfExtent.Z, closestPoint.Z));\n\t\tfloat intersectionDist = fRadius \u002B boxMargin;\n\t\tfloat contactDist = intersectionDist \u002B maxContactDistance;\n\t\tnormal = sphereRelPos - closestPoint;\n\t\t//if there is no penetration, we are done\n\t\tfloat dist2 = normal.LengthSquared();\n\t\tif (dist2 \u003E contactDist * contactDist)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tfloat distance;\n\t\t//special case if the sphere center is inside the box\n\t\tif (dist2 == 0.0f)\n\t\t{\n\t\t\tdistance = -GetSpherePenetration(ref boxHalfExtent, ref sphereRelPos, ref closestPoint, ref normal);\n\t\t}\n\t\telse //compute the penetration details\n\t\t{\n\t\t\tdistance = normal.Length();\n\t\t\tnormal /= distance;\n\t\t}\n\n\t\tpointOnBox = closestPoint \u002B normal * boxMargin;\n\t\t//\tv3PointOnSphere = sphereRelPos - (normal * fRadius);\n\t\tpenetrationDepth = distance - intersectionDist;\n\t\t// transform back in world space\n\t\tIndexedVector3 tmp = m44T * pointOnBox;\n\t\tpointOnBox = tmp;\n\t\t//\ttmp = m44T(v3PointOnSphere);\n\t\t//\tv3PointOnSphere = tmp;\n\t\ttmp = m44T._basis * normal;\n\t\tnormal = tmp;\n\t\treturn true;\n\t}\n\n\tpublic float GetSpherePenetration(ref IndexedVector3 boxHalfExtent, ref IndexedVector3 sphereRelPos, ref IndexedVector3 closestPoint, ref IndexedVector3 normal)\n\t{\n\t\t//project the center of the sphere on the closest face of the box\n\t\tfloat faceDist = boxHalfExtent.X - sphereRelPos.X;\n\t\tfloat minDist = faceDist;\n\t\tclosestPoint.X = (boxHalfExtent.X);\n\t\tnormal = new IndexedVector3(1.0f, 0.0f, 0.0f);\n\t\tfaceDist = boxHalfExtent.X \u002B sphereRelPos.X;\n\t\tif (faceDist \u003C minDist)\n\t\t{\n\t\t\tminDist = faceDist;\n\t\t\tclosestPoint = sphereRelPos;\n\t\t\tclosestPoint.X = (-boxHalfExtent.X);\n\t\t\tnormal = new IndexedVector3(-1.0f, 0.0f, 0.0f);\n\t\t}\n\n\t\tfaceDist = boxHalfExtent.Y - sphereRelPos.Y;\n\t\tif (faceDist \u003C minDist)\n\t\t{\n\t\t\tminDist = faceDist;\n\t\t\tclosestPoint = sphereRelPos;\n\t\t\tclosestPoint.Y = (boxHalfExtent.Y);\n\t\t\tnormal = new IndexedVector3(0.0f, 1.0f, 0.0f);\n\t\t}\n\n\t\tfaceDist = boxHalfExtent.Y \u002B sphereRelPos.Y;\n\t\tif (faceDist \u003C minDist)\n\t\t{\n\t\t\tminDist = faceDist;\n\t\t\tclosestPoint = sphereRelPos;\n\t\t\tclosestPoint.Y = (-boxHalfExtent.Y);\n\t\t\tnormal = new IndexedVector3(0.0f, -1.0f, 0.0f);\n\t\t}\n\n\t\tfaceDist = boxHalfExtent.Z - sphereRelPos.Z;\n\t\tif (faceDist \u003C minDist)\n\t\t{\n\t\t\tminDist = faceDist;\n\t\t\tclosestPoint = sphereRelPos;\n\t\t\tclosestPoint.Z = (boxHalfExtent.Z);\n\t\t\tnormal = new IndexedVector3(0.0f, 0.0f, 1.0f);\n\t\t}\n\n\t\tfaceDist = boxHalfExtent.Z \u002B sphereRelPos.Z;\n\t\tif (faceDist \u003C minDist)\n\t\t{\n\t\t\tminDist = faceDist;\n\t\t\tclosestPoint = sphereRelPos;\n\t\t\tclosestPoint.Z = (-boxHalfExtent.Z);\n\t\t\tnormal = new IndexedVector3(0.0f, 0.0f, -1.0f);\n\t\t}\n\n\t\treturn minDist;\n\t}\n\n\tprivate bool m_ownManifold;\n\tprivate PersistentManifold m_manifoldPtr;\n\tprivate bool m_isSwapped;\n}"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/sStkNP.cs","FileName":"sStkNP.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n* C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n*\n* Bullet Continuous Collision Detection and Physics Library\n* Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n*\n* This software is provided \u0027as-is\u0027, without any express or implied warranty.\n* In no event will the authors be held liable for any damages arising from\n* the use of this software.\n*\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n*\n* 1. The origin of this software must not be misrepresented; you must not\n*    claim that you wrote the original software. If you use this software\n*    in a product, an acknowledgment in the product documentation would be\n*    appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n*    misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System;\nusing System.Collections.Generic;\nusing HumanoidRetargeter.Core.Formats.Mmd.Bullet.LinearMath;\nusing System.Diagnostics;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal struct sStkNP\n{\n\tpublic DbvtNode node;\n\tpublic uint mask;\n\tpublic sStkNP(DbvtNode n, uint m)\n\t{\n\t\tnode = n;\n\t\tmask = m;\n\t}\n};"},{"Ident":"notpointless.chomnr_humanoid_retargeter","Path":"HumanoidRetargeter/Core/Formats/Mmd/Bullet/BulletCollision/TriangleInfo.cs","FileName":"TriangleInfo.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":444434,"IsPrivate":false,"Code":"/*\n * C# / XNA  port of Bullet (c) 2011 Mark Neale \u003Cxexuxjy@hotmail.com\u003E\n *\n * Bullet Continuous Collision Detection and Physics Library\n * Copyright (c) 2003-2008 Erwin Coumans  http://www.bulletphysics.com/\n *\n * This software is provided \u0027as-is\u0027, without any express or implied warranty.\n * In no event will the authors be held liable for any damages arising from\n * the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n// Adapted from BulletXNA 73b2e1b9: namespace isolation, no XNA rendering, one type per file.\n#nullable disable\n#pragma warning disable CS1591, CS0168, CS0219, CS0414, CS0660, CS0661, CS0659, CS0693, CS8981, CS0108, CS0114\nusing System.Collections.Generic;\n\nnamespace HumanoidRetargeter.Core.Formats.Mmd.Bullet.BulletCollision;\n\ninternal class TriangleInfo\n{\n\tpublic TriangleInfo()\n\t{\n\t\tm_edgeV0V1Angle = MathUtil.SIMD_2_PI;\n\t\tm_edgeV1V2Angle = MathUtil.SIMD_2_PI;\n\t\tm_edgeV2V0Angle = MathUtil.SIMD_2_PI;\n\t\tm_flags = 0;\n\t}\n\n\tpublic int m_flags;\n\tpublic float m_edgeV0V1Angle;\n\tpublic float m_edgeV1V2Angle;\n\tpublic float m_edgeV2V0Angle;\n}"}]}