本文整理汇总了C++中AlignedBox::Transform方法的典型用法代码示例。如果您正苦于以下问题:C++ AlignedBox::Transform方法的具体用法?C++ AlignedBox::Transform怎么用?C++ AlignedBox::Transform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AlignedBox
的用法示例。
在下文中一共展示了AlignedBox::Transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateSingleObject
void CreateTool::CreateSingleObject( const Vector3& translation, const Vector3& normal, bool checkValid )
{
Matrix4 orientation;
{
HELIUM_EDITOR_SCENE_SCOPE_TIMER( "Finalize Instance Orientation" );
FinalizeOrientation( orientation, translation, normal );
}
if ( checkValid )
{
float adjustedInstanceRadius = m_InstanceRadius / s_PaintDensity;
float minDistance = 2.0f * adjustedInstanceRadius;
float scale = minDistance / m_InstanceRadius;
Matrix4 scaledOrientation( Scale( minDistance, minDistance, minDistance ) );
scaledOrientation *= orientation;
AlignedBox instanceBounds = m_InstanceBounds;
instanceBounds.Transform( scaledOrientation );
if ( !ValidPosition( instanceBounds, translation, minDistance ) )
{
return;
}
}
if ( m_Instance.ReferencesObject() )
{
HELIUM_EDITOR_SCENE_SCOPE_TIMER( "Update Temporary Instance At Location" );
m_Instance->SetObjectTransform( orientation );
m_Instance->Evaluate( GraphDirections::Downstream );
}
else
{
HELIUM_EDITOR_SCENE_SCOPE_TIMER( "Place Temporary Instance At Location" );
Place( orientation );
}
{
HELIUM_EDITOR_SCENE_SCOPE_TIMER( "Add Instance To Scene" );
AddToScene();
}
if ( m_Instance.ReferencesObject() )
{
HELIUM_EDITOR_SCENE_SCOPE_TIMER( "Update Temporary Instance At Location" );
if ( m_PaintTimer.IsAlive() )
{
orientation *= Matrix4( Scale( 0.0f, 0.0f, 0.0f ) );
}
m_Instance->SetObjectTransform( orientation );
m_Instance->Evaluate( GraphDirections::Downstream );
}
}