예제 #1
0
        /// <summary>
        // Given arbitrary point Point will return the nearest point on the surface
        /// </summary>
        /// <param name="Point"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public Vector3d GetNearestPointOnSurface(Vector3d Point, double offset = 1)
        {
            Vector3d dir = Point - Position;

            dir.Normalize();

            Vector3d Result = Point;

            if (Tag != null)
            {
                MModel         model = (MModel)Tag;
                MPhysicsObject ph    = (MPhysicsObject)model.FindModuleByType(EType.PhysicsObject);

                bool Success = false;

                MPhysics.Instance.RayCastRequest(Point, Position, this, (result) =>
                {
                    Vector3d pt = result.Hitpoint;
                    if (Success)
                    {
                        Result = pt + dir * offset;
                    }
                    else
                    {
                        Result = Position + dir * (Radius.X + offset);
                    }
                });
            }
            return(Result);
        }
예제 #2
0
 private void BackExecute(object obj)
 {
     MModel.ShowFirstWindow();
 }