GetWorldRayFromScreenPoint() 공개 정적인 메소드

public static GetWorldRayFromScreenPoint ( Vec2 screenPoint, Vec3 &raySrc, Vec3 &rayDir ) : void
screenPoint Vec2
raySrc Vec3
rayDir Vec3
리턴 void
예제 #1
0
        public bool GetVirtualPos(out Vec3 pos)
        {
            Vec3 raySrc;
            Vec3 rayDir;

            Editor.GetWorldRayFromScreenPoint(Editor.Viewport.NormalizedMousePos, out raySrc, out rayDir);
            if (!this.m_virtualPlane.RayIntersect(raySrc, rayDir, out pos))
            {
                return(false);
            }
            switch (this.m_axisConstraint)
            {
            case Axis.X:
                pos = Vec3.Dot(pos, this.m_virtualPlaneBase.axisX) * this.m_virtualPlaneBase.axisX;
                break;

            case Axis.Y:
                pos = Vec3.Dot(pos, this.m_virtualPlaneBase.axisY) * this.m_virtualPlaneBase.axisY;
                break;

            case Axis.Z:
                pos = Vec3.Dot(pos, this.m_virtualPlaneBase.axisZ) * this.m_virtualPlaneBase.axisZ;
                break;
            }
            return(true);
        }
예제 #2
0
        public static bool RayCastPhysicsFromScreenPoint(Vec2 screenPoint, out Vec3 hitPos)
        {
            Vec3 raySrc;
            Vec3 rayDir;

            Editor.GetWorldRayFromScreenPoint(screenPoint, out raySrc, out rayDir);
            float num;

            return(Editor.RayCastPhysics(raySrc, rayDir, EditorObject.Null, out hitPos, out num));
        }
예제 #3
0
        public static bool RayCastTerrainFromScreenPoint(Vec2 screenPoint, out Vec3 hitPos)
        {
            Vec3 raySrc;
            Vec3 rayDir;

            Editor.GetWorldRayFromScreenPoint(screenPoint, out raySrc, out rayDir);
            float num;

            return(Editor.RayCastTerrain(raySrc, rayDir, out hitPos, out num));
        }