* UV Tool (edit texture alignment of selected face) modifiers:

pivot control point and lines: ctrl = snap hard to face vertices and grid
		grid density controls: shift = change density of both axes synchronously, ctrl = power of two grid
		scale lines: shift = scale axes synchronously, ctrl = snap hard to vertices
		alt + m1 on grid = skew texture (is possible alright in BP and Valve220 map formats, not in AP); ctrl = snap hard to edges
		texture move: shift = only move along the axis with the biggest move, ctrl = snap grid lines hard to vertices and pivot
		rotate: shift = rotate with step of 15 degrees, ctrl = snap hard to edges
This commit is contained in:
Garux
2019-05-19 10:30:44 +03:00
parent 3ce07bb310
commit aa99f4d254
11 changed files with 1487 additions and 172 deletions

View File

@@ -153,5 +153,16 @@ inline double plane3_distance_to_point( const Plane3& plane, const BasicVector3<
return vector3_dot( point, plane.normal() ) - plane.dist();
}
template<typename T, typename U>
inline BasicVector3<T> plane3_project_point( const Plane3& plane, const BasicVector3<T>& point, const BasicVector3<U>& direction ){
const double f = vector3_dot( plane.normal(), direction );
const double d = ( vector3_dot( plane.normal() * plane.dist() - point, plane.normal() ) ) / f;
return point + direction * d;
}
template<typename T>
inline BasicVector3<T> plane3_project_point( const Plane3& plane, const BasicVector3<T>& point ){
return ( point - plane.normal() * vector3_dot( point, plane.normal() ) + plane.normal() * plane.dist() );
}
#endif

View File

@@ -240,17 +240,17 @@ static Shader* getShader(){
return StaticShader::instance();
}
RenderablePivot(){
RenderablePivot( std::size_t size = 16 ){
m_vertices.reserve( 6 );
m_vertices.push_back( PointVertex( Vertex3f( 0, 0, 0 ), g_colour_x ) );
m_vertices.push_back( PointVertex( Vertex3f( 16, 0, 0 ), g_colour_x ) );
m_vertices.push_back( PointVertex( Vertex3f( size, 0, 0 ), g_colour_x ) );
m_vertices.push_back( PointVertex( Vertex3f( 0, 0, 0 ), g_colour_y ) );
m_vertices.push_back( PointVertex( Vertex3f( 0, 16, 0 ), g_colour_y ) );
m_vertices.push_back( PointVertex( Vertex3f( 0, size, 0 ), g_colour_y ) );
m_vertices.push_back( PointVertex( Vertex3f( 0, 0, 0 ), g_colour_z ) );
m_vertices.push_back( PointVertex( Vertex3f( 0, 0, 16 ), g_colour_z ) );
m_vertices.push_back( PointVertex( Vertex3f( 0, 0, size ), g_colour_z ) );
}
void render( RenderStateFlags state ) const {