Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 79 lines (73 sloc) 2.57 kb
c75cb92 StaticRigidBody renamed to ModelBody (and can only be an sbre model thin...
tompox authored
1 #ifndef _DYNAMICBODY_H
2 #define _DYNAMICBODY_H
96342f3 initial import
tompox authored
3
4 #include "Body.h"
c75cb92 StaticRigidBody renamed to ModelBody (and can only be an sbre model thin...
tompox authored
5 #include "ModelBody.h"
96342f3 initial import
tompox authored
6 #include "vector3.h"
7 #include "matrix4x4.h"
8
c75cb92 StaticRigidBody renamed to ModelBody (and can only be an sbre model thin...
tompox authored
9 class DynamicBody: public ModelBody {
96342f3 initial import
tompox authored
10 public:
5825356 a lot of savegame preliminary work
tompox authored
11 OBJDEF(DynamicBody, ModelBody, DYNAMICBODY);
c75cb92 StaticRigidBody renamed to ModelBody (and can only be an sbre model thin...
tompox authored
12 DynamicBody();
13 virtual ~DynamicBody();
0072f8c landing on planets
tompox authored
14 virtual void SetRotMatrix(const matrix4x4d &r);
225ec2a more basic AI functions. split out into Ship-AI.cpp
tompox authored
15 virtual void GetRotMatrix(matrix4x4d &m) const;
27f7638 set body velocities correctly as they enter and leave moving frames
tompox authored
16 virtual void SetVelocity(vector3d v);
fcfbf61 remove bits of ode collision detection from ModelBody
tompox authored
17 virtual void SetPosition(vector3d p);
5fc4c29 initial odeless DynamicBody work. ode dependency removed. no collisions ...
tompox authored
18 virtual vector3d GetPosition() const;
225ec2a more basic AI functions. split out into Ship-AI.cpp
tompox authored
19 virtual vector3d GetVelocity() const;
1f470e8 @WaveMotion Put GetTransformRelTo in the right place
WaveMotion authored
20 matrix4x4d GetTransformRelTo(const Frame *relTo) const;
225ec2a more basic AI functions. split out into Ship-AI.cpp
tompox authored
21 vector3d GetAngVelocity() const;
96342f3 initial import
tompox authored
22 void SetAngVelocity(vector3d v);
23 void SetMesh(ObjMesh *m);
006379e oops. passing Object* to OnCollision instead of Body*. fix
tompox authored
24 virtual bool OnCollision(Object *o, Uint32 flags, double relVel);
225ec2a more basic AI functions. split out into Ship-AI.cpp
tompox authored
25 vector3d GetAngularMomentum() const;
dd5d3ec angular response in dynamic on dynamic collisions
tompox authored
26 double GetAngularInertia() const { return m_angInertia; }
58902c3 get crap ready for player changing ship. compiler generate flat turds wi...
tompox authored
27 void SetMassDistributionFromModel();
5fc4c29 initial odeless DynamicBody work. ode dependency removed. no collisions ...
tompox authored
28 void DisableBodyOnly() { m_enabled = false; }
225ec2a more basic AI functions. split out into Ship-AI.cpp
tompox authored
29 bool IsEnabled() const { return m_enabled; }
d7ea553 make docking work again, using the flagged (=1) docking area
tompox authored
30 virtual void Disable();
31 virtual void Enable();
a275295 @robn set mass updated for fuel change directly, instead of overriding GetMass...
robn authored
32 virtual double GetMass() const { return m_mass; } // XXX don't override this
fcfbf61 remove bits of ode collision detection from ModelBody
tompox authored
33 virtual void TimeStepUpdate(const float timeStep);
70bbee8 Everything working, moving on to endvel > 0
John Jordan authored
34 void CalcExternalForce();
dd5d3ec angular response in dynamic on dynamic collisions
tompox authored
35 void UndoTimestep();
96342f3 initial import
tompox authored
36
c5a74d1 abstract DynamicBody stuff for ode removal soon
tompox authored
37 void SetMass(double);
38 void AddForce(const vector3d);
dd5d3ec angular response in dynamic on dynamic collisions
tompox authored
39 void AddTorque(const vector3d);
c5a74d1 abstract DynamicBody stuff for ode removal soon
tompox authored
40 void SetForce(const vector3d);
41 void SetTorque(const vector3d);
02d6c18 @robn move ship-specific code into Ship
robn authored
42 vector3d GetLastForce() const { return m_lastForce; }
43 vector3d GetLastTorque() const { return m_lastTorque; }
c5a74d1 abstract DynamicBody stuff for ode removal soon
tompox authored
44 // body-relative forces
45 void AddRelForce(const vector3d);
46 void AddRelTorque(const vector3d);
70bbee8 Everything working, moving on to endvel > 0
John Jordan authored
47 vector3d GetExternalForce() const { return m_externalForce; }
48 vector3d GetAtmosForce() const { return m_atmosForce; }
49 vector3d GetGravityForce() const { return m_gravityForce; }
6a6b5f5 @tomm lots more timestep fix work. cities have disappeared and things start of...
tomm authored
50 virtual void UpdateInterpolatedTransform(double alpha);
c5a74d1 abstract DynamicBody stuff for ode removal soon
tompox authored
51
28ec406 @robn pass the space down to bodies so they can find their frames etc
robn authored
52 virtual void PostLoadFixup(Space *space);
96342f3 initial import
tompox authored
53 protected:
a8818c3 @robn pass the space to the serializer/save methods for consistency with load....
robn authored
54 virtual void Save(Serializer::Writer &wr, Space *space);
28ec406 @robn pass the space down to bodies so they can find their frames etc
robn authored
55 virtual void Load(Serializer::Reader &rd, Space *space);
96342f3 initial import
tompox authored
56 private:
5fc4c29 initial odeless DynamicBody work. ode dependency removed. no collisions ...
tompox authored
57 // new odeless turd
58 matrix4x4d m_orient; // contains pos
dd5d3ec angular response in dynamic on dynamic collisions
tompox authored
59 matrix4x4d m_oldOrient;
5fc4c29 initial odeless DynamicBody work. ode dependency removed. no collisions ...
tompox authored
60 vector3d m_force;
61 vector3d m_torque;
62 vector3d m_vel;
63 vector3d m_angVel;
9393c49 @tomm maybe partly fix interpolate rotation for dynamicbody
tomm authored
64 vector3d m_oldAngDisplacement;
5fc4c29 initial odeless DynamicBody work. ode dependency removed. no collisions ...
tompox authored
65 double m_mass;
66 double m_massRadius; // set in a mickey-mouse fashion from the collision mesh and used to calculate m_angInertia
67 double m_angInertia; // always sphere mass distribution
68 bool m_enabled;
4de393c atmospheric shielding. atmospheric friction
tompox authored
69 //
70bbee8 Everything working, moving on to endvel > 0
John Jordan authored
70 vector3d m_externalForce;
71 vector3d m_atmosForce;
72 vector3d m_gravityForce;
c237a93 10000x navigation now pretty solid
John Jordan authored
73 // for time accel reduction fudge
74 vector3d m_lastForce;
75 vector3d m_lastTorque;
96342f3 initial import
tompox authored
76 };
77
c75cb92 StaticRigidBody renamed to ModelBody (and can only be an sbre model thin...
tompox authored
78 #endif /* _DYNAMICBODY_H */
Something went wrong with that request. Please try again.