             com = tex1Dfetch(rigid_data_com_tex, idx_body);
             vel = tex1Dfetch(rigid_data_vel_tex, idx_body);
             angvel = tex1Dfetch(rigid_data_angvel_tex, idx_body);
-            ex_space = tex1Dfetch(rigid_data_exspace_tex, idx_body);
-            ey_space = tex1Dfetch(rigid_data_eyspace_tex, idx_body);
-            ez_space = tex1Dfetch(rigid_data_ezspace_tex, idx_body);
             body_imagex = tex1Dfetch(rigid_data_body_imagex_tex, idx_body);
             body_imagey = tex1Dfetch(rigid_data_body_imagey_tex, idx_body);
             body_imagez = tex1Dfetch(rigid_data_body_imagez_tex, idx_body);
+            
+            Scalar4 orientation = tex1Dfetch(rigid_data_orientation_tex, idx_body);
+            exyzFromQuaternion(orientation, ex_space, ey_space, ez_space);
             }
         }
         

            com = tex1Dfetch(rigid_data_com_tex, idx_body);
            vel = tex1Dfetch(rigid_data_vel_tex, idx_body);
            orientation = tex1Dfetch(rigid_data_orientation_tex, idx_body);
            ex_space = tex1Dfetch(rigid_data_exspace_tex, idx_body);
            ey_space = tex1Dfetch(rigid_data_eyspace_tex, idx_body);
            ez_space = tex1Dfetch(rigid_data_ezspace_tex, idx_body);
            body_imagex = tex1Dfetch(rigid_data_body_imagex_tex, idx_body);
            body_imagey = tex1Dfetch(rigid_data_body_imagey_tex, idx_body);
            body_imagez = tex1Dfetch(rigid_data_body_imagez_tex, idx_body);
            force = tex1Dfetch(rigid_data_force_tex, idx_body);
            torque = tex1Dfetch(rigid_data_torque_tex, idx_body);
            conjqm = tex1Dfetch(rigid_data_conjqm_tex, idx_body);
            
            // update velocity
            float dtfm = dt_half / body_mass;

            com = tex1Dfetch(rigid_data_com_tex, idx_body);
            vel = tex1Dfetch(rigid_data_vel_tex, idx_body);
            angvel = tex1Dfetch(rigid_data_angvel_tex, idx_body);
            body_imagex = tex1Dfetch(rigid_data_body_imagex_tex, idx_body);
            body_imagey = tex1Dfetch(rigid_data_body_imagey_tex, idx_body);
            body_imagez = tex1Dfetch(rigid_data_body_imagez_tex, idx_body);
            
            Scalar4 orientation = tex1Dfetch(rigid_data_orientation_tex, idx_body);
            exyzFromQuaternion(orientation, ex_space, ey_space, ez_space);
            }
        }
        
