21 return (1 << (level - 1)) + 1;
28 return 1 + (1 << level);
36 return 1 << (high_level - low_level);
43 return level + (1 << level) - 1;
50 return (
byte *)(&(
v)[1]);
55 return (
byte *)(&(
e)[1]);
102 dataSize * (1 + S * (maxGridSize + maxGridSize * maxGridSize));
103 return &gridBase[dataSize * x * spacing];
107 CCGFace *f,
int lvl,
int S,
int x,
int levels,
int dataSize,
int normalDataOffset)
112 dataSize * (1 + S * (maxGridSize + maxGridSize * maxGridSize));
113 return &gridBase[dataSize * x * spacing + normalDataOffset];
117 CCGFace *f,
int lvl,
int S,
int x,
int y,
int levels,
int dataSize)
122 dataSize * (1 + S * (maxGridSize + maxGridSize * maxGridSize));
123 return &gridBase[dataSize * (maxGridSize + (y * maxGridSize +
x) * spacing)];
127 CCGFace *f,
int lvl,
int S,
int x,
int y,
int levels,
int dataSize,
int normalDataOffset)
132 dataSize * (1 + S * (maxGridSize + maxGridSize * maxGridSize));
133 return (
float *)&gridBase[dataSize * (maxGridSize + (y * maxGridSize +
x) * spacing) +
139 for (
int i = 0; i < f->
numVerts; i++) {
149 for (
int i = 0; i < f->
numVerts; i++) {
158 CCGFace *f,
CCGEdge *
e,
int f_ed_idx,
int lvl,
int eX,
int eY,
int levels,
int dataSize)
169 eX = (maxGridSize * 2 - 1) - 1 - eX;
171 y = maxGridSize - 1 - eX;
172 x = maxGridSize - 1 - eY;
179 f_ed_idx = (f_ed_idx + 1) % f->
numVerts;
192 const float length =
sqrtf(no[0] * no[0] + no[1] * no[1] + no[2] * no[2]);
195 const float length_inv = 1.0f /
length;
259 v[i] = (a[i] +
b[i] + c[i] + d[i]) * 0.25f;
BLI_INLINE int ccg_edgesize(int level)
BLI_INLINE void Normalize(float no[3])
BLI_INLINE CCGVert ** FACE_getVerts(CCGFace *f)
BLI_INLINE float * ccg_edge_getNo(CCGEdge *e, int lvl, int x, int dataSize, int normalDataOffset)
BLI_INLINE int ccg_gridsize(int level)
BLI_INLINE void * ccg_face_getIECo(CCGFace *f, int lvl, int S, int x, int levels, int dataSize)
BLI_INLINE byte * EDGE_getLevelData(CCGEdge *e)
BLI_INLINE void VertDataZero(float v[], const CCGSubSurf *ss)
BLI_INLINE float * ccg_vert_getNo(CCGVert *v, int lvl, int dataSize, int normalDataOffset)
BLI_INLINE CCGEdge ** FACE_getEdges(CCGFace *f)
BLI_INLINE bool VertDataEqual(const float a[], const float b[], const CCGSubSurf *ss)
BLI_INLINE int ccg_edgebase(int level)
BLI_INLINE int ccg_face_getEdgeIndex(CCGFace *f, CCGEdge *e)
BLI_INLINE void * ccg_face_getIFCo(CCGFace *f, int lvl, int S, int x, int y, int levels, int dataSize)
BLI_INLINE int ccg_spacing(int high_level, int low_level)
BLI_INLINE void VertDataSub(float a[], const float b[], const CCGSubSurf *ss)
BLI_INLINE void VertDataCopy(float dst[], const float src[], const CCGSubSurf *ss)
BLI_INLINE void * ccg_vert_getCo(CCGVert *v, int lvl, int dataSize)
BLI_INLINE void * ccg_face_getIENo(CCGFace *f, int lvl, int S, int x, int levels, int dataSize, int normalDataOffset)
BLI_INLINE int ccg_face_getVertIndex(CCGFace *f, CCGVert *v)
BLI_INLINE float * ccg_face_getIFNo(CCGFace *f, int lvl, int S, int x, int y, int levels, int dataSize, int normalDataOffset)
BLI_INLINE void VertDataMulN(float v[], float f, const CCGSubSurf *ss)
BLI_INLINE void VertDataAvg4(float v[], const float a[], const float b[], const float c[], const float d[], const CCGSubSurf *ss)
BLI_INLINE void * ccg_edge_getCo(CCGEdge *e, int lvl, int x, int dataSize)
BLI_INLINE void VertDataAdd(float a[], const float b[], const CCGSubSurf *ss)
BLI_INLINE void * ccg_face_getIFCoEdge(CCGFace *f, CCGEdge *e, int f_ed_idx, int lvl, int eX, int eY, int levels, int dataSize)
BLI_INLINE byte * FACE_getCenterData(CCGFace *f)
BLI_INLINE byte * VERT_getLevelData(CCGVert *v)
#define CCGSUBSURF_LEVEL_MAX
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
local_group_size(16, 16) .push_constant(Type b