예제 #1
0
  public void getCompositeTransform(Transform transform) {
    if (transform == null) throw new NullPointerException("transform can not be null");

    // transform = T R S M

    // Combine translation and rotation (TR)
    float[] m = new float[16];
    orientation.get(m);
    m[3] = translation.x;
    m[7] = translation.y;
    m[11] = translation.z;
    transform.set(m);

    // Apply scale (S)
    transform.postScale(scale.x, scale.y, scale.z);

    // Apply custom (M)
    transform.postMultiply(this.transform);
  }
예제 #2
0
 public void preRotate(float angle, float ax, float ay, float az) {
   Transform t = new Transform();
   t.postRotate(angle, ax, ay, az);
   t.postMultiply(orientation);
   orientation.set(t);
 }