setItemTransform static method

void setItemTransform(
  1. Object3D obj, {
  2. double turn = 0,
  3. double pitch = 0,
  4. double scale = 1,
  5. double z = 0,
  6. bool turnfix = true,
})

Applies an item transform the way MudClient3D did for a MODEL/ACTOR inside an OBJECT (turn, pitch, scale and z offset, applied in the model's own frame). Use on objects from createModel/createActor.

Implementation

static void setItemTransform(THREE.Object3D obj,
    {double turn = 0, double pitch = 0, double scale = 1, double z = 0, bool turnfix = true}) {
  final holder = obj.children[0];
  holder.rotation.order = THREE.RotationOrders.yxz;
  holder.rotation.y = (turnfix ? math.pi : 0) + turn * math.pi / 180;
  holder.rotation.x = pitch * math.pi / 180;
  holder.scale.setValues(scale, scale, scale);
  holder.position.y = z;
}