本文整理汇总了C++中Spatial::UpdateGS方法的典型用法代码示例。如果您正苦于以下问题:C++ Spatial::UpdateGS方法的具体用法?C++ Spatial::UpdateGS怎么用?C++ Spatial::UpdateGS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spatial
的用法示例。
在下文中一共展示了Spatial::UpdateGS方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateWorldData
//----------------------------------------------------------------------------
void NodeBillboard::UpdateWorldData(Double appTime, Bool updateControllers)
{
// Compute billboard's world transforms based on its parent's world
// transform and its local transforms. Notice that you should not call
// Node::UpdateWorldData since that function updates its children. The
// children of a NodeBillboard cannot be updated until the billboard is
// aligned with the camera.
Spatial::UpdateWorldData(appTime, updateControllers);
if (mspCamera)
{
// Inverse-transform the camera to the model space of the billboard.
Vector3F camLocation = World.ApplyInverse(mspCamera->GetLocation());
// To align the billboard, the projection of the camera to the
// xz-plane of the billboard's model space determines the angle of
// rotation about the billboard's model y-axis. If the projected
// camera is on the model axis (x = 0 and z = 0), ATan2 returns zero
// (rather than NaN), so there is no need to trap this degenerate
// case and handle it separately.
Float angle = MathF::ATan2(camLocation.X(), camLocation.Z());
Matrix34F orientation(Vector3F::UNIT_Y, angle);
World.SetRotate(World.GetMatrix() * orientation);
}
// update the children now that the billboard orientation is known
for (UInt i = 0; i < mChildren.GetQuantity(); i++)
{
Spatial* pChild = mChildren[i];
if (pChild)
{
pChild->UpdateGS(appTime, false, updateControllers);
}
}
}
示例2: UpdateWorldData
//----------------------------------------------------------------------------
void Node::UpdateWorldData(Double appTime, Bool updateControllers)
{
Spatial::UpdateWorldData(appTime, updateControllers);
for (UInt i = 0; i < GetQuantity(); i++)
{
Spatial* pChild = mChildren[i];
if (pChild)
{
pChild->UpdateGS(appTime, false, updateControllers);
}
}
}
示例3: UpdateWorldData
//----------------------------------------------------------------------------
void Node::UpdateWorldData (double dAppTime)
{
Spatial::UpdateWorldData(dAppTime);
for (int i = 0; i < m_kChild.GetQuantity(); i++)
{
Spatial* pkChild = m_kChild[i];
if (pkChild)
{
pkChild->UpdateGS(dAppTime,false);
}
}
}