Skip to content

Commit 7eb3478

Browse files
committed
Review fixes
1 parent b3917fe commit 7eb3478

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

genesis/ext/pyrender/interaction/mouse_spring.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ def apply_force(self, control_point: Vec3, delta_time: float):
4545

4646
pos_err_v: Vec3 = control_point - link_pos
4747
vel_err_v: Vec3 = Vec3.zero() - lin_vel
48-
inv_mass: float = float(1.0 / link.get_mass() if 0.0 < link.get_mass() else 0.0)
48+
inv_mass: float = float(1.0 / link.get_mass() if link.get_mass() > 0.0 else 0.0)
4949

5050
inv_dt: float = 1.0 / delta_time
51+
# these are temporary values, till we fix an issue with apply_links_external_force.
52+
# after fixing it, use tau = damp = 1.0:
5153
tau: float = 1.0 / 2
5254
damp: float = 1.0 * 2
5355

@@ -69,14 +71,6 @@ def apply_force(self, control_point: Vec3, delta_time: float):
6971
force_tensor: torch.Tensor = total_force.as_tensor().unsqueeze(0)
7072
link.solver.apply_links_external_force(force_tensor, (link.idx,), ref='link_com', local=False)
7173

72-
# print("vel", lin_vel, "total_impulse", total_impulse)
73-
# print("exp", lin_vel + total_force * inv_mass * link.solver.dt, "at dt", link.solver.dt, "inv dt", inv_dt)
74-
75-
7674
@property
7775
def is_attached(self) -> bool:
7876
return self.held_geom is not None
79-
80-
81-
def _solve_mouse_spring():
82-
pass

0 commit comments

Comments
 (0)