@@ -15,7 +15,7 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
15
15
{
16
16
assert ( human -> isSpawned == false );
17
17
18
- for ( int i = 0 ; i < boneId_count ; ++ i )
18
+ for ( int i = 0 ; i < bone_count ; ++ i )
19
19
{
20
20
human -> bones [i ].bodyId = b2_nullBodyId ;
21
21
human -> bones [i ].jointId = b2_nullJointId ;
@@ -62,7 +62,7 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
62
62
63
63
// hip
64
64
{
65
- Bone * bone = human -> bones + boneId_hip ;
65
+ Bone * bone = human -> bones + bone_hip ;
66
66
bone -> parentIndex = -1 ;
67
67
68
68
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f , 0.95f * s }, position );
@@ -80,8 +80,8 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
80
80
81
81
// torso
82
82
{
83
- Bone * bone = human -> bones + boneId_torso ;
84
- bone -> parentIndex = boneId_hip ;
83
+ Bone * bone = human -> bones + bone_torso ;
84
+ bone -> parentIndex = bone_hip ;
85
85
86
86
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f , 1.2f * s }, position );
87
87
bodyDef .linearDamping = 0.0f ;
@@ -119,8 +119,8 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
119
119
120
120
// head
121
121
{
122
- Bone * bone = human -> bones + boneId_head ;
123
- bone -> parentIndex = boneId_torso ;
122
+ Bone * bone = human -> bones + bone_head ;
123
+ bone -> parentIndex = bone_torso ;
124
124
125
125
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f * s , 1.475f * s }, position );
126
126
bodyDef .linearDamping = 0.1f ;
@@ -161,8 +161,8 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
161
161
162
162
// upper left leg
163
163
{
164
- Bone * bone = human -> bones + boneId_upperLeftLeg ;
165
- bone -> parentIndex = boneId_hip ;
164
+ Bone * bone = human -> bones + bone_upperLeftLeg ;
165
+ bone -> parentIndex = bone_hip ;
166
166
167
167
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f , 0.775f * s }, position );
168
168
bodyDef .linearDamping = 0.0f ;
@@ -208,8 +208,8 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
208
208
209
209
// lower left leg
210
210
{
211
- Bone * bone = human -> bones + boneId_lowerLeftLeg ;
212
- bone -> parentIndex = boneId_upperLeftLeg ;
211
+ Bone * bone = human -> bones + bone_lowerLeftLeg ;
212
+ bone -> parentIndex = bone_upperLeftLeg ;
213
213
214
214
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f , 0.475f * s }, position );
215
215
bodyDef .linearDamping = 0.0f ;
@@ -253,8 +253,8 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
253
253
254
254
// upper right leg
255
255
{
256
- Bone * bone = human -> bones + boneId_upperRightLeg ;
257
- bone -> parentIndex = boneId_hip ;
256
+ Bone * bone = human -> bones + bone_upperRightLeg ;
257
+ bone -> parentIndex = bone_hip ;
258
258
259
259
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f , 0.775f * s }, position );
260
260
bodyDef .linearDamping = 0.0f ;
@@ -290,8 +290,8 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
290
290
291
291
// lower right leg
292
292
{
293
- Bone * bone = human -> bones + boneId_lowerRightLeg ;
294
- bone -> parentIndex = boneId_upperRightLeg ;
293
+ Bone * bone = human -> bones + bone_lowerRightLeg ;
294
+ bone -> parentIndex = bone_upperRightLeg ;
295
295
296
296
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f , 0.475f * s }, position );
297
297
bodyDef .linearDamping = 0.0f ;
@@ -335,8 +335,8 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
335
335
336
336
// upper left arm
337
337
{
338
- Bone * bone = human -> bones + boneId_upperLeftArm ;
339
- bone -> parentIndex = boneId_torso ;
338
+ Bone * bone = human -> bones + bone_upperLeftArm ;
339
+ bone -> parentIndex = bone_torso ;
340
340
bone -> frictionScale = 0.5f ;
341
341
342
342
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f , 1.225f * s }, position );
@@ -372,8 +372,8 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
372
372
373
373
// lower left arm
374
374
{
375
- Bone * bone = human -> bones + boneId_lowerLeftArm ;
376
- bone -> parentIndex = boneId_upperLeftArm ;
375
+ Bone * bone = human -> bones + bone_lowerLeftArm ;
376
+ bone -> parentIndex = bone_upperLeftArm ;
377
377
378
378
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f , 0.975f * s }, position );
379
379
bodyDef .linearDamping = 0.1f ;
@@ -410,8 +410,8 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
410
410
411
411
// upper right arm
412
412
{
413
- Bone * bone = human -> bones + boneId_upperRightArm ;
414
- bone -> parentIndex = boneId_torso ;
413
+ Bone * bone = human -> bones + bone_upperRightArm ;
414
+ bone -> parentIndex = bone_torso ;
415
415
416
416
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f , 1.225f * s }, position );
417
417
bodyDef .linearDamping = 0.0f ;
@@ -447,8 +447,8 @@ void CreateHuman( Human* human, b2WorldId worldId, b2Vec2 position, float scale,
447
447
448
448
// lower right arm
449
449
{
450
- Bone * bone = human -> bones + boneId_lowerRightArm ;
451
- bone -> parentIndex = boneId_upperRightArm ;
450
+ Bone * bone = human -> bones + bone_lowerRightArm ;
451
+ bone -> parentIndex = bone_upperRightArm ;
452
452
453
453
bodyDef .position = b2Add ( ( b2Vec2 ){ 0.0f , 0.975f * s }, position );
454
454
bodyDef .linearDamping = 0.1f ;
@@ -490,7 +490,7 @@ void DestroyHuman( Human* human )
490
490
{
491
491
assert ( human -> isSpawned == true );
492
492
493
- for ( int i = 0 ; i < boneId_count ; ++ i )
493
+ for ( int i = 0 ; i < bone_count ; ++ i )
494
494
{
495
495
if ( B2_IS_NULL ( human -> bones [i ].jointId ) )
496
496
{
@@ -501,7 +501,7 @@ void DestroyHuman( Human* human )
501
501
human -> bones [i ].jointId = b2_nullJointId ;
502
502
}
503
503
504
- for ( int i = 0 ; i < boneId_count ; ++ i )
504
+ for ( int i = 0 ; i < bone_count ; ++ i )
505
505
{
506
506
if ( B2_IS_NULL ( human -> bones [i ].bodyId ) )
507
507
{
@@ -517,7 +517,7 @@ void DestroyHuman( Human* human )
517
517
518
518
void Human_SetVelocity ( Human * human , b2Vec2 velocity )
519
519
{
520
- for ( int i = 0 ; i < boneId_count ; ++ i )
520
+ for ( int i = 0 ; i < bone_count ; ++ i )
521
521
{
522
522
b2BodyId bodyId = human -> bones [i ].bodyId ;
523
523
@@ -534,22 +534,22 @@ void Human_ApplyRandomAngularImpulse( Human* human, float magnitude )
534
534
{
535
535
assert ( human -> isSpawned == true );
536
536
float impulse = RandomFloatRange ( - magnitude , magnitude );
537
- b2Body_ApplyAngularImpulse ( human -> bones [boneId_torso ].bodyId , impulse , true );
537
+ b2Body_ApplyAngularImpulse ( human -> bones [bone_torso ].bodyId , impulse , true );
538
538
}
539
539
540
540
void Human_SetJointFrictionTorque ( Human * human , float torque )
541
541
{
542
542
assert ( human -> isSpawned == true );
543
543
if ( torque == 0.0f )
544
544
{
545
- for ( int i = 1 ; i < boneId_count ; ++ i )
545
+ for ( int i = 1 ; i < bone_count ; ++ i )
546
546
{
547
547
b2RevoluteJoint_EnableMotor ( human -> bones [i ].jointId , false );
548
548
}
549
549
}
550
550
else
551
551
{
552
- for ( int i = 1 ; i < boneId_count ; ++ i )
552
+ for ( int i = 1 ; i < bone_count ; ++ i )
553
553
{
554
554
b2RevoluteJoint_EnableMotor ( human -> bones [i ].jointId , true );
555
555
float scale = human -> scale * human -> bones [i ].frictionScale ;
@@ -563,14 +563,14 @@ void Human_SetJointSpringHertz( Human* human, float hertz )
563
563
assert ( human -> isSpawned == true );
564
564
if ( hertz == 0.0f )
565
565
{
566
- for ( int i = 1 ; i < boneId_count ; ++ i )
566
+ for ( int i = 1 ; i < bone_count ; ++ i )
567
567
{
568
568
b2RevoluteJoint_EnableSpring ( human -> bones [i ].jointId , false );
569
569
}
570
570
}
571
571
else
572
572
{
573
- for ( int i = 1 ; i < boneId_count ; ++ i )
573
+ for ( int i = 1 ; i < bone_count ; ++ i )
574
574
{
575
575
b2RevoluteJoint_EnableSpring ( human -> bones [i ].jointId , true );
576
576
b2RevoluteJoint_SetSpringHertz ( human -> bones [i ].jointId , hertz );
@@ -581,7 +581,7 @@ void Human_SetJointSpringHertz( Human* human, float hertz )
581
581
void Human_SetJointDampingRatio ( Human * human , float dampingRatio )
582
582
{
583
583
assert ( human -> isSpawned == true );
584
- for ( int i = 1 ; i < boneId_count ; ++ i )
584
+ for ( int i = 1 ; i < bone_count ; ++ i )
585
585
{
586
586
b2RevoluteJoint_SetSpringDampingRatio ( human -> bones [i ].jointId , dampingRatio );
587
587
}
0 commit comments