Ray will not hit objects in octree if they are transparent or invisible.
This commit is contained in:
@@ -693,8 +693,9 @@ boost::optional<EntityAABB> EntityFirstHitByRay(const Ray& ray, std::vector<Enti
|
|||||||
if (!entityBox.Entity.HasComponent("Model")) {
|
if (!entityBox.Entity.HasComponent("Model")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::string res = entityBox.Entity["Model"]["Resource"];
|
auto& cModel = entityBox.Entity["Model"];
|
||||||
if (res.empty()) {
|
std::string res = cModel["Resource"];
|
||||||
|
if (res.empty() || (bool)cModel["Transparent"] || !((bool)cModel["Visible"])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Model* model;
|
Model* model;
|
||||||
|
|||||||
Reference in New Issue
Block a user