public void WorldRaycast()
        {
            //null/weird checks
            Assert.DoesNotThrow(() =>
            {
                PolyRaycastHit temp;
                //null
                bool tempHasHit = PolySceneUtility.WorldRaycast(new Ray(), null, null, null, out temp);
                Assert.IsFalse(tempHasHit);
                //empty vertices/triangles
                tempHasHit = PolySceneUtility.WorldRaycast(new Ray(), _testGameObject.transform, new Vector3[0], new int[0], out temp);
                Assert.IsFalse(tempHasHit);
                //empty vertices only
                tempHasHit = PolySceneUtility.WorldRaycast(new Ray(), _testGameObject.transform, new Vector3[0], new int[1] {
                    0
                }, out temp);
                Assert.IsFalse(tempHasHit);
                tempHasHit = PolySceneUtility.WorldRaycast(new Ray(), _testGameObject.transform, new Vector3[0], new int[3] {
                    0, 1, 2
                }, out temp);
                Assert.IsFalse(tempHasHit);
                //empty triangles only
                tempHasHit = PolySceneUtility.WorldRaycast(new Ray(), _testGameObject.transform, new Vector3[1] {
                    Vector3.zero
                }, new int[0], out temp);
                Assert.IsFalse(tempHasHit);
            });

            Ray ray = GetTestRay();

            Vector3[] vertices  = _testGameObject.GetComponent <MeshFilter>().sharedMesh.vertices;
            int[]     triangles = _testGameObject.GetComponent <MeshFilter>().sharedMesh.triangles;

            PolyRaycastHit hit;
            bool           hasHit = PolySceneUtility.WorldRaycast(ray, _testGameObject.transform, vertices, triangles, out hit);

            Assert.IsTrue(hasHit);
            Assert.IsNotNull(hit);
            Assert.IsTrue(hit.distance == 2.5f);                                                          //should be equal to 3 - length of the cube divided by 2, wish is 0.5
            Assert.IsTrue(hit.normal == Vector3.back);                                                    //because the ray is directed to forward, the normal should face the opposite
            Assert.IsTrue(hit.position == _testGameObject.transform.position + new Vector3(0, 0, -0.5f)); //position of the cube - 0.5, half the length of the cube
            Assert.IsTrue(hit.triangle == 4);                                                             //because trust me...jk, pure regression test here.
        }
        public void CalculateWeightedVertices()
        {
            //null checks
            Assert.DoesNotThrow(() =>
            {
                PolySceneUtility.CalculateWeightedVertices(null, null);
            });

            //setup the test
            BrushTarget   target        = new BrushTarget(EditableObject.Create(_testGameObject));
            BrushSettings brushSettings = ScriptableObject.CreateInstance <BrushSettings>();

            Assert.IsNotNull(target);
            Assert.IsNotNull(brushSettings);

            //fill raycasthits, will have to call WorldRaycast, then feed the raycastHits of the target
            Ray            ray = GetTestRay();
            PolyRaycastHit hit;
            bool           hasHit = PolySceneUtility.WorldRaycast(ray, _testGameObject.transform, target.editableObject.editMesh.vertices, target.editableObject.editMesh.GetTriangles(), out hit);

            Assert.IsTrue(hasHit);
            target.raycastHits.Add(hit);

            //then the function will set the weights
            PolySceneUtility.CalculateWeightedVertices(target, brushSettings);

            //check if the weights are not all equal to 0
            bool emptyWeights = true;

            foreach (float weight in target.GetAllWeights())
            {
                if (weight != 0)
                {
                    emptyWeights = false;
                    break;
                }
            }
            if (emptyWeights)
            {
                Assert.Fail("Weights are empty.");
            }
        }