| 712 | self.drag_start_center += movement |
| 713 | |
| 714 | def to_batch(self): |
| 715 | meta = dotdict() |
| 716 | meta.H = torch.as_tensor(self.H) |
| 717 | meta.W = torch.as_tensor(self.W) |
| 718 | meta.K = torch.as_tensor(self.K.to_list(), dtype=torch.float).mT |
| 719 | meta.R = torch.as_tensor(self.R.to_list(), dtype=torch.float).mT |
| 720 | meta.T = torch.as_tensor(self.T.to_list(), dtype=torch.float)[..., None] |
| 721 | meta.n = torch.as_tensor(self.n, dtype=torch.float) |
| 722 | meta.f = torch.as_tensor(self.f, dtype=torch.float) |
| 723 | meta.t = torch.as_tensor(self.t, dtype=torch.float) |
| 724 | meta.v = torch.as_tensor(self.v, dtype=torch.float) |
| 725 | meta.bounds = torch.as_tensor(self.bounds.to_list(), dtype=torch.float) # no transpose for bounds |
| 726 | |
| 727 | # GUI related elements |
| 728 | meta.mass = torch.as_tensor(self.mass, dtype=torch.float) |
| 729 | meta.moment_of_inertia = torch.as_tensor(self.moment_of_inertia, dtype=torch.float) |
| 730 | meta.movement_force = torch.as_tensor(self.movement_force, dtype=torch.float) |
| 731 | meta.movement_torque = torch.as_tensor(self.movement_torque, dtype=torch.float) |
| 732 | meta.movement_speed = torch.as_tensor(self.movement_speed, dtype=torch.float) |
| 733 | meta.origin = torch.as_tensor(self.origin.to_list(), dtype=torch.float) |
| 734 | meta.world_up = torch.as_tensor(self.world_up.to_list(), dtype=torch.float) |
| 735 | |
| 736 | batch = dotdict() |
| 737 | batch.update(meta) |
| 738 | batch.meta.update(meta) |
| 739 | return batch |
| 740 | |
| 741 | def to_easymocap(self): |
| 742 | batch = self.to_batch() |