setBodyPose method

  1. @override
void setBodyPose(
  1. int body,
  2. Vector3 position,
  3. Quaternion rotation, {
  4. bool wake = true,
})
override

Teleports body. Static bodies are moved this way; kinematic bodies should use moveKinematic so what they touch is carried along.

Implementation

@override
void setBodyPose(
  int body,
  Vector3 position,
  Quaternion rotation, {
  bool wake = true,
}) {
  final b = bodies[body];
  if (b == null) return;
  b.position.setFrom(position);
  b.rotation.setFrom(_unitOf(rotation));
  b._turn();
  if (wake) _wake(b);
}