Definition at line 82 of file CubeActivity.java.
◆ VSphereAnimator()
org.skia.jetskidemo.VSphereAnimator.VSphereAnimator |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
r |
|
) |
| |
|
inline |
◆ animate()
void org.skia.jetskidemo.VSphereAnimator.animate |
( |
float |
dt | ) |
|
|
inline |
Definition at line 97 of file CubeActivity.java.
97 {
98 final float kDecay = 0.99f;
99
100 rotate(mRotAxis, mRotSpeed * dt);
101
102 mRotSpeed *= kDecay;
103 }
◆ drag()
void org.skia.jetskidemo.VSphereAnimator.drag |
( |
MotionEvent |
e | ) |
|
|
inline |
Definition at line 123 of file CubeActivity.java.
123 {
124 Vec3 u = mCurrentDrag,
125 v = normalVec(
e.getX(),
e.getY());
126
127 float angle = (
float)Math.acos(Math.max(-1, Math.min(1, u.dot(v)/u.length()/v.length())));
128 Vec3 axis = u.cross(v).normalize();
129
130 rotate(axis, angle);
131
132 mCurrentDrag = v;
133 }
◆ fling()
void org.skia.jetskidemo.VSphereAnimator.fling |
( |
float |
dx, |
|
|
float |
dy |
|
) |
| |
|
inline |
Definition at line 109 of file CubeActivity.java.
109 {
110 Vec3 u = normalVec(mCenterX, mCenterY),
111 v = normalVec(mCenterX +
dx, mCenterY + dy);
113
114 double flingSpeed = Math.sqrt(
dx*
dx + dy*dy)/mRadius;
115 mRotSpeed = (
float)(flingSpeed*Math.PI);
116 }
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
◆ getMatrix()
Matrix org.skia.jetskidemo.VSphereAnimator.getMatrix |
( |
| ) |
|
|
inline |
◆ startDrag()
void org.skia.jetskidemo.VSphereAnimator.startDrag |
( |
MotionEvent |
e | ) |
|
|
inline |
Definition at line 118 of file CubeActivity.java.
118 {
119 mCurrentDrag = normalVec(
e.getX(),
e.getY());
120 mRotSpeed = 0;
121 }
The documentation for this class was generated from the following file:
- third_party/skia/platform_tools/android/apps/jetskidemo/src/main/java/org/skia/jetskidemo/CubeActivity.java