Class Manipulator.Builder
- java.lang.Object
-
- com.google.android.filament.utils.Manipulator.Builder
-
- Enclosing class:
- Manipulator
public static class Manipulator.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Manipulatorbuild(Manipulator.Mode mode)Creates and returns theManipulatorobject.Manipulator.BuilderfarPlane(float arg)Sets the distance to the far plane, which defaults to 5000.Manipulator.BuilderflightMaxMoveSpeed(float maxSpeed)Sets the maximum camera translation speed in world units per second for FREE_FLIGHT mode.Manipulator.BuilderflightMoveDamping(float damping)Applies a deceleration to camera movement in FREE_FLIGHT mode.Manipulator.BuilderflightPanSpeed(float x, float y)Sets the multiplier with viewport delta for FREE_FLIGHT mode.Manipulator.BuilderflightSpeedSteps(int steps)Sets the number of speed steps adjustable with scroll wheel for FREE_FLIGHT mode.Manipulator.BuilderflightStartOrientation(float pitch, float yaw)Sets the initial orientation in pitch and yaw for FREE_FLIGHT mode.Manipulator.BuilderflightStartPosition(float x, float y, float z)Sets the initial eye position in world space for FREE_FLIGHT mode.Manipulator.BuilderfovDegrees(float arg)Sets the full FOV (not the half-angle) in the degrees.Manipulator.BuilderfovDirection(Manipulator.Fov fov)Sets the FOV axis that's held constant when the viewport changes.Manipulator.BuildergroundPlane(float a, float b, float c, float d)Sets the ground plane equation used for ray casts.Manipulator.BuildermapExtent(float width, float height)Sets the ground plane size used to compute the home position for MAP mode.Manipulator.BuildermapMinDistance(float arg)Constrains the zoom-in level.Manipulator.BuilderorbitHomePosition(float x, float y, float z)Sets initial eye position in world space for ORBIT mode.Manipulator.BuilderorbitSpeed(float x, float y)Sets the multiplier with viewport delta for ORBIT mode.Manipulator.BuildertargetPosition(float x, float y, float z)Sets world-space position of interest, which defaults to (0,0,0).Manipulator.BuilderupVector(float x, float y, float z)Sets orientation for the home position, which defaults to (0,1,0).Manipulator.Builderviewport(int width, int height)Width and height of the viewing area.Manipulator.BuilderzoomSpeed(float arg)Sets the scroll delta multiplier, which defaults to 0.01.
-
-
-
Method Detail
-
viewport
@NonNull public Manipulator.Builder viewport(@IntRange(from=1L) int width, @IntRange(from=1L) int height)
Width and height of the viewing area.- Returns:
- this
Builderobject for chaining calls
-
targetPosition
@NonNull public Manipulator.Builder targetPosition(float x, float y, float z)
Sets world-space position of interest, which defaults to (0,0,0).- Returns:
- this
Builderobject for chaining calls
-
upVector
@NonNull public Manipulator.Builder upVector(float x, float y, float z)
Sets orientation for the home position, which defaults to (0,1,0).- Returns:
- this
Builderobject for chaining calls
-
zoomSpeed
@NonNull public Manipulator.Builder zoomSpeed(float arg)
Sets the scroll delta multiplier, which defaults to 0.01.- Returns:
- this
Builderobject for chaining calls
-
orbitHomePosition
@NonNull public Manipulator.Builder orbitHomePosition(float x, float y, float z)
Sets initial eye position in world space for ORBIT mode. This defaults to (0,0,1).- Returns:
- this
Builderobject for chaining calls
-
orbitSpeed
@NonNull public Manipulator.Builder orbitSpeed(float x, float y)
Sets the multiplier with viewport delta for ORBIT mode. This defaults to 0.01- Returns:
- this
Builderobject for chaining calls
-
fovDirection
@NonNull public Manipulator.Builder fovDirection(Manipulator.Fov fov)
Sets the FOV axis that's held constant when the viewport changes. This defaults to Vertical.- Returns:
- this
Builderobject for chaining calls
-
fovDegrees
@NonNull public Manipulator.Builder fovDegrees(float arg)
Sets the full FOV (not the half-angle) in the degrees. This defaults to 33.- Returns:
- this
Builderobject for chaining calls
-
farPlane
@NonNull public Manipulator.Builder farPlane(float arg)
Sets the distance to the far plane, which defaults to 5000.- Returns:
- this
Builderobject for chaining calls
-
mapExtent
@NonNull public Manipulator.Builder mapExtent(float width, float height)
Sets the ground plane size used to compute the home position for MAP mode. This defaults to 512 x 512- Returns:
- this
Builderobject for chaining calls
-
mapMinDistance
@NonNull public Manipulator.Builder mapMinDistance(float arg)
Constrains the zoom-in level. Defaults to 0.- Returns:
- this
Builderobject for chaining calls
-
flightStartPosition
public Manipulator.Builder flightStartPosition(float x, float y, float z)
Sets the initial eye position in world space for FREE_FLIGHT mode. Defaults to (0,0,0).- Returns:
- this
Builderobject for chaining calls
-
flightStartOrientation
public Manipulator.Builder flightStartOrientation(float pitch, float yaw)
Sets the initial orientation in pitch and yaw for FREE_FLIGHT mode. Defaults to (0,0).- Returns:
- this
Builderobject for chaining calls
-
flightMaxMoveSpeed
public Manipulator.Builder flightMaxMoveSpeed(float maxSpeed)
Sets the maximum camera translation speed in world units per second for FREE_FLIGHT mode. Defaults to 10.- Returns:
- this
Builderobject for chaining calls
-
flightSpeedSteps
public Manipulator.Builder flightSpeedSteps(int steps)
Sets the number of speed steps adjustable with scroll wheel for FREE_FLIGHT mode. Defaults to 80.- Returns:
- this
Builderobject for chaining calls
-
flightPanSpeed
public Manipulator.Builder flightPanSpeed(float x, float y)
Sets the multiplier with viewport delta for FREE_FLIGHT mode. This defaults to 0.01.- Returns:
- this
Builderobject for chaining calls
-
flightMoveDamping
public Manipulator.Builder flightMoveDamping(float damping)
Applies a deceleration to camera movement in FREE_FLIGHT mode. Defaults to 0 (no damping). Lower values give slower damping times. A good default is 15.0. Too high a value may lead to instability.- Returns:
- this
Builderobject for chaining calls
-
groundPlane
@NonNull public Manipulator.Builder groundPlane(float a, float b, float c, float d)
Sets the ground plane equation used for ray casts. This is a plane equation as in Ax + By + Cz + D = 0. Defaults to (0, 0, 1, 0).- Returns:
- this
Builderobject for chaining calls
-
build
@NonNull public Manipulator build(Manipulator.Mode mode)
Creates and returns theManipulatorobject.- Returns:
- the newly created
Manipulatorobject - Throws:
java.lang.IllegalStateException- if the Manipulator could not be created
-
-