Lephisto/src/model_body.h
Rtch90 fe8fedd5b7 [Add] Body: GetRadius method.
[Add] Calculate bounding sphere radius from AABB's of geoms.
[Add] Make use of the existing GetRadius methods.
[Change] Moved object viewer key to f10.
[Add] A couple new image icons.
2017-11-25 15:54:23 +00:00

47 lines
1.2 KiB
C++

#pragma once
#include <vector>
#include "body.h"
#include "vector3.h"
#include "matrix4x4.h"
#include "sbre/sbre.h"
class ObjMesh;
class ModelBody: public Body {
public:
ModelBody(void);
virtual ~ModelBody(void);
void SetPosition(vector3d p);
virtual void SetRotation(const matrix4x4d& r);
/* Not valid to SetVelocity on these. If you want them to move, use a DynamicBody. */
vector3d GetPosition(void);
virtual double GetRadius(void) const;
void TransformToModelCoords(const Frame* camFrame);
void ViewingRotation(void);
void GetRotMatrix(matrix4x4d& m);
virtual void SetFrame(Frame* f);
void GeomsSetBody(dBodyID body);
/* To remove from simulation for a period. */
virtual void Disable(void);
virtual void Enable(void);
void TriMeshUpdateLastPos(void);
void SetModel(int sbreModel);
void RenderSbreModel(const Frame* camFrame, int model, ObjParams* params);
class Geom : public Object {
public:
virtual Type GetType(void) { return Object::GEOM; }
Body* parent;
int flags;
};
protected:
std::vector<Geom> geomColl;
private:
std::vector<dGeomID> geoms;
dReal triMeshTrans[32];
int triMeshLastMatrixIndex;
};