Blender V4.5
SubPatch Class Reference

#include <subpatch.h>

Classes

struct  Edge
 

Public Types

enum  { TRIANGLE , QUAD }
 

Public Member Functions

 SubPatch (const Patch *patch, const int face_index, const int corner=0)
 
int calc_num_inner_verts () const
 
int calc_num_triangles () const
 
int get_vert_along_edge (const int edge, const int n) const
 
int get_vert_along_edge_reverse (const int edge, const int n) const
 
int get_inner_grid_vert_triangle (int i, int j) const
 
int get_vert_along_grid_edge (const int edge, const int n) const
 
float2 map_uv (float2 uv) const
 

Public Attributes

const Patchpatch = nullptr
 
int face_index = 0
 
int corner = 0
 
enum SubPatch:: { ... }  shape = QUAD
 
int inner_grid_vert_offset = 0
 
int triangles_offset = 0
 
float2 uvs [4] = {zero_float2(), make_float2(1.0f, 0.0f), one_float2(), make_float2(0.0f, 1.0f)}
 
Edge edges [4] = {}
 

Detailed Description

Definition at line 91 of file subpatch.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
TRIANGLE 
QUAD 

Definition at line 99 of file subpatch.h.

Constructor & Destructor Documentation

◆ SubPatch()

SubPatch::SubPatch ( const Patch * patch,
const int face_index,
const int corner = 0 )
inlineexplicit

Definition at line 167 of file subpatch.h.

Member Function Documentation

◆ calc_num_inner_verts()

int SubPatch::calc_num_inner_verts ( ) const
inline

Definition at line 172 of file subpatch.h.

References SubPatch::Edge::edge, edges, M, max, shape, SubEdge::T, and TRIANGLE.

Referenced by get_inner_grid_vert_triangle().

◆ calc_num_triangles()

int SubPatch::calc_num_triangles ( ) const
inline

Definition at line 189 of file subpatch.h.

References SubPatch::Edge::edge, edges, M, max, shape, SubEdge::T, and TRIANGLE.

Referenced by EdgeDice::tri_dice().

◆ get_inner_grid_vert_triangle()

int SubPatch::get_inner_grid_vert_triangle ( int i,
int j ) const
inline

Definition at line 234 of file subpatch.h.

References assert, calc_num_inner_verts(), and inner_grid_vert_offset.

Referenced by get_vert_along_grid_edge(), and EdgeDice::tri_dice().

◆ get_vert_along_edge()

int SubPatch::get_vert_along_edge ( const int edge,
const int n ) const
inline

◆ get_vert_along_edge_reverse()

int SubPatch::get_vert_along_edge_reverse ( const int edge,
const int n ) const
inline

Definition at line 229 of file subpatch.h.

References edges, and get_vert_along_edge().

Referenced by EdgeDice::add_triangle_strip().

◆ get_vert_along_grid_edge()

int SubPatch::get_vert_along_grid_edge ( const int edge,
const int n ) const
inline

◆ map_uv()

Member Data Documentation

◆ corner

int SubPatch::corner = 0

Definition at line 97 of file subpatch.h.

Referenced by EdgeDice::set_triangle(), and EdgeDice::set_vertex().

◆ edges

◆ face_index

int SubPatch::face_index = 0

Definition at line 96 of file subpatch.h.

Referenced by EdgeDice::set_triangle(), and EdgeDice::set_vertex().

◆ inner_grid_vert_offset

int SubPatch::inner_grid_vert_offset = 0

◆ patch

const Patch* SubPatch::patch = nullptr

◆ []

◆ triangles_offset

int SubPatch::triangles_offset = 0

◆ uvs

float2 SubPatch::uvs[4] = {zero_float2(), make_float2(1.0f, 0.0f), one_float2(), make_float2(0.0f, 1.0f)}

Definition at line 162 of file subpatch.h.

Referenced by map_uv().


The documentation for this class was generated from the following file: