Panda3D
|
00001 // Filename: lensFlareNode.I 00002 // Created by: jason (01Aug00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 //////////////////////////////////////////////////////////////////// 00016 // Function: LensFlareNode::Constructor 00017 // Access: Public 00018 // Description: 00019 //////////////////////////////////////////////////////////////////// 00020 INLINE LensFlareNode:: 00021 LensFlareNode() : 00022 _global_scale(1), _texel_scale(0.1), _blind_fall_off(45), _flare_fall_off(5) 00023 { 00024 _blind = (Texture *)NULL; 00025 } 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Function: LensFlareNode::set_texel_scale 00029 // Access: Public 00030 // Description: 00031 //////////////////////////////////////////////////////////////////// 00032 INLINE void LensFlareNode:: 00033 set_texel_scale(float texel_to_world) 00034 { 00035 _texel_scale = texel_to_world; 00036 } 00037 00038 //////////////////////////////////////////////////////////////////// 00039 // Function: LensFlareNode::set_global_scale 00040 // Access: Public 00041 // Description: 00042 //////////////////////////////////////////////////////////////////// 00043 INLINE void LensFlareNode:: 00044 set_global_scale(float scale) 00045 { 00046 _global_scale = scale; 00047 } 00048 00049 //////////////////////////////////////////////////////////////////// 00050 // Function: LensFlareNode::set_blind_falloff 00051 // Access: Public 00052 // Description: 00053 //////////////////////////////////////////////////////////////////// 00054 INLINE void LensFlareNode:: 00055 set_blind_falloff(float fall_off) 00056 { 00057 _blind_fall_off = cos(deg_2_rad(fall_off)) - 1; 00058 } 00059 00060 //////////////////////////////////////////////////////////////////// 00061 // Function: LensFlareNode::set_flare_falloff 00062 // Access: Public 00063 // Description: 00064 //////////////////////////////////////////////////////////////////// 00065 INLINE void LensFlareNode:: 00066 set_flare_falloff(float fall_off) 00067 { 00068 _flare_fall_off = cos(deg_2_rad(fall_off)) - 1; 00069 } 00070 00071 //////////////////////////////////////////////////////////////////// 00072 // Function: LensFlareNode::set_light 00073 // Access: Public 00074 // Description: 00075 //////////////////////////////////////////////////////////////////// 00076 INLINE void LensFlareNode:: 00077 set_light_source(PT_Node light) 00078 { 00079 _light_node = light; 00080 }