add_light, remove_light
This commit is contained in:
parent
aae16048a3
commit
17ba5c39b0
|
|
@ -65,6 +65,37 @@ get_light(int n) const {
|
|||
return _lights[n];
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: LightAttrib::add_light
|
||||
// Access: Published
|
||||
// Description: Returns a new LightAttrib, just like this one, but
|
||||
// with the indicated light added to the list of lights.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE CPT(RenderAttrib) LightAttrib::
|
||||
add_light(Light *light) const {
|
||||
if (_operation == O_remove) {
|
||||
return compose(make(O_remove, light));
|
||||
} else {
|
||||
return compose(make(O_add, light));
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: LightAttrib::remove_light
|
||||
// Access: Published
|
||||
// Description: Returns a new LightAttrib, just like this one, but
|
||||
// with the indicated light removed from the list of
|
||||
// lights.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE CPT(RenderAttrib) LightAttrib::
|
||||
remove_light(Light *light) const {
|
||||
if (_operation == O_remove) {
|
||||
return compose(make(O_add, light));
|
||||
} else {
|
||||
return compose(make(O_remove, light));
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: LightAttrib::is_identity
|
||||
// Access: Published
|
||||
|
|
|
|||
|
|
@ -61,6 +61,9 @@ PUBLISHED:
|
|||
INLINE Light *get_light(int n) const;
|
||||
bool has_light(Light *light) const;
|
||||
|
||||
INLINE CPT(RenderAttrib) add_light(Light *light) const;
|
||||
INLINE CPT(RenderAttrib) remove_light(Light *light) const;
|
||||
|
||||
INLINE bool is_identity() const;
|
||||
INLINE bool is_all_off() const;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue