@@ -119,21 +119,21 @@ static void ActivateTestDepthCallback(
119119
120120void StaticEnvironment (bool & do_colide, bool bo1, dContact& c, SGameMtl* material_1, SGameMtl* material_2)
121121{
122- dJointID contact_joint = dJointCreateContact (0 , ContactGroup, &c);
122+ dJointID contact_joint = dJointCreateContact (nullptr , ContactGroup, &c);
123123
124124 if (bo1)
125125 {
126126 ((CPHActivationShape*)(retrieveGeomUserData (c.geom .g1 )->callback_data ))
127127 ->DActiveIsland ()
128128 ->ConnectJoint (contact_joint);
129- dJointAttach (contact_joint, dGeomGetBody (c.geom .g1 ), 0 );
129+ dJointAttach (contact_joint, dGeomGetBody (c.geom .g1 ), nullptr );
130130 }
131131 else
132132 {
133133 ((CPHActivationShape*)(retrieveGeomUserData (c.geom .g2 )->callback_data ))
134134 ->DActiveIsland ()
135135 ->ConnectJoint (contact_joint);
136- dJointAttach (contact_joint, 0 , dGeomGetBody (c.geom .g2 ));
136+ dJointAttach (contact_joint, nullptr , dGeomGetBody (c.geom .g2 ));
137137 }
138138 do_colide = false ;
139139}
@@ -150,11 +150,10 @@ void GetMaxDepthCallback(bool& do_colide, bool bo1, dContact& c, SGameMtl* mater
150150
151151void RestoreVelocityState (V_PH_WORLD_STATE& state)
152152{
153- V_PH_WORLD_STATE::iterator i = state.begin (), e = state.end ();
154- for (; e != i; ++i)
153+ for (auto & it : state)
155154 {
156- CPHSynchronize& sync = *i-> first ;
157- SPHNetState& old_s = i-> second ;
155+ CPHSynchronize& sync = *it. first ;
156+ SPHNetState& old_s = it. second ;
158157 SPHNetState new_s;
159158 sync.get_State (new_s);
160159 new_s.angular_vel .set (old_s.angular_vel );
@@ -166,10 +165,10 @@ void RestoreVelocityState(V_PH_WORLD_STATE& state)
166165
167166CPHActivationShape::CPHActivationShape ()
168167{
169- m_geom = NULL ;
170- m_body = NULL ;
168+ m_geom = nullptr ;
169+ m_body = nullptr ;
171170 m_flags.zero ();
172- m_flags.set (flFixedRotation, TRUE );
171+ m_flags.set (flFixedRotation, true );
173172}
174173CPHActivationShape::~CPHActivationShape () { VERIFY (!m_body && !m_geom); }
175174void CPHActivationShape::Create (
@@ -179,16 +178,16 @@ void CPHActivationShape::Create(
179178 R_ASSERT (_valid (start_pos));
180179 R_ASSERT (_valid (start_size));
181180
182- m_body = dBodyCreate (0 );
181+ m_body = dBodyCreate (nullptr );
183182 dMass m;
184183 dMassSetSphere (&m, 1 .f , 100000 .f );
185184 dMassAdjust (&m, 1 .f );
186185 dBodySetMass (m_body, &m);
187186 switch (_type)
188187 {
189- case etBox: m_geom = dCreateBox (0 , start_size.x , start_size.y , start_size.z ); break ;
188+ case etBox: m_geom = dCreateBox (nullptr , start_size.x , start_size.y , start_size.z ); break ;
190189
191- case etSphere: m_geom = dCreateSphere (0 , start_size.x ); break ;
190+ case etSphere: m_geom = dCreateSphere (nullptr , start_size.x ); break ;
192191 };
193192
194193 dGeomCreateUserData (m_geom);
@@ -200,7 +199,7 @@ void CPHActivationShape::Create(
200199 dBodyEnable (m_body);
201200 m_safe_state.create (m_body);
202201 spatial_register ();
203- m_flags.set (flags, TRUE );
202+ m_flags.set (flags, true );
204203}
205204void CPHActivationShape::Destroy ()
206205{
@@ -209,9 +208,9 @@ void CPHActivationShape::Destroy()
209208 CPHObject::deactivate ();
210209 dGeomDestroyUserData (m_geom);
211210 dGeomDestroy (m_geom);
212- m_geom = NULL ;
211+ m_geom = nullptr ;
213212 dBodyDestroy (m_body);
214- m_body = NULL ;
213+ m_body = nullptr ;
215214}
216215bool CPHActivationShape::Activate (
217216 const Fvector need_size, u16 steps, float max_displacement, float max_rotation, bool un_freeze_later /* =false*/ )
0 commit comments