1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#include "baked_light_instance.h"
#include "scene/scene_string_names.h"
RID BakedLightInstance::get_baked_light_instance() const {
if (baked_light.is_null())
return RID();
else
return get_instance();
}
void BakedLightInstance::set_baked_light(const Ref<BakedLight>& p_baked_light) {
baked_light=p_baked_light;
RID base_rid;
if (baked_light.is_valid())
base_rid=baked_light->get_rid();
else
base_rid=RID();
set_base(base_rid);
if (is_inside_world()) {
emit_signal(SceneStringNames::get_singleton()->baked_light_changed);
// for (List<Node*>::Element *E=baked_geometry.front();E;E=E->next()) {
// VS::get_singleton()->instance_geometry_set_baked_light(E->get()->get_instance(),baked_light.is_valid()?get_instance():RID());
// }
}
}
Ref<BakedLight> BakedLightInstance::get_baked_light() const{
return baked_light;
}
AABB BakedLightInstance::get_aabb() const {
return AABB(Vector3(0,0,0),Vector3(1,1,1));
}
DVector<Face3> BakedLightInstance::get_faces(uint32_t p_usage_flags) const {
return DVector<Face3>();
}
void BakedLightInstance::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_baked_light","baked_light"),&BakedLightInstance::set_baked_light);
ObjectTypeDB::bind_method(_MD("get_baked_light"),&BakedLightInstance::get_baked_light);
ObjectTypeDB::bind_method(_MD("get_baked_light_instance"),&BakedLightInstance::get_baked_light_instance);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"baked_light",PROPERTY_HINT_RESOURCE_TYPE,"BakedLight"),_SCS("set_baked_light"),_SCS("get_baked_light"));
ADD_SIGNAL( MethodInfo("baked_light_changed"));
}
BakedLightInstance::BakedLightInstance() {
}
|