open_toontown_panda3d/panda/src/effects/lensFlareNode.I

81 lines
2.5 KiB
Plaintext

// Filename: lensFlareNode.I
// Created by: jason (01Aug00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: LensFlareNode::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE LensFlareNode::
LensFlareNode() :
_global_scale(1), _texel_scale(0.1), _blind_fall_off(45), _flare_fall_off(5)
{
_blind = (Texture *)NULL;
}
////////////////////////////////////////////////////////////////////
// Function: LensFlareNode::set_texel_scale
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE void LensFlareNode::
set_texel_scale(float texel_to_world)
{
_texel_scale = texel_to_world;
}
////////////////////////////////////////////////////////////////////
// Function: LensFlareNode::set_global_scale
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE void LensFlareNode::
set_global_scale(float scale)
{
_global_scale = scale;
}
////////////////////////////////////////////////////////////////////
// Function: LensFlareNode::set_blind_falloff
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE void LensFlareNode::
set_blind_falloff(float fall_off)
{
_blind_fall_off = cos(deg_2_rad(fall_off)) - 1;
}
////////////////////////////////////////////////////////////////////
// Function: LensFlareNode::set_flare_falloff
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE void LensFlareNode::
set_flare_falloff(float fall_off)
{
_flare_fall_off = cos(deg_2_rad(fall_off)) - 1;
}
////////////////////////////////////////////////////////////////////
// Function: LensFlareNode::set_light
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE void LensFlareNode::
set_light_source(PT_Node light)
{
_light_node = light;
}