1 /*
2 * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
28 import javafx.beans.InvalidationListener;
29 import javafx.beans.Observable;
30 import javafx.beans.property.DoubleProperty;
31 import javafx.beans.property.SimpleDoubleProperty;
32 import javafx.geometry.Point2D;
33 import javafx.geometry.Point3D;
34 import javafx.scene.transform.Transform;
35 import com.sun.javafx.geom.BaseBounds;
36 import com.sun.javafx.geom.BoxBounds;
37 import com.sun.javafx.geom.PickRay;
38 import com.sun.javafx.geom.Vec3d;
39 import com.sun.javafx.geom.transform.Affine3D;
40 import com.sun.javafx.geom.transform.BaseTransform;
41 import com.sun.javafx.geom.transform.GeneralTransform3D;
42 import com.sun.javafx.geom.transform.NoninvertibleTransformException;
43 import com.sun.javafx.scene.CameraHelper;
44 import com.sun.javafx.scene.DirtyBits;
45 import com.sun.javafx.scene.NodeHelper;
46 import com.sun.javafx.scene.transform.TransformHelper;
47 import com.sun.javafx.sg.prism.NGCamera;
48 import sun.util.logging.PlatformLogger;
49
50
51 /**
52 * Base class for a camera used to render a scene.
53 * The camera defines the mapping of the scene coordinate space onto the window.
54 * Camera is an abstract class with two concrete subclasses:
55 * {@link ParallelCamera} and {@link PerspectiveCamera}.
56 *
57 * <p>
58 * The default camera is positioned in the scene such that its projection plane
59 * in the scene coordinate space is at Z = 0, and it is looking into the screen in
60 * the positive Z direction. The distance in Z from the camera to the projection
61 * plane is determined by the {@code width} and {@code height} of the Scene to
62 * which it is attached and its {@code fieldOfView}.
63 * </p>
64 *
65 * <p>
66 * The {@code nearClip} and {@code farClip} of this camera are specified in the
67 * eye coordinate space. This space is defined such that the eye is at its
68 * origin and the projection plane is one unit in front of the eye in the
|
1 /*
2 * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
28 import javafx.beans.InvalidationListener;
29 import javafx.beans.Observable;
30 import javafx.beans.property.DoubleProperty;
31 import javafx.beans.property.SimpleDoubleProperty;
32 import javafx.geometry.Point2D;
33 import javafx.geometry.Point3D;
34 import javafx.scene.transform.Transform;
35 import com.sun.javafx.geom.BaseBounds;
36 import com.sun.javafx.geom.BoxBounds;
37 import com.sun.javafx.geom.PickRay;
38 import com.sun.javafx.geom.Vec3d;
39 import com.sun.javafx.geom.transform.Affine3D;
40 import com.sun.javafx.geom.transform.BaseTransform;
41 import com.sun.javafx.geom.transform.GeneralTransform3D;
42 import com.sun.javafx.geom.transform.NoninvertibleTransformException;
43 import com.sun.javafx.scene.CameraHelper;
44 import com.sun.javafx.scene.DirtyBits;
45 import com.sun.javafx.scene.NodeHelper;
46 import com.sun.javafx.scene.transform.TransformHelper;
47 import com.sun.javafx.sg.prism.NGCamera;
48 import com.sun.javafx.logging.PlatformLogger;
49
50
51 /**
52 * Base class for a camera used to render a scene.
53 * The camera defines the mapping of the scene coordinate space onto the window.
54 * Camera is an abstract class with two concrete subclasses:
55 * {@link ParallelCamera} and {@link PerspectiveCamera}.
56 *
57 * <p>
58 * The default camera is positioned in the scene such that its projection plane
59 * in the scene coordinate space is at Z = 0, and it is looking into the screen in
60 * the positive Z direction. The distance in Z from the camera to the projection
61 * plane is determined by the {@code width} and {@code height} of the Scene to
62 * which it is attached and its {@code fieldOfView}.
63 * </p>
64 *
65 * <p>
66 * The {@code nearClip} and {@code farClip} of this camera are specified in the
67 * eye coordinate space. This space is defined such that the eye is at its
68 * origin and the projection plane is one unit in front of the eye in the
|