⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 camera.java

📁 java 3d game jme 工程开发源代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
     * <code>getFrustumTop</code> gets the value of the top frustum plane.
     *
     * @return the value of the top frustum plane.
     */
    float getFrustumTop();

    /**
     * <code>setFrustumTop</code> sets the value of the top frustum plane.
     *
     * @param frustumTop the value of the top frustum plane.
     */
    void setFrustumTop( float frustumTop );

    /**
     * <code>setFrame</code> sets the view frame of the camera by setting the
     * location and orientation of the camera model.
     *
     * @param location  the position of the camera.
     * @param left      the left axis of the camera.
     * @param up        the up axis of the camera.
     * @param direction the direction the camera is facing.
     */
    void setFrame( Vector3f location, Vector3f left, Vector3f up,
                          Vector3f direction );

    /**
     * <code>setFrame</code> sets the view frame of the camera by setting the
     * location and the orientation of the camera model.
     *
     * @param location the position of the camera.
     * @param axes     the matrix that defines the orientation of the camera.
     */
    void setFrame( Vector3f location, Quaternion axes );

    /**
     * <code>update</code> updates the frustum viewport and frame of the
     * camera checking for any possible change in the position or orientation of
     * the camera.
     */
    void update();

    void normalize();

    /**
     * <code>getPlaneState</code> returns the state of the frustum planes. So
     * checks can be made as to which frustum plane has been examined for
     * culling thus far.
     *
     * @return the current plane state int.
     */
    int getPlaneState();

    /**
     * <code>setPlaneState</code> sets the state to keep track of tested
     * planes for culling.
     *
     * @param planeState the updated state.
     */
    void setPlaneState( int planeState );

    /**
     * <code>getViewPortLeft</code> gets the left boundary of the viewport
     *
     * @return the left boundary of the viewport
     */
    float getViewPortLeft();

    /**
     * <code>setViewPortLeft</code> sets the left boundary of the viewport
     *
     * @param left the left boundary of the viewport
     */
    void setViewPortLeft( float left );

    /**
     * <code>getViewPortRight</code> gets the right boundary of the viewport
     *
     * @return the right boundary of the viewport
     */
    float getViewPortRight();

    /**
     * <code>setViewPortRight</code> sets the right boundary of the viewport
     *
     * @param right the right boundary of the viewport
     */
    void setViewPortRight( float right );

    /**
     * <code>getViewPortTop</code> gets the top boundary of the viewport
     *
     * @return the top boundary of the viewport
     */
    float getViewPortTop();

    /**
     * <code>setViewPortTop</code> sets the top boundary of the viewport
     *
     * @param top the top boundary of the viewport
     */
    void setViewPortTop( float top );

    /**
     * <code>getViewPortBottom</code> gets the bottom boundary of the viewport
     *
     * @return the bottom boundary of the viewport
     */
    float getViewPortBottom();

    /**
     * <code>setViewPortBottom</code> sets the bottom boundary of the viewport
     *
     * @param bottom the bottom boundary of the viewport
     */
    void setViewPortBottom( float bottom );

    /**
     * <code>setViewPort</code> sets the boundaries of the viewport
     *
     * @param left   the left boundary of the viewport
     * @param right  the right boundary of the viewport
     * @param bottom the bottom boundary of the viewport
     * @param top    the top boundary of the viewport
     */
    void setViewPort( float left, float right, float bottom, float top );

    /**
     * <code>culled</code> tests a bounding volume against the planes of the
     * camera's frustum. The frustums planes are set such that the normals all
     * face in towards the viewable scene. Therefore, if the bounding volume is
     * on the negative side of the plane is can be culled out. If the object
     * should be culled (i.e. not rendered) true is returned, otherwise, false
     * is returned.
     *
     * @param bound the bound to check for culling
     * @return true if the bound should be culled, false otherwise.
     */
    Camera.FrustumIntersect contains( BoundingVolume bound );

    /**
     * <code>onFrustumChange</code> is an update callback that is activated if
     * the frustum values change.
     */
    void onFrustumChange();

    /**
     * <code>onViewPortChange</code> is an update callback that is activated
     * if the view port changes.
     */
    void onViewPortChange();

    /**
     * <code>onFrameChange</code> is an update callback that is activated if
     * the frame changes.
     */
    void onFrameChange();

    /**
     * <code>lookAt</code> is a convienence method for auto-setting the frame
     * based on a world position the user desires the camera to look at. It
     * repoints the camera towards the given position using the difference
     * between the position and the current camera location as a direction
     * vector and the worldUpVector to compute up and left camera vectors.
     *
     * @param pos           where to look at in terms of world coordinates
     * @param worldUpVector a normalized vector indicating the up direction of the world.
     *                      (typically {0, 1, 0} in jME.)
     */
    void lookAt( Vector3f pos, Vector3f worldUpVector );

    /**
     * Resizes this camera's view with the given width and height. This is
     * similar to constructing a new camera, but reusing the same Object. Camera
     * view dimensions are automatically set when the camera is associated with
     * a Renderer.
     * 
     * @param width
     *            the view width
     * @param height
     *            the view height
     */
    void resize(int width, int height);

    /**
     * @return true if parallel projection is enable, false if in normal perspective mode
     * @see #setParallelProjection(boolean)
     */
    boolean isParallelProjection();

    /**
     * Enable/disable parallel projection.
     *
     * @param value true to set up this camera for parallel projection is enable, false to enter normal perspective mode
     */
    void setParallelProjection( boolean value );

    /**
     * Convert screen to world coordinates.
     *
     * @param screenPosition Vector2f representing the screen position with 0,0 at the
     *                       bottom left
     * @param zPos           float The z position away from the viewing plane.
     * @return Vector3f The store vector, after storing it's result.
     */
    Vector3f getWorldCoordinates( Vector2f screenPosition, float zPos );

    /**
     * Convert screen to world coordinates.
     *
     * @param screenPosition Vector2f representing the screen position with 0,0 at the
     *                       bottom left
     * @param zPos           float The z position away from the viewing plane.
     * @param store          Vector3f The vector to store the result in.
     * @return Vector3f The store vector, after storing it's result.
     */
    Vector3f getWorldCoordinates( Vector2f screenPosition, float zPos, Vector3f store );

    /**
     * Convert world to screen coordinates.
     *
     * @param worldPosition Vector3f representing the world position
     * @return Vector3f Screen coordinates, with 0,0 at the bottom left.
     */
    Vector3f getScreenCoordinates( Vector3f worldPosition );

    /**
     * Convert world to screen coordinates.
     *
     * @param worldPosition Vector3f representing the world position
     * @param store         Vector3f The vector to store the result in.
     * @return Vector3f The store vector, after storing it's result.
     *         Screen coordinates, with 0,0 at the bottom left.
     */
    Vector3f getScreenCoordinates( Vector3f worldPosition, Vector3f store );

    /**
     * Apply the settings of the camera to the current graphics state.
     * <p>
     * If state should be applied even if not dirty, make sure to call {@link #update()} before.
     */
    void apply();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -