本文整理汇总了C++中Body::GetFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ Body::GetFlags方法的具体用法?C++ Body::GetFlags怎么用?C++ Body::GetFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Body
的用法示例。
在下文中一共展示了Body::GetFlags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: Update
void Camera::Update()
{
if (!m_body) return;
if (m_shadersEnabled != Render::AreShadersEnabled()) {
m_frustum = Render::Frustum(m_width, m_height, m_fovAng);
m_shadersEnabled = !m_shadersEnabled;
}
// make temporary camera frame at the body
m_camFrame = new Frame(m_body->GetFrame(), "camera", Frame::TEMP_VIEWING);
// interpolate between last physics tick position and current one,
// to remove temporal aliasing
matrix4x4d bodyPose = m_body->GetInterpolatedTransform();
m_camFrame->SetTransform(bodyPose * m_pose);
// make sure old orient and interpolated orient (rendering orient) are not rubbish
m_camFrame->ClearMovement();
// 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->GetInterpolatedPosition();
attrs.camDist = attrs.viewCoords.Length();
attrs.bodyFlags = b->GetFlags();
m_sortedBodies.push_back(attrs);
}
// depth sort
m_sortedBodies.sort();
}