本文整理汇总了C++中FVector2D::IntPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ FVector2D::IntPoint方法的具体用法?C++ FVector2D::IntPoint怎么用?C++ FVector2D::IntPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FVector2D
的用法示例。
在下文中一共展示了FVector2D::IntPoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Tick
void FWebBrowserViewport::Tick( const FGeometry& AllottedGeometry, double InCurrentTime, float DeltaTime )
{
// Calculate max corner of the viewport using same method as Slate
FVector2D MaxPos = AllottedGeometry.AbsolutePosition + AllottedGeometry.GetLocalSize();
// Get size by subtracting as int to avoid incorrect rounding when size and position are .5
WebBrowserWindow->SetViewportSize(MaxPos.IntPoint() - AllottedGeometry.AbsolutePosition.IntPoint());
}
示例2: MaterialObject
FSlateMaterialResource::FSlateMaterialResource(const UMaterialInterface& InMaterial, const FVector2D& InImageSize, FSlateShaderResource* InTextureMask )
: MaterialObject( &InMaterial )
, SlateProxy( new FSlateShaderResourceProxy )
, TextureMaskResource( InTextureMask )
, Width(FMath::RoundToInt(InImageSize.X))
, Height(FMath::RoundToInt(InImageSize.Y))
{
SlateProxy->ActualSize = InImageSize.IntPoint();
SlateProxy->Resource = this;
}
示例3: UpdateMaterial
void FSlateMaterialResource::UpdateMaterial(const UMaterialInterface& InMaterialResource, const FVector2D& InImageSize, FSlateShaderResource* InTextureMask )
{
MaterialObject = &InMaterialResource;
if( !SlateProxy )
{
SlateProxy = new FSlateShaderResourceProxy;
}
TextureMaskResource = InTextureMask;
SlateProxy->ActualSize = InImageSize.IntPoint();
SlateProxy->Resource = this;
Width = FMath::RoundToInt(InImageSize.X);
Height = FMath::RoundToInt(InImageSize.Y);
}
示例4: SnapLocationToNearestVertex
bool FVertexSnappingImpl::SnapLocationToNearestVertex( FVector& Location, const FVector2D& MouseLocation, FLevelEditorViewportClient* ViewportClient, FVector& OutVertexNormal, bool bDrawVertexHelpers )
{
bool bSnapped = false;
// Make a box around the actor which is the area we are allowed to snap in
FBox AllowedSnappingBox = FBox( Location-VertexSnappingConstants::MaxSnappingDistance, Location+VertexSnappingConstants::MaxSnappingDistance );
FSceneViewFamilyContext ViewFamily(FSceneViewFamily::ConstructionValues(
ViewportClient->Viewport,
ViewportClient->GetScene(),
ViewportClient->EngineShowFlags )
.SetRealtimeUpdate( ViewportClient->IsRealtime() ));
FSceneView* View = ViewportClient->CalcSceneView( &ViewFamily );
TArray<FSnapActor> ActorsInBox;
TSet<TWeakObjectPtr<AActor> > ActorsToIgnore;
// Ignore actors currently being moved
ActorsToIgnore.Append( ViewportClient->GetDropPreviewActors() );
GetPossibleSnapActors( AllowedSnappingBox, MouseLocation.IntPoint(), ViewportClient, View, EAxisList::Screen, ActorsToIgnore, ActorsInBox );
FViewportCursorLocation Cursor(View, ViewportClient, MouseLocation.X, MouseLocation.Y );
FPlane ActorPlane( Location, Cursor.GetDirection() );
FVertexSnappingArgs Args
(
ActorPlane,
Location,
ViewportClient,
View,
Cursor.GetCursorPos(),
EAxisList::Screen,
bDrawVertexHelpers
);
// Snap to the nearest vertex
FSnappingVertex ClosestVertex = GetClosestVertex( ActorsInBox, Args );
Location = ClosestVertex.Position;
OutVertexNormal = ClosestVertex.Normal;
bSnapped = true;
return bSnapped;
}