-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBlob.h
44 lines (33 loc) · 807 Bytes
/
Blob.h
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
35
36
37
38
39
40
41
42
43
44
#pragma once
#include "SoftBody.h"
#include <GLFW/glfw3.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include "AggregateInput.h"
#include "Line.h"
#include "Helper.h"
#include "ShaderProgram.h"
class Blob : public SoftBody
{
private:
btSoftBody::Node *sampleNodes[6] = { NULL };
btVector3 centroid;
btScalar radius;
public:
btVector3 forward;
float speed;
Blob(
btSoftBodyWorldInfo& softBodyWorldInfo,
const btVector3& center, btScalar scale, int vertices);
~Blob();
void Update();
void Move(int key, int action);
void AddForce(const btVector3 &force);
void AddForces(const AggregateInput &inputs);
void AddForce(const btVector3 &force, int i);
void ComputeCentroid();
btVector3 GetCentroid();
void DrawGizmos(ShaderProgram* shaderProgram);
void Gui();
};