Ejemplo n.º 1
0
        public DMeshSO BuildSO(FScene scene, SOMaterial material)
        {
            DMesh3 revolveMesh = UnityUtil.UnityMeshToDMesh(meshObject.GetSharedMesh(), false);

            // move axis frame to center of bbox of mesh, measured in axis frame
            Frame3f          useF          = OutputFrame;
            AxisAlignedBox3f boundsInFrame = (AxisAlignedBox3f)BoundsUtil.BoundsInFrame(revolveMesh.Vertices(), useF);

            useF.Origin = useF.FromFrameP(boundsInFrame.Center);

            // transform mesh into this frame
            MeshTransforms.ToFrame(revolveMesh, useF);

            // create new so
            DMeshSO meshSO = new DMeshSO();

            meshSO.Create(revolveMesh, material);
            meshSO.SetLocalFrame(useF, CoordSpace.ObjectCoords);

            return(meshSO);
        }