cppast/src/refl/cpp/vertex.h

43 lines
927 B
C
Raw Normal View History

2024-04-18 22:17:22 +08:00
#include <iostream>
2024-04-19 22:23:40 +08:00
using namespace std;
2024-04-18 22:17:22 +08:00
struct vec3_parent {
virtual int norm(int x1, int& x2) {
x2 = x1 * x2;
return x2;
//cout << x2 << "vec3_parent::norm" << endl;
}
};
2024-04-19 22:23:40 +08:00
struct vec3_Meta;
2024-04-18 22:17:22 +08:00
struct vec3 : public vec3_parent {
2024-04-19 22:23:40 +08:00
using MyMeta = vec3_Meta;
__cppast(Meta = { 0.f}, UIMeta = {1.f})
2024-04-18 22:17:22 +08:00
float x = 1;
2024-04-19 22:23:40 +08:00
__cppast(Meta = { 0.f})
2024-04-18 22:17:22 +08:00
float y = 2;
2024-04-19 22:23:40 +08:00
__cppast(Meta = { 0.f})
2024-04-18 22:17:22 +08:00
float z = 3;
2024-04-19 22:23:40 +08:00
string name{ "hellohellohellohellohellohello" };
__cppast(Meta = { {3,4} })
2024-04-18 22:17:22 +08:00
int norm(int x1, int& x2)override {
int tmp = x1 * 2 + 1;
x1 = x2;
x2 = tmp;
return x2;
//cout << x2 << "vec3::norm" << endl;
}
virtual float norm1(int& x1) {
x1 = x1 * x * y * z;
//x = x1;
//y = x1 - 1;
//z = x1 - 10;
//cout << x1 << "::norm1" << endl;
return x1;
}
static void norm2(int x1 = 10) {
2024-04-19 22:23:40 +08:00
cout << x1 << "::norm2" << endl;
2024-04-18 22:17:22 +08:00
}
static void norm3(int x1 = 10) {
x1 = x1 * 10;
2024-04-19 22:23:40 +08:00
cout << x1 << "::norm3" << endl;
2024-04-18 22:17:22 +08:00
}
};