I made an extension witch could apply force in an rigid body and the direction and applying position can change along with the rigid body.
I apply force by this
def force_apply(self):
self.update()
trans_conv = array_sub(self.ori_trans, self.apply_pos)
angle_conv = array_sub(self.curr_rot, self.ori_rot)
new_dir = trans_coordinate(self.dir, angle_conv)
new_pos = trans_position(trans_conv, angle_conv, self.curr_trans)
force = carb.Float3(self.forcesize*new_dir[0]1000, self.forcesizenew_dir[1]1000, self.forcesizenew_dir[2]*1000)
new_pos_gf = Gf.Vec3f(new_pos[0], new_pos[1], new_pos[2] )
get_physx_interface().apply_force_at_pos(self.path, force, new_pos_gf)
self.timer = threading.Timer(1/24,self.force_apply)
if self.apply == 1:
self.timer.start()
else:
return 0
While running , these warnings were reported