YAGE
0.02
Yet Another Game Engine
particlebody.hpp
Go to the documentation of this file.
1
/* ----------------------------------------------------------------------------
2
* particlebody.hpp
3
*
4
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
5
* See file LICENSE for more details
6
* ----------------------------------------------------------------------------
7
*/
8
9
#ifndef YAGE_PHYSICS_PARTICLE_BODY_HPP
10
#define YAGE_PHYSICS_PARTICLE_BODY_HPP
11
12
#include "
Math/matrix.hpp
"
13
#include "
Physics/body.hpp
"
14
15
namespace
yage
16
{
17
18
class
ParticleBody
:
public
Body
19
{
20
public
:
21
ParticleBody
(
const
Vector2d
&position =
Vector2d
(0, 0),
double
mass = 1,
22
const
Vector2d
&velocity =
Vector2d
(0, 0),
23
bool
gravity =
true
);
24
25
// apply a force to the rigid body
26
void
applyForce
(
const
Vector2d
&force)
override
;
27
void
update
()
override
;
28
};
29
30
}
// yage
31
32
#endif
matrix.hpp
yage::Vector2< double >
yage::ParticleBody::ParticleBody
ParticleBody(const Vector2d &position=Vector2d(0, 0), double mass=1, const Vector2d &velocity=Vector2d(0, 0), bool gravity=true)
Definition:
particlebody.cpp:17
yage::ParticleBody
Definition:
particlebody.hpp:18
yage::Body
Definition:
body.hpp:16
yage::ParticleBody::applyForce
void applyForce(const Vector2d &force) override
Definition:
particlebody.cpp:23
yage::Vector2d
Vector2< double > Vector2d
Definition of a 2D vector.
Definition:
matrix.hpp:350
body.hpp
yage::ParticleBody::update
void update() override
Definition:
particlebody.cpp:25
yage
Templated matrix class.
Definition:
camera2d.hpp:17
include
YAGE
Physics
particlebody.hpp
Generated on Thu Aug 24 2017 00:24:55 for YAGE by
1.8.13