public class ArcBall
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Constrain |
axis |
private AVector[] |
axisSet |
private float |
center_x |
private float |
center_y |
private boolean |
isActive |
private processing.core.PApplet |
parent |
private AQuat |
q_down |
private AQuat |
q_drag |
private AQuat |
q_now |
private float |
radius |
private AVector |
v_down |
private AVector |
v_drag |
private float |
zoom |
private WheelHandler |
zoomWheelHandler |
Constructor and Description |
---|
ArcBall(processing.core.PApplet parent)
Default centered arcball and half width or half height whichever smaller
|
ArcBall(processing.core.PApplet parent,
float center_x,
float center_y,
float radius) |
Modifier and Type | Method and Description |
---|---|
void |
applyQuaternion2Matrix(AQuat q)
Rotate the parent sketch according to the quaternion
|
void |
constrain(Constrain axis)
Constrain rotation to this axis
|
AVector |
constrainVector(AVector vector,
AVector axis)
Returns the PVector if the axis is constrained
|
void |
dispose()
A recommended inclusion for a processing library
|
void |
keyEvent(processing.event.KeyEvent e)
key event to register
|
AVector |
mouse2sphere(float x,
float y)
Returns the PVector of the constrain PVector if constrained
|
void |
mouseEvent(processing.event.MouseEvent e)
mouse event to register
|
void |
pre() |
void |
setActive(boolean active)
May or may not be required for use in Web Applet it works so why worry as
used by Jonathan Feinberg peasycam, and that works OK
|
private void |
update()
Needed to call this in sketch
|
private float center_x
private float center_y
private float radius
private AVector v_down
private AVector v_drag
private AQuat q_now
private AQuat q_down
private AQuat q_drag
private AVector[] axisSet
private Constrain axis
private boolean isActive
private final processing.core.PApplet parent
private float zoom
private final WheelHandler zoomWheelHandler
public ArcBall(processing.core.PApplet parent, float center_x, float center_y, float radius)
parent
- PAppletcenter_x
- float x coordinate of arcball centercenter_y
- float y coordinate of arcball centerradius
- float radius of arcballpublic ArcBall(processing.core.PApplet parent)
parent
- public void mouseEvent(processing.event.MouseEvent e)
e
- public void keyEvent(processing.event.KeyEvent e)
e
- public void pre()
public final void setActive(boolean active)
active
- private void update()
public AVector mouse2sphere(float x, float y)
x
- y
- public AVector constrainVector(AVector vector, AVector axis)
vector
- axis
- public void constrain(Constrain axis)
axis
- public void applyQuaternion2Matrix(AQuat q)
q
- public void dispose()