cppast/src/refl/cpp/vertex.h

62 lines
1.3 KiB
C
Raw Normal View History

2024-04-18 22:17:22 +08:00
#include <iostream>
2024-04-28 22:15:01 +08:00
#include "refl/refl.h"
using namespace std;
using namespace refl;
struct vec3_parent {
virtual int norm(int x1, int& x2) {
x2 = x1 * x2;
return x2;
//cout << x2 << "vec3_parent::norm" << endl;
}
2024-04-26 19:22:14 +08:00
};
2024-04-28 22:15:01 +08:00
struct vec3 : public vec3_parent {
using MyMeta = class vec3_Meta;
using MyMetas = MulytMeta<vec3>;
UPROPERTY_vk({ 1.f })
float x = 1;
UPROPERTY_vk({ 2.f })
float y = 2;
UPROPERTY({ 5.f })
float z = 3;
UPROPERTY({ "hello meta" })
string name = "???";
UFUNCTION({ {3,4} })
int norm(int x1, int& x2)override {
int tmp = x1 * 2 + 1;
x1 = x2;
x2 = tmp;
return x2;
//cout << x2 << "vec3::norm" << endl;
}
UFUNCTION({1})
virtual float norm1(int& x1) {
x1 = x1 * x * y * z;
x = x1;
y = x1 - 1;
//z = x1 - 10;
//cout << x1 << "::norm1" << endl;
return x1;
}
UFUNCTION({})
static void norm2(int x1 = 10) {
cout << x1 << "::norm2" << endl;
2024-04-26 19:22:14 +08:00
}
2024-04-28 22:15:01 +08:00
UFUNCTION({})
static void norm3(int x1 = 10) {
x1 = x1 * 10;
cout << x1 << "::norm3" << endl;
}
};
2024-04-21 21:44:53 +08:00
2024-04-28 22:15:01 +08:00
template<>
struct MulytMeta<vec3> {
static const UClass* UIMeta();
static const UClass* GetMeta(const Name& name) {
if (name == FName("UIMeta")) {
return UIMeta();
}
return nullptr;
}
2024-04-26 19:22:14 +08:00
};
2024-04-28 22:15:01 +08:00
//template const UClass* MetaClass<vec3::UIMeta>();
2024-04-26 19:22:14 +08:00
#include "meta_vertex_gen.inl"