Panda3D

Public Member Functions | Public Attributes | List of all members
RPPointLight Class Reference

RenderPipeline. More...

`#include "rpPointLight.h"`

Inheritance diagram for RPPointLight:

## Public Member Functions
| RPPointLight ()
| RenderPipeline. More...
float | get_inner_radius () const
float | get_radius () const
virtual void | init_shadow_sources ()
| Inits the shadow sources of the light. More...
void | set_inner_radius (float inner_radius)
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...
bool | unref_if_one () const
| Atomically decreases the reference count of this object if it is one. 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 Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)

## Public Attributes
| get_inner_radius
| Returns the inner radius of the light. More...
| get_radius
| Returns the lights radius. More...
| set_inner_radius
| Sets the inner radius of the light. More...
| 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 light's 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 light's 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 ()

## Detailed Description

RenderPipeline.

Copyright (c) 2014-2016 tobspr tobia.nosp@m.s.sp.nosp@m.ringe.nosp@m.r1@g.nosp@m.mail..nosp@m.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.

PointLight class

This represents a point light, a light which has a position and radius. Checkout the RenderPipeline documentation for more information about this type of light.

Definition at line 39 of file rpPointLight.h.

## Constructor & Destructor Documentation

## ◆ RPPointLight()

RPPointLight::RPPointLight | ( |  | ) |

RenderPipeline.

Copyright (c) 2014-2016 tobspr tobia.nosp@m.s.sp.nosp@m.ringe.nosp@m.r1@g.nosp@m.mail..nosp@m.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.

Constructs a new point light

This contructs a new point light with default settings. By default the light is set to be an infinitely small point light source. You can change this with RPPointLight::set_inner_radius.

Definition at line 37 of file rpPointLight.cxx.

## Member Function Documentation

## ◆ init_shadow_sources()

void RPPointLight::init_shadow_sources | ( |  | ) |
| virtual

Inits the shadow sources of the light.

This inits all required shadow sources for the point light.

See also
  RPLight::init_shadow_sources

Implements RPLight.

Definition at line 60 of file rpPointLight.cxx.

## ◆ update_shadow_sources()

void RPPointLight::update_shadow_sources | ( |  | ) |
| virtual

Updates the shadow sources.

This updates all shadow sources of the light.

See also
  RPLight::update_shadow_sources

Implements RPLight.

Definition at line 73 of file rpPointLight.cxx.

## ◆ write_to_command()

void RPPointLight::write_to_command | ( | GPUCommand & | cmd | ) |
| virtual

Writes the light to a GPUCommand.

This writes the point light data to a GPUCommand.

See also
  RPLight::write_to_command

Parameters

  cmd | The target GPUCommand

Reimplemented from RPLight.

Definition at line 49 of file rpPointLight.cxx.

References GPUCommand::push_float(), and RPLight::write_to_command().

## Member Data Documentation

## ◆ get_inner_radius

float RPPointLight::get_inner_radius
| inline

Returns the inner radius of the light.

This returns the inner radius of the light, previously set with RPPointLight::get_inner_radius.

Returns
  [description]

Definition at line 49 of file rpPointLight.h.

## ◆ get_radius

float RPPointLight::get_radius
| inline

Returns the lights radius.

This returns the lights radius previously set with RPPointLight::set_radius

Returns
  Light radius in world space

Definition at line 45 of file rpPointLight.h.

## ◆ set_inner_radius

void RPPointLight::set_inner_radius
| inline

Sets the inner radius of the light.

This sets the inner radius of the light. Anything greater than zero causes the light to get an area light. This has influence on the specular highlights of the light aswell as the shadows.

The inner radius controls the size of the lights sphere size in world space units. A radius of 0 means the light has no inner radius, and the light will be have like an infinite small point light source. A radius greater than zero will cause the light to behave like it would be an emissive sphere with the given inner radius emitting light. This is more physically correct.

Parameters

  inner_radius | Inner-radius in world space

Definition at line 49 of file rpPointLight.h.

## ◆ set_radius

void RPPointLight::set_radius
| inline

RenderPipeline.

Copyright (c) 2014-2016 tobspr tobia.nosp@m.s.sp.nosp@m.ringe.nosp@m.r1@g.nosp@m.mail..nosp@m.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.

Sets the radius of the light

This sets the radius of the light. It controls the lights influence. After a distance greater than this radius, the light influence is zero.

Parameters

  radius | Light radius in world space

Definition at line 45 of file rpPointLight.h.

The documentation for this class was generated from the following files:

- contrib/src/rplight/rpPointLight.h
- contrib/src/rplight/rpPointLight.cxx
- contrib/src/rplight/rpPointLight.I