### Resetting PeasyCam (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Resets the camera to its initial starting settings. ```Java camera.reset(); ``` -------------------------------- ### Getting PeasyCam State (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Retrieves the current camera settings as a serializable `CameraState` object. ```Java CameraState state = camera.getState(); ``` -------------------------------- ### Resetting PeasyCam with Animation (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Resets the camera to its initial starting settings, animating the transition over a specified duration in milliseconds. ```Java camera.reset(long animationTimeInMillis); ``` -------------------------------- ### Basic PeasyCam Sketch - Processing Source: https://github.com/jdf/peasycam/blob/master/web/index.html A complete Processing sketch demonstrating basic PeasyCam setup and usage with a simple 3D scene. Initializes the camera, sets distance limits, and draws rotating boxes. ```Processing import peasy.*; PeasyCam cam; void setup() { size(200,200,P3D); cam = new PeasyCam(this, 100); cam.setMinimumDistance(50); cam.setMaximumDistance(500); } void draw() { rotateX(-.5); rotateY(-.5); background(0); fill(255,0,0); box(30); pushMatrix(); translate(0,0,20); fill(0,0,255); box(5); popMatrix(); } ``` -------------------------------- ### Beginning PeasyCam HUD Drawing (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Starts a drawing block where subsequent drawing commands will be relative to the camera's position and orientation, useful for Heads-Up Displays. ```Java camera.beginHUD(); ``` -------------------------------- ### Getting PeasyCam Wheel Scale (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Retrieves the current sensitivity scale for the mouse wheel zoom. ```Java double getWheelScale(); ``` -------------------------------- ### Getting PeasyCam Rotations (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Retrieves the pitch, yaw, and roll rotations required to orient the camera in model space as a float array {pitch, yaw, roll}. ```Java float[] rotations = camera.getRotations(); ``` -------------------------------- ### Getting PeasyCam Zoom Wheel Handler (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Retrieves the currently assigned handler for the zoom wheel event. ```Java PeasyWheelHandler getZoomWheelHandler(); ``` -------------------------------- ### Getting PeasyCam Zoom Drag Handler (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Retrieves the currently assigned handler for the zoom drag gesture. ```Java PeasyDragHandler getZoomDragHandler(); ``` -------------------------------- ### Getting PeasyCam Pan Drag Handler (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Retrieves the currently assigned handler for the pan drag gesture. ```Java PeasyDragHandler getPanDragHandler(); ``` -------------------------------- ### Getting PeasyCam Look-At Point (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Retrieves the coordinates of the point the camera is currently looking at as a float array {x, y, z}. ```Java float[] camera.getLookAt(); ``` -------------------------------- ### Getting PeasyCam Distance (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Retrieves the current distance of the camera from the looked-at point. ```Java double camera.getDistance(); ``` -------------------------------- ### Getting PeasyCam Position (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Retrieves the coordinates of the camera's position in model space as a float array {x, y, z}. ```Java float[] position = camera.getPosition(); ``` -------------------------------- ### Getting PeasyCam Rotate Drag Handler (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Retrieves the currently assigned handler for the rotate drag gesture. ```Java PeasyDragHandler getRotateDragHandler(); ``` -------------------------------- ### Simple PeasyCam Initialization - Processing Source: https://github.com/jdf/peasycam/blob/master/web/index.html Demonstrates the simplest way to initialize a PeasyCam instance in a Processing sketch, setting the look-at point and initial distance. ```Processing PeasyCam camera; void setup() { camera = new PeasyCam(this, 0, 0, 0, 50); } ``` -------------------------------- ### PeasyCam Constructors - Processing Source: https://github.com/jdf/peasycam/blob/master/web/index.html Shows the available constructors for creating a PeasyCam instance, allowing specification of the parent PApplet, look-at point coordinates, and initial distance. ```Processing PeasyCam(PApplet parent, double lookAtX, double lookAtY, double lookAtZ, double distance); PeasyCam(PApplet parent, double distance); // look at 0,0,0 ``` -------------------------------- ### Setting PeasyCam Look-At Point, Distance, and Animation (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Sets the point the camera is looking at and the distance, animating the transition over a specified duration in milliseconds. ```Java camera.lookAt(double x, double y, double z, double distance, long animationTimeInMillis); ``` -------------------------------- ### Setting PeasyCam Look-At Point with Animation (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Sets the point the camera is looking at, animating the transition over a specified duration in milliseconds. ```Java camera.lookAt(double x, double y, double z, long animationTimeInMillis); ``` -------------------------------- ### Setting PeasyCam State with Animation (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Sets the camera to a previously saved state, animating the transition over a specified duration in milliseconds. ```Java camera.setState(CameraState state, long animationTimeInMillis); ``` -------------------------------- ### Setting PeasyCam Look-At Point and Distance (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Sets the point the camera is looking at and simultaneously sets the distance from that point. ```Java camera.lookAt(double x, double y, double z, double distance); ``` -------------------------------- ### Defining PeasyWheelHandler Interface (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Defines the interface for custom mouse wheel handlers. Implement this interface to create custom behavior for mouse wheel events, receiving the delta value. ```Java public interface PeasyWheelHandler { public void handleWheel(final int delta); } ``` -------------------------------- ### Setting PeasyCam Look-At Point (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Sets the point in 3D space that the camera is looking at. ```Java camera.lookAt(double x, double y, double z); ``` -------------------------------- ### Setting PeasyCam State (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Sets the camera to a previously saved state defined by a `CameraState` object. ```Java camera.setState(CameraState state); ``` -------------------------------- ### Setting PeasyCam Rotations (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Sets the camera's rotation using pitch, yaw, and roll angles. Rotations are applied in that specific order. ```Java camera.setRotations(double pitch, double yaw, double roll); ``` -------------------------------- ### Setting PeasyCam Active State (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Controls whether the camera responds to mouse input. Set to `false` to disable interaction. ```Java camera.setActive(boolean active); ``` -------------------------------- ### Setting PeasyCam Minimum Distance (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Sets the minimum allowed distance for zooming, clamping the camera's distance. ```Java camera.setMinimumDistance(double minimumDistance); ``` -------------------------------- ### Defining PeasyDragHandler Interface (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Defines the interface for custom drag handlers. Implement this interface to create custom behavior for mouse drag events, receiving delta values for x and y movement. ```Java public interface PeasyDragHandler { public void handleDrag(final double dx, final double dy); } ``` -------------------------------- ### Setting PeasyCam Maximum Distance (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Sets the maximum allowed distance for zooming, clamping the camera's distance. ```Java camera.setMaximumDistance(double maximumDistance); ``` -------------------------------- ### Setting PeasyCam Distance (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Sets the distance of the camera from the point it is looking at. ```Java camera.setDistance(double d); ``` -------------------------------- ### Setting PeasyCam Free Rotation Mode (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Resets the camera to its default rotation mode, allowing free rotation around the look-at point. ```Java camera.setFreeRotationMode(); ``` -------------------------------- ### Setting PeasyCam Wheel Handler (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Assigns a custom handler for mouse wheel events. Set to `null` to disable. By default, the mouse wheel controls zoom. ```Java camera.setWheelHandler(PeasyWheelHandler handler); ``` -------------------------------- ### Setting PeasyCam Left Drag Handler (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Assigns a custom handler for the left mouse button drag gesture. Set to `null` to disable. ```Java camera.setLeftDragHandler(PeasyDragHandler handler); ``` -------------------------------- ### Setting PeasyCam Reset On Double Click (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Enables or disables the camera reset functionality when the mouse is double-clicked. Default is `true`. ```Java camera.setResetOnDoubleClick(boolean resetOnDoubleClick); ``` -------------------------------- ### Setting PeasyCam Wheel Scale (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Changes the sensitivity of the built-in mouse wheel zoom functionality. Default scale is 1.0. ```Java camera.setWheelScale(double scale); ``` -------------------------------- ### Setting PeasyCam Center Drag Handler (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Assigns a custom handler for the center mouse button drag gesture. Set to `null` to disable. ```Java camera.setCenterDragHandler(PeasyDragHandler handler); ``` -------------------------------- ### Setting PeasyCam Right Drag Handler (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Assigns a custom handler for the right mouse button drag gesture. Set to `null` to disable. ```Java camera.setRightDragHandler(PeasyDragHandler handler); ``` -------------------------------- ### Panning PeasyCam (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Moves the looked-at point relative to the camera's current orientation by the specified delta values. ```Java camera.pan(double dx, double dy); ``` -------------------------------- ### Ending PeasyCam HUD Drawing (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Ends the drawing block that was relative to the camera's position and orientation. This method should always be called after `beginHUD()`. ```Java camera.endHUD(); ``` -------------------------------- ### Setting PeasyCam Pitch Rotation Mode (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Constrains camera rotation to the pitch axis around the look-at point, similar to a somersault. ```Java camera.setPitchRotationMode(); ``` -------------------------------- ### Rotating PeasyCam Around X-Axis (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Rotates the camera around the X-axis passing through the looked-at point by the specified angle. ```Java camera.rotateX(double angle); ``` -------------------------------- ### Setting PeasyCam Roll Rotation Mode (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Constrains camera rotation to the roll axis around the look-at point, similar to turning a radio knob. ```Java camera.setRollRotationMode(); ``` -------------------------------- ### Setting PeasyCam Yaw Rotation Mode (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Constrains camera rotation to the yaw axis around the look-at point, similar to spinning a globe. ```Java camera.setYawRotationMode(); ``` -------------------------------- ### Rotating PeasyCam Around Z-Axis (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Rotates the camera around the Z-axis passing through the looked-at point by the specified angle. ```Java camera.rotateZ(double angle); ``` -------------------------------- ### Suppressing PeasyCam Roll Rotation (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Permits only pitch and yaw rotation modes, suppressing roll rotation. ```Java camera.setSuppressRollRotationMode(); ``` -------------------------------- ### Rotating PeasyCam Around Y-Axis (Java) Source: https://github.com/jdf/peasycam/blob/master/web/index.html Rotates the camera around the Y-axis passing through the looked-at point by the specified angle. ```Java camera.rotateY(double angle); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.