RenderPipeline. More...
#include "rpSpotLight.h"
Public Member Functions | |
RPSpotLight () | |
Creates a new spot light. More... | |
const LVecBase3 & | get_direction () const |
float | get_fov () const |
float | get_radius () const |
virtual void | init_shadow_sources () |
Inits the shadow sources of the light. More... | |
void | look_at (LVecBase3 point) |
void | look_at (float x, float y, float z) |
void | set_direction (LVecBase3 direction) |
void | set_direction (float dx, float dy, float dz) |
void | set_fov (float fov) |
void | set_radius (float radius) |
virtual void | update_shadow_sources () |
Updates the shadow sources. More... | |
virtual void | write_to_command (GPUCommand &cmd) |
Writes the light to a GPUCommand. More... | |
Public Member Functions inherited from RPLight | |
RPLight (LightType light_type) | |
RenderPipeline. More... | |
virtual | ~RPLight () |
Light destructor. More... | |
void | assign_slot (int slot) |
Assigns a slot to the light. More... | |
void | clear_ies_profile () |
void | clear_shadow_sources () |
Clears all shadow source. More... | |
bool | get_casts_shadows () const |
const LVecBase3 & | get_color () const |
float | get_energy () const |
int | get_ies_profile () const |
LightType | get_light_type () const |
float | get_near_plane () const |
bool | get_needs_update () const |
Returns whether the light needs an update. More... | |
size_t | get_num_shadow_sources () const |
RenderPipeline. More... | |
const LVecBase3 & | get_pos () const |
size_t | get_shadow_map_resolution () const |
ShadowSource * | get_shadow_source (size_t index) const |
Returns the n-th shadow source. More... | |
int | get_slot () const |
Returns the slot of the light. More... | |
bool | has_ies_profile () const |
bool | has_slot () const |
Returns whether the light has a slot. More... | |
void | invalidate_shadows () |
Invalidates the shadows. More... | |
void | remove_slot () |
Removes the light slot. More... | |
void | set_casts_shadows (bool flag=true) |
void | set_color (const LVecBase3 &color) |
void | set_color (float r, float g, float b) |
void | set_color_from_temperature (float temperature) |
Sets the lights color from a given color temperature. More... | |
void | set_energy (float energy) |
void | set_ies_profile (int profile) |
void | set_near_plane (float near_plane) |
void | set_needs_update (bool flag) |
Sets whether the light needs an update. More... | |
void | set_pos (const LVecBase3 &pos) |
void | set_pos (float x, float y, float z) |
void | set_shadow_map_resolution (size_t resolution) |
Public Member Functions inherited from ReferenceCount | |
int | get_ref_count () const |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | ref_if_nonzero () const |
Atomically increases the reference count of this object if it is not zero. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
WeakReferenceList * | weak_ref () |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref () |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Public Attributes | |
get_direction | |
get_fov | |
get_radius | |
set_direction | |
set_fov | |
set_radius | |
RenderPipeline. More... | |
Public Attributes inherited from RPLight | |
clear_ies_profile | |
Clears the ies profile. More... | |
get_casts_shadows | |
Returns whether the light casts shadows. More... | |
get_color | |
Returns the lights color. More... | |
get_energy | |
Returns the energy of the light. More... | |
get_ies_profile | |
Returns the lights ies profile. More... | |
get_light_type | |
Returns the type of the light. More... | |
get_near_plane | |
Returns the near plane of the light. More... | |
get_pos | |
Returns the position of the light. More... | |
get_shadow_map_resolution | |
Returns the shadow map resolution. More... | |
has_ies_profile | |
Returns whether the light has an ies profile assigned. More... | |
set_casts_shadows | |
Controls whether the light casts shadows. More... | |
set_color | |
Sets the lights color. More... | |
set_energy | |
Sets the energy of the light. More... | |
set_ies_profile | |
Sets the ies profile. More... | |
set_near_plane | |
Sets the near plane of the light. More... | |
set_pos | |
Sets the position of the light. More... | |
set_shadow_map_resolution | |
Sets the lights shadow map resolution. More... | |
Public Attributes inherited from ReferenceCount | |
get_ref_count | |
Returns the current reference count. More... | |
Additional Inherited Members | |
Public Types inherited from RPLight | |
enum | LightType { LT_empty = 0, LT_point_light = 1, LT_spot_light = 2 } |
Different types of light. More... | |
Static Public Member Functions inherited from ReferenceCount | |
static TypeHandle | get_class_type () |
static void | init_type () |
RenderPipeline.
Copyright (c) 2014-2016 tobspr tobia s.sp ringe r1@g mail. com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SpotLight class
This represents a spot light, a light which has a position, radius, direction and FoV. Checkout the RenderPipeline documentation for more information about this type of light.
Definition at line 39 of file rpSpotLight.h.
RPSpotLight::RPSpotLight | ( | ) |
Creates a new spot light.
This creates a new spot light with default properties set. You should set at least a direction, fov, radius and position to make the light useful.
Definition at line 41 of file rpSpotLight.cxx.
|
virtual |
Inits the shadow sources of the light.
This inits all required shadow sources for the spot light.
Implements RPLight.
Definition at line 68 of file rpSpotLight.cxx.
|
virtual |
Updates the shadow sources.
This updates all shadow sources of the light.
Implements RPLight.
Definition at line 78 of file rpSpotLight.cxx.
References RPLight::get_shadow_map_resolution.
|
virtual |
Writes the light to a GPUCommand.
This writes the spot light data to a GPUCommand.
cmd | The target GPUCommand |
Reimplemented from RPLight.
Definition at line 54 of file rpSpotLight.cxx.
References GPUCommand::push_float(), GPUCommand::push_vec3(), and RPLight::write_to_command().
|
inline |
RenderPipeline.
Copyright (c) 2014-2016 tobspr tobia s.sp ringe r1@g mail. com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition at line 45 of file rpSpotLight.h.