Ray will not hit objects in octree if they are transparent or invisible.

This commit is contained in:
William Moberg
2016-02-17 16:06:35 +01:00
parent 23bb1a6405
commit 72db672dbf
+3 -2
View File
@@ -693,8 +693,9 @@ boost::optional<EntityAABB> EntityFirstHitByRay(const Ray& ray, std::vector<Enti
if (!entityBox.Entity.HasComponent("Model")) {
continue;
}
std::string res = entityBox.Entity["Model"]["Resource"];
if (res.empty()) {
auto& cModel = entityBox.Entity["Model"];
std::string res = cModel["Resource"];
if (res.empty() || (bool)cModel["Transparent"] || !((bool)cModel["Visible"])) {
continue;
}
Model* model;