本文整理汇总了C++中Body::GetInterpPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Body::GetInterpPosition方法的具体用法?C++ Body::GetInterpPosition怎么用?C++ Body::GetInterpPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Body
的用法示例。
在下文中一共展示了Body::GetInterpPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void Camera::Update()
{
if (!m_frame) return;
// make temporary camera frame
m_camFrame = new Frame(m_frame, "camera", Frame::FLAG_ROTATING);
// move and orient it to the camera position
m_camFrame->SetOrient(m_orient);
m_camFrame->SetPosition(m_pos);
// make sure old orient and interpolated orient (rendering orient) are not rubbish
m_camFrame->ClearMovement();
m_camFrame->UpdateInterpTransform(1.0); // update root-relative pos/orient
// evaluate each body and determine if/where/how to draw it
m_sortedBodies.clear();
for (Space::BodyIterator i = Pi::game->GetSpace()->BodiesBegin(); i != Pi::game->GetSpace()->BodiesEnd(); ++i) {
Body *b = *i;
// prepare attrs for sorting and drawing
BodyAttrs attrs;
attrs.body = b;
Frame::GetFrameRenderTransform(b->GetFrame(), m_camFrame, attrs.viewTransform);
attrs.viewCoords = attrs.viewTransform * b->GetInterpPosition();
attrs.camDist = attrs.viewCoords.Length();
attrs.bodyFlags = b->GetFlags();
m_sortedBodies.push_back(attrs);
}
// depth sort
m_sortedBodies.sort();
}