@@ -921,7 +921,9 @@ def _init_constraint_solver(self):
921921 def substep (self ):
922922 # from genesis.utils.tools import create_timer
923923
924-
924+ # Note: ContactIsland param is needed when supporting hibernation. But the attribute does not exist
925+ # in the solver when hibernation is disabled. In that case, we create a dummy ContactIsland object
926+ # needed for compilation, but not being used in the kernel.
925927 if not hasattr (self , "optional_contact_island" ):
926928 if hasattr (self , "constraint_solver" ) and hasattr (self .constraint_solver , "contact_island" ):
927929 self .optional_contact_island = self .constraint_solver .contact_island
@@ -961,9 +963,6 @@ def substep(self):
961963 collider_state = self .collider ._collider_state ,
962964 rigid_global_info = self ._rigid_global_info ,
963965 static_rigid_sim_config = self ._static_rigid_sim_config ,
964- # contact_island=getattr(self.constraint_solver, "contact_island", None),
965-
966- # xxx: enable this and get things compiling
967966 contact_island = self .optional_contact_island ,
968967 )
969968 # timer.stamp("kernel_step_2")
@@ -4043,7 +4042,7 @@ def kernel_step_2(
40434042 )
40444043
40454044 if ti .static (static_rigid_sim_config .use_hibernation ):
4046- func_for_all_awake_islands_either_hiberanate_or_update_aabb_sort_buffer (
4045+ func_hibernate__for_all_awake_islands_either_hiberanate_or_update_aabb_sort_buffer (
40474046 dofs_state = dofs_state ,
40484047 entities_state = entities_state ,
40494048 entities_info = entities_info ,
@@ -4924,7 +4923,7 @@ def kernel_update_vgeoms(
49244923
49254924
49264925@ti .func
4927- def func_for_all_awake_islands_either_hiberanate_or_update_aabb_sort_buffer (
4926+ def func_hibernate__for_all_awake_islands_either_hiberanate_or_update_aabb_sort_buffer (
49284927 dofs_state : array_class .DofsState ,
49294928 entities_state : array_class .EntitiesState ,
49304929 entities_info : array_class .EntitiesInfo ,
@@ -4938,10 +4937,7 @@ def func_for_all_awake_islands_either_hiberanate_or_update_aabb_sort_buffer(
49384937
49394938 n_entities = entities_state .hibernated .shape [0 ]
49404939 _B = entities_state .hibernated .shape [1 ]
4941-
49424940 ci = contact_island
4943- # entity_ref_range_from_island_idx = ci.island_entity
4944- # entity_idx_from_entity_ref = ci.entity_id
49454941
49464942 ti .loop_config (serialize = static_rigid_sim_config .para_level < gs .PARA_LEVEL .PARTIAL )
49474943 for i_b in range (_B ):
@@ -4962,7 +4958,7 @@ def func_for_all_awake_islands_either_hiberanate_or_update_aabb_sort_buffer(
49624958 is_entity_fixed = entities_info .n_dofs [entity_idx ] == 0
49634959 Debug .assertf (0x7ad00005 , not is_entity_fixed ) # Fixed entity should not belong to an island
49644960
4965- # we can ignore entitiy_hibernated flag -> cos it implies dofs_state.vel/ acc are zero
4961+ # Hibernated entities already have zero dofs_state.acc/vel
49664962 is_entity_hibernated = entities_state .hibernated [entity_idx , i_b ]
49674963 if is_entity_hibernated :
49684964 continue
@@ -5666,23 +5662,14 @@ def func_integrate(
56665662 i_l = rigid_global_info .awake_links [i_l_ , i_b ]
56675663 I_l = [i_l , i_b ] if ti .static (static_rigid_sim_config .batch_links_info ) else i_l
56685664
5669-
5670- # why not links_info.dof_start, q_start, q_end ?
56715665 for i_j in range (links_info .joint_start [I_l ], links_info .joint_end [I_l ]):
56725666 I_j = [i_j , i_b ] if ti .static (static_rigid_sim_config .batch_joints_info ) else i_j
56735667 dof_start = joints_info .dof_start [I_j ]
56745668 q_start = joints_info .q_start [I_j ]
56755669 q_end = joints_info .q_end [I_j ]
56765670
5677- # can we just do that ?
5678- # if True:
5679- # dof_start = links_info.dof_start[I_l]
5680- # q_start = links_info.q_start[I_l]
5681- # q_end = links_info.q_end[I_l]
5682-
56835671 joint_type = joints_info .type [I_j ]
56845672
5685- # TODO: consider copying from no-hibernation version below
56865673 if joint_type == gs .JOINT_TYPE .FREE :
56875674 rot = ti .Vector (
56885675 [
0 commit comments