cosmetix
[k8-jellyphysics.git] / src / jelly / PressureBody.h
blobcdd00b7c7c20cfadff74ecec34cae0745b930955
1 #ifndef _PRESSURE_BODY_H
2 #define _PRESSURE_BODY_H
4 #include "SpringBody.h"
7 namespace JellyPhysics {
9 class PressureBody : public SpringBody {
10 public:
11 PressureBody (
12 World *w, const ClosedShape &s, float mpp,
13 float gasPressure, float shapeK, float shapeD,
14 float edgeK, float edgeD,
15 const Vector2 &pos, float angleInRadians, const Vector2 &scale,
16 bool kinematic
17 ) : SpringBody(w, s, mpp, shapeK, shapeD, edgeK, edgeD, pos, angleInRadians, scale, kinematic) {
18 mGasAmount = gasPressure;
19 mNormalList = new Vector2[mPointCount];
22 ~PressureBody ();
24 void setGasPressure (float val) { mGasAmount = val; }
25 float getGasPressure () const { return mGasAmount; }
27 float getVolume() const { return mVolume; }
29 void accumulateInternalForces ();
31 protected:
32 float mVolume;
33 float mGasAmount;
34 Vector2 *mNormalList;
40 #endif