Blender V4.3
subd/patch.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#ifndef __SUBD_PATCH_H__
6#define __SUBD_PATCH_H__
7
8#include "util/boundbox.h"
9#include "util/types.h"
10
12
13class Patch {
14 public:
15 Patch() : patch_index(0), shader(0), from_ngon(false) {}
16
17 virtual ~Patch() = default;
18
19 virtual void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v) = 0;
20
22 int shader;
24};
25
26/* Linear Quad Patch */
27
28class LinearQuadPatch : public Patch {
29 public:
31 float3 normals[4];
32
33 void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v);
35};
36
37/* Bicubic Patch */
38
39class BicubicPatch : public Patch {
40 public:
42
43 void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v);
45};
46
48
49#endif /* __SUBD_PATCH_H__ */
ATTR_WARN_UNUSED_RESULT const BMVert * v
BoundBox bound()
Definition patch.cpp:102
float3 hull[16]
Definition subd/patch.h:41
void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)
Definition patch.cpp:84
float3 hull[4]
Definition subd/patch.h:30
BoundBox bound()
Definition patch.cpp:71
void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)
Definition patch.cpp:53
int shader
Definition subd/patch.h:22
bool from_ngon
Definition subd/patch.h:23
int patch_index
Definition subd/patch.h:21
Patch()
Definition subd/patch.h:15
virtual void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)=0
virtual ~Patch()=default
#define CCL_NAMESPACE_END
#define N