Box2D 2.4.1
A 2D physics engine for games
b2_body.h
1// MIT License
2
3// Copyright (c) 2019 Erin Catto
4
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22
23#ifndef B2_BODY_H
24#define B2_BODY_H
25
26#include "b2_api.h"
27#include "b2_math.h"
28#include "b2_shape.h"
29
30class b2Fixture;
31class b2Joint;
32class b2Contact;
33class b2Controller;
34class b2World;
35struct b2FixtureDef;
36struct b2JointEdge;
37struct b2ContactEdge;
38
43enum b2BodyType
44{
45 b2_staticBody = 0,
46 b2_kinematicBody,
47 b2_dynamicBody
48};
49
52struct B2_API b2BodyDef
53{
56 {
57 position.Set(0.0f, 0.0f);
58 angle = 0.0f;
59 linearVelocity.Set(0.0f, 0.0f);
60 angularVelocity = 0.0f;
61 linearDamping = 0.0f;
62 angularDamping = 0.0f;
63 allowSleep = true;
64 awake = true;
65 fixedRotation = false;
66 bullet = false;
67 type = b2_staticBody;
68 enabled = true;
69 gravityScale = 1.0f;
70 }
71
74 b2BodyType type;
75
79
81 float angle;
82
85
88
94
100
104
106 bool awake;
107
110
115 bool bullet;
116
119
122
125};
126
128class B2_API b2Body
129{
130public:
139
147 b2Fixture* CreateFixture(const b2Shape* shape, float density);
148
156 void DestroyFixture(b2Fixture* fixture);
157
163 void SetTransform(const b2Vec2& position, float angle);
164
167 const b2Transform& GetTransform() const;
168
171 const b2Vec2& GetPosition() const;
172
175 float GetAngle() const;
176
178 const b2Vec2& GetWorldCenter() const;
179
181 const b2Vec2& GetLocalCenter() const;
182
185 void SetLinearVelocity(const b2Vec2& v);
186
189 const b2Vec2& GetLinearVelocity() const;
190
193 void SetAngularVelocity(float omega);
194
197 float GetAngularVelocity() const;
198
205 void ApplyForce(const b2Vec2& force, const b2Vec2& point, bool wake);
206
210 void ApplyForceToCenter(const b2Vec2& force, bool wake);
211
216 void ApplyTorque(float torque, bool wake);
217
224 void ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point, bool wake);
225
229 void ApplyLinearImpulseToCenter(const b2Vec2& impulse, bool wake);
230
234 void ApplyAngularImpulse(float impulse, bool wake);
235
238 float GetMass() const;
239
242 float GetInertia() const;
243
246 void GetMassData(b2MassData* data) const;
247
253 void SetMassData(const b2MassData* data);
254
259
263 b2Vec2 GetWorldPoint(const b2Vec2& localPoint) const;
264
268 b2Vec2 GetWorldVector(const b2Vec2& localVector) const;
269
273 b2Vec2 GetLocalPoint(const b2Vec2& worldPoint) const;
274
278 b2Vec2 GetLocalVector(const b2Vec2& worldVector) const;
279
283 b2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const;
284
288 b2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const;
289
291 float GetLinearDamping() const;
292
294 void SetLinearDamping(float linearDamping);
295
297 float GetAngularDamping() const;
298
300 void SetAngularDamping(float angularDamping);
301
303 float GetGravityScale() const;
304
306 void SetGravityScale(float scale);
307
309 void SetType(b2BodyType type);
310
312 b2BodyType GetType() const;
313
315 void SetBullet(bool flag);
316
318 bool IsBullet() const;
319
322 void SetSleepingAllowed(bool flag);
323
325 bool IsSleepingAllowed() const;
326
330 void SetAwake(bool flag);
331
334 bool IsAwake() const;
335
348 void SetEnabled(bool flag);
349
351 bool IsEnabled() const;
352
355 void SetFixedRotation(bool flag);
356
358 bool IsFixedRotation() const;
359
361 b2Fixture* GetFixtureList();
362 const b2Fixture* GetFixtureList() const;
363
365 b2JointEdge* GetJointList();
366 const b2JointEdge* GetJointList() const;
367
371 b2ContactEdge* GetContactList();
372 const b2ContactEdge* GetContactList() const;
373
375 b2Body* GetNext();
376 const b2Body* GetNext() const;
377
379 b2BodyUserData& GetUserData();
380
382 void SetUserData(void* data);
383
385 b2World* GetWorld();
386 const b2World* GetWorld() const;
387
389 void Dump();
390
391private:
392
393 friend class b2World;
394 friend class b2Island;
395 friend class b2ContactManager;
396 friend class b2ContactSolver;
397 friend class b2Contact;
398
399 friend class b2DistanceJoint;
400 friend class b2FrictionJoint;
401 friend class b2GearJoint;
402 friend class b2MotorJoint;
403 friend class b2MouseJoint;
404 friend class b2PrismaticJoint;
405 friend class b2PulleyJoint;
406 friend class b2RevoluteJoint;
407 friend class b2RopeJoint;
408 friend class b2WeldJoint;
409 friend class b2WheelJoint;
410
411 // m_flags
412 enum
413 {
414 e_islandFlag = 0x0001,
415 e_awakeFlag = 0x0002,
416 e_autoSleepFlag = 0x0004,
417 e_bulletFlag = 0x0008,
418 e_fixedRotationFlag = 0x0010,
419 e_enabledFlag = 0x0020,
420 e_toiFlag = 0x0040
421 };
422
423 b2Body(const b2BodyDef* bd, b2World* world);
424 ~b2Body();
425
426 void SynchronizeFixtures();
427 void SynchronizeTransform();
428
429 // This is used to prevent connected bodies from colliding.
430 // It may lie, depending on the collideConnected flag.
431 bool ShouldCollide(const b2Body* other) const;
432
433 void Advance(float t);
434
435 b2BodyType m_type;
436
437 uint16 m_flags;
438
439 int32 m_islandIndex;
440
441 b2Transform m_xf; // the body origin transform
442 b2Sweep m_sweep; // the swept motion for CCD
443
444 b2Vec2 m_linearVelocity;
445 float m_angularVelocity;
446
447 b2Vec2 m_force;
448 float m_torque;
449
450 b2World* m_world;
451 b2Body* m_prev;
452 b2Body* m_next;
453
454 b2Fixture* m_fixtureList;
455 int32 m_fixtureCount;
456
457 b2JointEdge* m_jointList;
458 b2ContactEdge* m_contactList;
459
460 float m_mass, m_invMass;
461
462 // Rotational inertia about the center of mass.
463 float m_I, m_invI;
464
465 float m_linearDamping;
466 float m_angularDamping;
467 float m_gravityScale;
468
469 float m_sleepTime;
470
471 b2BodyUserData m_userData;
472};
473
474inline b2BodyType b2Body::GetType() const
475{
476 return m_type;
477}
478
480{
481 return m_xf;
482}
483
484inline const b2Vec2& b2Body::GetPosition() const
485{
486 return m_xf.p;
487}
488
489inline float b2Body::GetAngle() const
490{
491 return m_sweep.a;
492}
493
494inline const b2Vec2& b2Body::GetWorldCenter() const
495{
496 return m_sweep.c;
497}
498
499inline const b2Vec2& b2Body::GetLocalCenter() const
500{
501 return m_sweep.localCenter;
502}
503
505{
506 if (m_type == b2_staticBody)
507 {
508 return;
509 }
510
511 if (b2Dot(v,v) > 0.0f)
512 {
513 SetAwake(true);
514 }
515
516 m_linearVelocity = v;
517}
518
520{
521 return m_linearVelocity;
522}
523
524inline void b2Body::SetAngularVelocity(float w)
525{
526 if (m_type == b2_staticBody)
527 {
528 return;
529 }
530
531 if (w * w > 0.0f)
532 {
533 SetAwake(true);
534 }
535
536 m_angularVelocity = w;
537}
538
539inline float b2Body::GetAngularVelocity() const
540{
541 return m_angularVelocity;
542}
543
544inline float b2Body::GetMass() const
545{
546 return m_mass;
547}
548
549inline float b2Body::GetInertia() const
550{
551 return m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter);
552}
553
554inline void b2Body::GetMassData(b2MassData* data) const
555{
556 data->mass = m_mass;
557 data->I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter);
558 data->center = m_sweep.localCenter;
559}
560
561inline b2Vec2 b2Body::GetWorldPoint(const b2Vec2& localPoint) const
562{
563 return b2Mul(m_xf, localPoint);
564}
565
566inline b2Vec2 b2Body::GetWorldVector(const b2Vec2& localVector) const
567{
568 return b2Mul(m_xf.q, localVector);
569}
570
571inline b2Vec2 b2Body::GetLocalPoint(const b2Vec2& worldPoint) const
572{
573 return b2MulT(m_xf, worldPoint);
574}
575
576inline b2Vec2 b2Body::GetLocalVector(const b2Vec2& worldVector) const
577{
578 return b2MulT(m_xf.q, worldVector);
579}
580
582{
583 return m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.c);
584}
585
587{
589}
590
591inline float b2Body::GetLinearDamping() const
592{
593 return m_linearDamping;
594}
595
596inline void b2Body::SetLinearDamping(float linearDamping)
597{
598 m_linearDamping = linearDamping;
599}
600
601inline float b2Body::GetAngularDamping() const
602{
603 return m_angularDamping;
604}
605
606inline void b2Body::SetAngularDamping(float angularDamping)
607{
608 m_angularDamping = angularDamping;
609}
610
611inline float b2Body::GetGravityScale() const
612{
613 return m_gravityScale;
614}
615
616inline void b2Body::SetGravityScale(float scale)
617{
618 m_gravityScale = scale;
619}
620
621inline void b2Body::SetBullet(bool flag)
622{
623 if (flag)
624 {
625 m_flags |= e_bulletFlag;
626 }
627 else
628 {
629 m_flags &= ~e_bulletFlag;
630 }
631}
632
633inline bool b2Body::IsBullet() const
634{
635 return (m_flags & e_bulletFlag) == e_bulletFlag;
636}
637
638inline void b2Body::SetAwake(bool flag)
639{
640 if (m_type == b2_staticBody)
641 {
642 return;
643 }
644
645 if (flag)
646 {
647 m_flags |= e_awakeFlag;
648 m_sleepTime = 0.0f;
649 }
650 else
651 {
652 m_flags &= ~e_awakeFlag;
653 m_sleepTime = 0.0f;
654 m_linearVelocity.SetZero();
655 m_angularVelocity = 0.0f;
656 m_force.SetZero();
657 m_torque = 0.0f;
658 }
659}
660
661inline bool b2Body::IsAwake() const
662{
663 return (m_flags & e_awakeFlag) == e_awakeFlag;
664}
665
666inline bool b2Body::IsEnabled() const
667{
668 return (m_flags & e_enabledFlag) == e_enabledFlag;
669}
670
671inline bool b2Body::IsFixedRotation() const
672{
673 return (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag;
674}
675
676inline void b2Body::SetSleepingAllowed(bool flag)
677{
678 if (flag)
679 {
680 m_flags |= e_autoSleepFlag;
681 }
682 else
683 {
684 m_flags &= ~e_autoSleepFlag;
685 SetAwake(true);
686 }
687}
688
689inline bool b2Body::IsSleepingAllowed() const
690{
691 return (m_flags & e_autoSleepFlag) == e_autoSleepFlag;
692}
693
695{
696 return m_fixtureList;
697}
698
699inline const b2Fixture* b2Body::GetFixtureList() const
700{
701 return m_fixtureList;
702}
703
705{
706 return m_jointList;
707}
708
709inline const b2JointEdge* b2Body::GetJointList() const
710{
711 return m_jointList;
712}
713
715{
716 return m_contactList;
717}
718
719inline const b2ContactEdge* b2Body::GetContactList() const
720{
721 return m_contactList;
722}
723
725{
726 return m_next;
727}
728
729inline const b2Body* b2Body::GetNext() const
730{
731 return m_next;
732}
733
735{
736 return m_userData;
737}
738
739inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point, bool wake)
740{
741 if (m_type != b2_dynamicBody)
742 {
743 return;
744 }
745
746 if (wake && (m_flags & e_awakeFlag) == 0)
747 {
748 SetAwake(true);
749 }
750
751 // Don't accumulate a force if the body is sleeping.
752 if (m_flags & e_awakeFlag)
753 {
754 m_force += force;
755 m_torque += b2Cross(point - m_sweep.c, force);
756 }
757}
758
759inline void b2Body::ApplyForceToCenter(const b2Vec2& force, bool wake)
760{
761 if (m_type != b2_dynamicBody)
762 {
763 return;
764 }
765
766 if (wake && (m_flags & e_awakeFlag) == 0)
767 {
768 SetAwake(true);
769 }
770
771 // Don't accumulate a force if the body is sleeping
772 if (m_flags & e_awakeFlag)
773 {
774 m_force += force;
775 }
776}
777
778inline void b2Body::ApplyTorque(float torque, bool wake)
779{
780 if (m_type != b2_dynamicBody)
781 {
782 return;
783 }
784
785 if (wake && (m_flags & e_awakeFlag) == 0)
786 {
787 SetAwake(true);
788 }
789
790 // Don't accumulate a force if the body is sleeping
791 if (m_flags & e_awakeFlag)
792 {
793 m_torque += torque;
794 }
795}
796
797inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point, bool wake)
798{
799 if (m_type != b2_dynamicBody)
800 {
801 return;
802 }
803
804 if (wake && (m_flags & e_awakeFlag) == 0)
805 {
806 SetAwake(true);
807 }
808
809 // Don't accumulate velocity if the body is sleeping
810 if (m_flags & e_awakeFlag)
811 {
812 m_linearVelocity += m_invMass * impulse;
813 m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse);
814 }
815}
816
817inline void b2Body::ApplyLinearImpulseToCenter(const b2Vec2& impulse, bool wake)
818{
819 if (m_type != b2_dynamicBody)
820 {
821 return;
822 }
823
824 if (wake && (m_flags & e_awakeFlag) == 0)
825 {
826 SetAwake(true);
827 }
828
829 // Don't accumulate velocity if the body is sleeping
830 if (m_flags & e_awakeFlag)
831 {
832 m_linearVelocity += m_invMass * impulse;
833 }
834}
835
836inline void b2Body::ApplyAngularImpulse(float impulse, bool wake)
837{
838 if (m_type != b2_dynamicBody)
839 {
840 return;
841 }
842
843 if (wake && (m_flags & e_awakeFlag) == 0)
844 {
845 SetAwake(true);
846 }
847
848 // Don't accumulate velocity if the body is sleeping
849 if (m_flags & e_awakeFlag)
850 {
851 m_angularVelocity += m_invI * impulse;
852 }
853}
854
855inline void b2Body::SynchronizeTransform()
856{
857 m_xf.q.Set(m_sweep.a);
858 m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter);
859}
860
861inline void b2Body::Advance(float alpha)
862{
863 // Advance to the new safe time. This doesn't sync the broad-phase.
864 m_sweep.Advance(alpha);
865 m_sweep.c = m_sweep.c0;
866 m_sweep.a = m_sweep.a0;
867 m_xf.q.Set(m_sweep.a);
868 m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter);
869}
870
872{
873 return m_world;
874}
875
876inline const b2World* b2Body::GetWorld() const
877{
878 return m_world;
879}
880
881#endif
A rigid body. These are created via b2World::CreateBody.
Definition: b2_body.h:129
bool IsEnabled() const
Get the active state of the body.
Definition: b2_body.h:666
void SetEnabled(bool flag)
bool IsFixedRotation() const
Does this body have fixed rotation?
Definition: b2_body.h:671
b2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2 &localPoint) const
Definition: b2_body.h:586
b2Vec2 GetLocalPoint(const b2Vec2 &worldPoint) const
Definition: b2_body.h:571
b2Fixture * CreateFixture(const b2Shape *shape, float density)
void ResetMassData()
b2BodyUserData & GetUserData()
Get the user data pointer that was provided in the body definition.
Definition: b2_body.h:734
b2ContactEdge * GetContactList()
Definition: b2_body.h:714
float GetAngularDamping() const
Get the angular damping of the body.
Definition: b2_body.h:601
void ApplyAngularImpulse(float impulse, bool wake)
Definition: b2_body.h:836
void SetAngularVelocity(float omega)
Definition: b2_body.h:524
void SetSleepingAllowed(bool flag)
Definition: b2_body.h:676
void SetBullet(bool flag)
Should this body be treated like a bullet for continuous collision detection?
Definition: b2_body.h:621
void SetType(b2BodyType type)
Set the type of this body. This may alter the mass and velocity.
const b2Vec2 & GetWorldCenter() const
Get the world position of the center of mass.
Definition: b2_body.h:494
void GetMassData(b2MassData *data) const
Definition: b2_body.h:554
void SetUserData(void *data)
Set the user data. Use this to store your application specific data.
b2JointEdge * GetJointList()
Get the list of all joints attached to this body.
Definition: b2_body.h:704
void SetMassData(const b2MassData *data)
b2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2 &worldPoint) const
Definition: b2_body.h:581
const b2Vec2 & GetLocalCenter() const
Get the local position of the center of mass.
Definition: b2_body.h:499
b2Fixture * GetFixtureList()
Get the list of all fixtures attached to this body.
Definition: b2_body.h:694
bool IsAwake() const
Definition: b2_body.h:661
float GetLinearDamping() const
Get the linear damping of the body.
Definition: b2_body.h:591
b2Vec2 GetWorldPoint(const b2Vec2 &localPoint) const
Definition: b2_body.h:561
float GetAngularVelocity() const
Definition: b2_body.h:539
const b2Vec2 & GetPosition() const
Definition: b2_body.h:484
void ApplyLinearImpulse(const b2Vec2 &impulse, const b2Vec2 &point, bool wake)
Definition: b2_body.h:797
void SetAngularDamping(float angularDamping)
Set the angular damping of the body.
Definition: b2_body.h:606
void SetLinearVelocity(const b2Vec2 &v)
Definition: b2_body.h:504
void DestroyFixture(b2Fixture *fixture)
float GetMass() const
Definition: b2_body.h:544
float GetGravityScale() const
Get the gravity scale of the body.
Definition: b2_body.h:611
const b2Vec2 & GetLinearVelocity() const
Definition: b2_body.h:519
void SetGravityScale(float scale)
Set the gravity scale of the body.
Definition: b2_body.h:616
void ApplyForce(const b2Vec2 &force, const b2Vec2 &point, bool wake)
Definition: b2_body.h:739
b2BodyType GetType() const
Get the type of this body.
Definition: b2_body.h:474
void SetLinearDamping(float linearDamping)
Set the linear damping of the body.
Definition: b2_body.h:596
b2Fixture * CreateFixture(const b2FixtureDef *def)
float GetAngle() const
Definition: b2_body.h:489
void ApplyForceToCenter(const b2Vec2 &force, bool wake)
Definition: b2_body.h:759
b2World * GetWorld()
Get the parent world of this body.
Definition: b2_body.h:871
void SetTransform(const b2Vec2 &position, float angle)
bool IsSleepingAllowed() const
Is this body allowed to sleep.
Definition: b2_body.h:689
void SetAwake(bool flag)
Definition: b2_body.h:638
void Dump()
Dump this body to a file.
void ApplyTorque(float torque, bool wake)
Definition: b2_body.h:778
b2Body * GetNext()
Get the next body in the world's body list.
Definition: b2_body.h:724
bool IsBullet() const
Is this body treated like a bullet for continuous collision detection?
Definition: b2_body.h:633
b2Vec2 GetWorldVector(const b2Vec2 &localVector) const
Definition: b2_body.h:566
float GetInertia() const
Definition: b2_body.h:549
b2Vec2 GetLocalVector(const b2Vec2 &worldVector) const
Definition: b2_body.h:576
void ApplyLinearImpulseToCenter(const b2Vec2 &impulse, bool wake)
Definition: b2_body.h:817
const b2Transform & GetTransform() const
Definition: b2_body.h:479
void SetFixedRotation(bool flag)
Definition: b2_contact.h:89
Definition: b2_contact_manager.h:36
Definition: b2_distance_joint.h:77
Definition: b2_fixture.h:117
Definition: b2_friction_joint.h:61
Definition: b2_gear_joint.h:62
Definition: b2_joint.h:111
Definition: b2_motor_joint.h:65
Definition: b2_mouse_joint.h:66
Definition: b2_prismatic_joint.h:92
Definition: b2_pulley_joint.h:85
Definition: b2_revolute_joint.h:95
Definition: b2_shape.h:49
Definition: b2_weld_joint.h:70
Definition: b2_wheel_joint.h:96
Definition: b2_world.h:47
Definition: b2_body.h:53
bool allowSleep
Definition: b2_body.h:103
bool awake
Is this body initially awake or sleeping?
Definition: b2_body.h:106
b2Vec2 linearVelocity
The linear velocity of the body's origin in world co-ordinates.
Definition: b2_body.h:84
bool fixedRotation
Should this body be prevented from rotating? Useful for characters.
Definition: b2_body.h:109
bool enabled
Does this body start out enabled?
Definition: b2_body.h:118
b2Vec2 position
Definition: b2_body.h:78
bool bullet
Definition: b2_body.h:115
b2BodyDef()
This constructor sets the body definition default values.
Definition: b2_body.h:55
b2BodyType type
Definition: b2_body.h:74
float linearDamping
Definition: b2_body.h:93
float angularVelocity
The angular velocity of the body.
Definition: b2_body.h:87
float angle
The world angle of the body in radians.
Definition: b2_body.h:81
float gravityScale
Scale the gravity applied to this body.
Definition: b2_body.h:124
b2BodyUserData userData
Use this to store application specific body data.
Definition: b2_body.h:121
float angularDamping
Definition: b2_body.h:99
You can define this to inject whatever data you want in b2Body.
Definition: b2_settings.h:59
Definition: b2_contact.h:78
Definition: b2_fixture.h:62
Definition: b2_joint.h:64
This holds the mass data computed for a shape.
Definition: b2_shape.h:34
b2Vec2 center
The position of the shape's centroid relative to the shape's origin.
Definition: b2_shape.h:39
float mass
The mass of the shape, usually in kilograms.
Definition: b2_shape.h:36
float I
The rotational inertia of the shape about the local origin.
Definition: b2_shape.h:42
void Set(float angle)
Set using an angle in radians.
Definition: b2_math.h:300
Definition: b2_math.h:369
b2Vec2 c
center world positions
Definition: b2_math.h:383
void Advance(float alpha)
Definition: b2_math.h:697
b2Vec2 localCenter
local center of mass position
Definition: b2_math.h:382
float a
world angles
Definition: b2_math.h:384
Definition: b2_math.h:339
A 2D column vector.
Definition: b2_math.h:42
void SetZero()
Set this vector to all zeros.
Definition: b2_math.h:50