Lephisto/src/body.cpp
2017-11-17 20:51:44 +00:00

22 lines
462 B
C++

#include "libs.h"
#include "body.h"
#include "frame.h"
Body::Body(void) {
m_frame = 0;
m_flags = 0;
m_projectedPos = vector3d(0.0f, 0.0f, 0.0f);
m_onscreen = false;
}
/* f == NULL, then absolute position within system. */
vector3d Body::GetPositionRelTo(const Frame* relTo) {
return m_frame->GetPosRelativeToOtherFrame(relTo) + GetPosition();
}
const vector3d& Body::GetProjectedPos(void) const {
assert(IsOnscreen());
return m_projectedPos;
}