当前位置: 首页>>代码示例>>C++>>正文


C++ Spatial::UpdateGS方法代码示例

本文整理汇总了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);
        }
    }
}
开发者ID:rrath,项目名称:Wire3D,代码行数:36,代码来源:WireNodeBillboard.cpp

示例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);
		}
	}
}
开发者ID:cbalderrama,项目名称:wire3d,代码行数:14,代码来源:WireNode.cpp

示例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);
        }
    }
}
开发者ID:juhgiyo,项目名称:Soft3DEngine,代码行数:14,代码来源:WgNode.cpp


注:本文中的Spatial::UpdateGS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。