本文整理汇总了C++中Ray::SetLen方法的典型用法代码示例。如果您正苦于以下问题:C++ Ray::SetLen方法的具体用法?C++ Ray::SetLen怎么用?C++ Ray::SetLen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ray
的用法示例。
在下文中一共展示了Ray::SetLen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TraceAgainst
FHitResult APlayerControl::TraceAgainst( UPrimitiveComponent* component, const FVector2D& ScreenPosition )
{
Ray ray;
if( !UGameplayStatics::DeprojectScreenToWorld( this, ScreenPosition, ray.start, ray.dir ) )
{
error( FS( "Could not DeprojectScreenToWorld (%f %f)", ScreenPosition.X, ScreenPosition.Y ) );
}
ray.SetLen( RayLength );
return TraceAgainst( component, ray );
}
示例2: RayPickMulti
vector<AGameObject*> APlayerControl::RayPickMulti( const FVector2D& ScreenPosition, SetAGameObject AcceptedTypes, SetAGameObject NotTypes )
{
TArray<FHitResult> hits;
Ray ray;
if( !UGameplayStatics::DeprojectScreenToWorld( this, ScreenPosition, ray.start, ray.dir ) )
{
error( FS( "Could not DeprojectScreenToWorld (%f %f)", ScreenPosition.X, ScreenPosition.Y ) );
}
ray.SetLen( RayLength );
return RayPickMulti( ray, AcceptedTypes, NotTypes );
}
示例3: error
vector<Ray> APlayerControl::GetFrustumRays( const FBox2DU& box )
{
vector<FVector2D> pts = { box.TL(), box.BL(), box.BR(), box.TR() };
vector<Ray> rays;
// get the 4 rays of the frustum
for( int i = 0; i < pts.size(); i++ )
{
Ray ray;
if( !UGameplayStatics::DeprojectScreenToWorld( this, pts[i], ray.start, ray.dir ) )
{
error( FS( "Could not DeprojectScreenToWorld to world for %f %f", pts[i].X, pts[i].Y ) );
}
ray.SetLen( RayLength ); // WATCH THIS NUMBER IS NOT TOO LARGE, 1e5f causes imprecision
rays.push_back( ray );
}
return rays;
}