Exemple #1
0
 static public Plane MultiplyPlane(this Matrix4x4 item, Plane plane)
 {
     return(PlaneExtensions.CreateNormalAndPoint(
                item.MultiplyVector(plane.normal),
                item.MultiplyPoint(plane.GetOrigin())
                ));
 }
Exemple #2
0
        static public void CalculateUVs(this Mesh item)
        {
            Vector2[] uvs = new Vector2[item.vertexCount];

            for (int i = 0; i < item.vertexCount; i++)
            {
                Vector3 normal   = item.normals[i];
                Vector3 position = item.vertices[i];

                PlaneSpace place = new PlaneSpace(PlaneExtensions.CreateNormalAndDistance(normal, 0.0f));

                uvs[i] = place.ProjectPoint(position);
            }

            item.uv = uvs;
        }
Exemple #3
0
 static public Plane GetPlane(this Triangle3 item)
 {
     return(PlaneExtensions.CreatePoints(item.v0, item.v1, item.v2));
 }
Exemple #4
0
 static public Plane GetFlipped(this Plane item)
 {
     return(PlaneExtensions.CreateNormalAndPoint(-item.normal, item.GetOrigin()));
 }