@@ -128,6 +128,7 @@ pub type MultibodySlots = (
128128) ;
129129
130130/// Failure of [`NexusState::set_multibody_joint_positions`].
131+ #[ cfg( feature = "dim3" ) ]
131132#[ derive( Debug ) ]
132133pub enum JointPositionsError {
133134 /// The GPU write failed.
@@ -136,12 +137,14 @@ pub enum JointPositionsError {
136137 DofMismatch { expected : usize , got : usize } ,
137138}
138139
140+ #[ cfg( feature = "dim3" ) ]
139141impl From < GpuBackendError > for JointPositionsError {
140142 fn from ( e : GpuBackendError ) -> Self {
141143 JointPositionsError :: Gpu ( e)
142144 }
143145}
144146
147+ #[ cfg( feature = "dim3" ) ]
145148impl core:: fmt:: Display for JointPositionsError {
146149 fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
147150 match self {
@@ -216,9 +219,11 @@ pub struct NexusState {
216219 /// into the mass matrix (refreshed every substep) or applies them
217220 /// explicitly (mass matrix refreshed once per step). Applied at
218221 /// [`Self::finalize`] and by [`Self::set_rbd_implicit_coriolis`].
222+ #[ cfg( feature = "dim3" ) ]
219223 rbd_implicit_coriolis : bool ,
220224 /// Multibody refresh cadence `(every substep, light)`; see
221225 /// [`Self::set_rbd_substep_refresh`].
226+ #[ cfg( feature = "dim3" ) ]
222227 rbd_substep_refresh : ( bool , bool ) ,
223228 /// Set whenever the rapier worlds change; consumed by [`Self::finalize`] to
224229 /// decide whether the GPU [`RbdState`] needs rebuilding.
@@ -257,7 +262,9 @@ impl NexusState {
257262 run_stats : RunStats :: default ( ) ,
258263 rbd_envs : vec ! [ PhysicsWorld :: default ( ) ] ,
259264 rbd_sim_params : vec ! [ RbdSimParams :: tgs_soft( ) ] ,
265+ #[ cfg( feature = "dim3" ) ]
260266 rbd_implicit_coriolis : true ,
267+ #[ cfg( feature = "dim3" ) ]
261268 rbd_substep_refresh : ( true , false ) ,
262269 rbd_dirty : false ,
263270 rbd_steps_per_frame : 1 ,
@@ -696,7 +703,7 @@ impl NexusState {
696703 // --- rigid-body and multibody state access (between steps) -------------
697704
698705 /// GPU pose slot of `handle` in environment `env`: the index into
699- /// [`Self::read_rigid_body_poses`] and [`Self:: read_rigid_body_velocities`] .
706+ /// [`Self::read_rigid_body_poses`] ( and, in 3D, ` read_rigid_body_velocities`) .
700707 /// `None` before `finalize` or for a handle this state does not know.
701708 pub fn rigid_body_gpu_index ( & self , env : usize , handle : RigidBodyHandle ) -> Option < u32 > {
702709 self . rbd2gpu
@@ -757,7 +764,7 @@ impl NexusState {
757764 /// Teleports a free rigid body: overwrites its world-origin pose on the GPU.
758765 /// Valid between steps, after `finalize`. A multibody link's pose is
759766 /// re-derived from its joint coordinates every step, so links go through
760- /// [`Self:: set_multibody_joint_positions`] instead. Unknown handles are
767+ /// ` set_multibody_joint_positions` (3D) instead. Unknown handles are
761768 /// ignored.
762769 pub fn set_rigid_body_pose (
763770 & mut self ,
0 commit comments