Transform constructor

Transform([
  1. Vector3? pos,
  2. Quaternion? rot,
  3. Vector3? scale
])

Implementation

Transform([Vector3? pos, Quaternion? rot, Vector3? scale]) {
  if(scale != null) {
    this.scale = scale;
  } else {
    this.scale = Vector3.all(1.0);
  }

  if(rot != null) {
    this.rot = rot;
  }else {
    this.rot = Quaternion(0, 0, 0, 1);
  }

  if(pos != null) {
    this.pos = pos;
  }else {
    this.pos = Vector3.zero();
  }

  transformMatrix.scale(1.0);
  transformMatrix.setRotation(Quaternion(0, 0, 0, 1).asRotationMatrix());
  transformMatrix.translate(0.0);

  forceUpdate = true;
}