Skip to content

Commit 047fec4

Browse files
committed
added stickman class source files
1 parent 7e504f3 commit 047fec4

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

stickman.cc

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* =====================================================================================
3+
*
4+
* Filename: stickman.cc
5+
*
6+
* Description: a stickman class
7+
*
8+
* Version: 1.0
9+
* Created: 04.04.2017 14:21:19
10+
* Revision: none
11+
* Compiler: gcc
12+
*
13+
* Author: Arvid Krein (mn), [email protected]
14+
* Company: -
15+
*
16+
* =====================================================================================
17+
*/
18+
19+
#include "stickman.h"
20+
21+
//Bodypart class functions
22+
Bodypart::Bodypart()
23+
{
24+
kraftpartikel tempPart;
25+
for(std::vector<Beznode>::iterator i = mPath.mNodes.begin(); i < mPath.mNodes.end(); ++i)
26+
{
27+
tempPart.setX(i->getX());
28+
tempPart.setY(i->getY());
29+
vJoints.push_back(tempPart);
30+
}
31+
}
32+
33+
Bodypart::Bodypart(Bezpath bodyPath)
34+
{
35+
mPath = bodyPath;
36+
kraftpartikel tempPart;
37+
for(std::vector<Beznode>::iterator i = mPath.mNodes.begin(); i < mPath.mNodes.end(); ++i)
38+
{
39+
tempPart.setX(i->getX());
40+
tempPart.setY(i->getY());
41+
vJoints.push_back(tempPart);
42+
}
43+
44+
}
45+
46+
void Bodypart::iterate(float t)
47+
{
48+
49+
}

stickman.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* =====================================================================================
3+
*
4+
* Filename: stickman.h
5+
*
6+
* Description: stickman class
7+
*
8+
* Version: 1.0
9+
* Created: 04.04.2017 14:21:37
10+
* Revision: none
11+
* Compiler: gcc
12+
*
13+
* Author: Arvid Krein (mn), [email protected]
14+
* Company: -
15+
*
16+
* =====================================================================================
17+
*/
18+
#ifndef STICKMAN
19+
#define STICKMAN
20+
#include <vector>
21+
#include <cmath>
22+
#include "bezier.h"
23+
#include "physobj.h"
24+
25+
class Bodypart
26+
{
27+
public:
28+
Bodypart();
29+
Bodypart(Bezpath bodyPath);
30+
Bezpath mPath;
31+
std::vector<kraftpartikel> vJoints;
32+
void iterate(float t);
33+
};
34+
35+
#endif

0 commit comments

Comments
 (0)