From 097c1e8fc524e02fa67638546f3d02bf236bcb12 Mon Sep 17 00:00:00 2001 From: Garux Date: Mon, 2 Oct 2017 18:00:40 +0300 Subject: [PATCH] * Valve220: fix patch.CapTexture (patch had invalid control points: define basis) * Curve->Simple patch mesh: CapTexture() instead of NaturalTexture() for convinience --- radiant/patch.cpp | 6 +++++- radiant/surfacedialog.cpp | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/radiant/patch.cpp b/radiant/patch.cpp index ff7d1b18..d6a0193f 100644 --- a/radiant/patch.cpp +++ b/radiant/patch.cpp @@ -660,6 +660,7 @@ void Patch::CapTexture(){ Vector3 normal = Calculate_AvgNormal(); TextureProjection projection; TexDef_Construct_Default( projection ); + ComputeAxisBase( normal, projection.m_basis_s, projection.m_basis_t ); /* Valve220 */ ProjectTexture( projection, normal ); #endif } @@ -1563,7 +1564,10 @@ void Patch::ConstructPrefab( const AABB& aabb, EPatchPrefab eType, int axis, std InsertRemove( true, false, true ); } - NaturalTexture(); + if ( eType == ePlane ) + CapTexture(); + else + NaturalTexture(); } void Patch::RenderDebug( RenderStateFlags state ) const { diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index cf789dd5..2ce52076 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -519,12 +519,9 @@ static void OnBtnPatchFit( GtkWidget *widget, gpointer data ){ } static void OnBtnReset( GtkWidget *widget, gpointer data ){ -//globalOutputStream() << "--> [OnBtnAxial]...\n"; UndoableCommand undo( "textureDefault" ); TextureProjection projection; -//globalOutputStream() << " TexDef_Construct_Default()...\n"; TexDef_Construct_Default( projection ); -//globalOutputStream() << " Select_SetTexdef()...\n"; #if TEXTOOL_ENABLED