mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Return diffuse color for get_base_color if neither base color nor metallic have been specified
This commit is contained in:
parent
41fad59ae8
commit
becd0aa416
@ -67,7 +67,7 @@ get_default() {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: Material::has_base_color
|
// Function: Material::has_base_color
|
||||||
// Access: Published
|
// Access: Published
|
||||||
// Description: Returns true if the base_color color has been explicitly
|
// Description: Returns true if the base color has been explicitly
|
||||||
// set for this material, false otherwise.
|
// set for this material, false otherwise.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE bool Material::
|
INLINE bool Material::
|
||||||
@ -79,12 +79,16 @@ has_base_color() const {
|
|||||||
// Function: Material::get_base_color
|
// Function: Material::get_base_color
|
||||||
// Access: Published
|
// Access: Published
|
||||||
// Description: Returns the base_color color setting, if it has been
|
// Description: Returns the base_color color setting, if it has been
|
||||||
// set. Returns (0,0,0,0) if the base_color color has not
|
// set. If neither the base color nor the metallic
|
||||||
// been set.
|
// have been set, this returns the diffuse color.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE const LColor &Material::
|
INLINE const LColor &Material::
|
||||||
get_base_color() const {
|
get_base_color() const {
|
||||||
|
if (!has_base_color() && !has_metallic()) {
|
||||||
|
return _diffuse;
|
||||||
|
} else {
|
||||||
return _base_color;
|
return _base_color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user