Refactor shadow casters
This commit is contained in:
parent
200b1ad6d8
commit
e99822ae3c
1 changed files with 5 additions and 2 deletions
|
@ -169,11 +169,14 @@ bool ModelNodeSceneNode::shouldRender() const {
|
|||
}
|
||||
|
||||
bool ModelNodeSceneNode::shouldCastShadows() const {
|
||||
if (_modelSceneNode->usage() != ModelUsage::Creature) return false;
|
||||
// Skin nodes must not cast shadows
|
||||
if (static_cast<bool>(_modelNode->skin())) return false;
|
||||
|
||||
// Meshless nodes must not cast shadows
|
||||
shared_ptr<ModelMesh> mesh(_modelNode->mesh());
|
||||
if (!mesh) return false;
|
||||
|
||||
return mesh && mesh->shouldCastShadows() && !static_cast<bool>(_modelNode->skin());
|
||||
return mesh->shouldCastShadows();
|
||||
}
|
||||
|
||||
bool ModelNodeSceneNode::isTransparent() const {
|
||||
|
|
Loading…
Reference in a new issue