aboutsummaryrefslogtreecommitdiff
path: root/Client/Source/Phy2DLite/Body.h
blob: c3d746a831be4890b6ee5ca09e8ea3a81bd2729c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include "Math.h"

namespace Phy2D
{

    struct Body
    {
        Body();
        void Set(const Vec2& w, fixed m);

        void AddForce(const Vec2& f)
        {
            force += f;
        }

        Vec2 position;
        fixed rotation;

        Vec2 velocity;
        fixed angularVelocity;

        Vec2 force;
        fixed torque;

        Vec2 width;

        fixed friction;
        fixed mass, invMass;
        fixed I, invI;
    };

}