/usr/include/opencollada/COLLADAFramework/COLLADAFWLight.h is in opencollada-dev 0.1.0~20140703.ddf8f47+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | /*
Copyright (c) 2008-2009 NetAllied Systems GmbH
This file is part of COLLADAFramework.
Licensed under the MIT Open Source License,
for details please see LICENSE file or the website
http://www.opensource.org/licenses/mit-license.php
*/
#ifndef __COLLADAFW_LIGHT_H__
#define __COLLADAFW_LIGHT_H__
#include "COLLADAFWPrerequisites.h"
#include "COLLADAFWObject.h"
#include "COLLADAFWColor.h"
#include "COLLADAFWAnimatableFloat.h"
namespace COLLADAFW
{
/** A light of one of the types: ambient, directional, point, spot.
Formula for attenuation:
A = constant_attenuation + ( D * linear_attenuation ) + ( D^2 * quadratic_attenuation )*/
class Light : public ObjectTemplate < COLLADA_TYPE::LIGHT >
{
public:
/** All possible types of light*/
enum LightType
{
UNDEFINED,
AMBIENT_LIGHT,
DIRECTIONAL_LIGHT,
POINT_LIGHT,
SPOT_LIGHT
};
private:
/**
* The original object id, if it in the original file format exist.
*/
String mOriginalId;
/** The name of the light.*/
String mName;
/** The type of the light.*/
LightType mLightType;
/** The color of the light. Has only rgb values, no alpha.
Used by all light types.*/
Color mColor;
/** The constant coefficient in the attenuation formula.
Used by point and spot lights.*/
AnimatableFloat mConstantAttenuation;
/** The linear coefficient in the attenuation formula.
Used by point and spot lights.*/
AnimatableFloat mLinearAttenuation;
/** The quadratic coefficient in the attenuation formula.
Used by point and spot lights.*/
AnimatableFloat mQuadraticAttenuation;
/** The fall off angle.
Used by spot and lights.*/
AnimatableFloat mFallOffAngle;
/** The fall off exponent.
Used by spot and lights.*/
AnimatableFloat mFallOffExponent;
public:
/** @param objectId The object id of the camera.*/
Light( const UniqueId& uniqueId );
/** Destructor. */
virtual ~Light();
/**
* The original object id, if it in the original file format exist.
*/
const String& getOriginalId () const { return mOriginalId; }
/**
* The original object id, if it in the original file format exist.
*/
void setOriginalId ( const String& val ) { mOriginalId = val; }
/** Returns name of the light.*/
const String& getName() const { return mName; }
/** Sets name of the light.*/
void setName(const String& name) { mName = name; }
/** Returns the type of the light.*/
LightType getLightType() const { return mLightType; }
/** Sets the type of the light.*/
void setLightType(LightType lightType) { mLightType = lightType; }
/** Returns the color of the light. Has only rgb values, no alpha.
Used by all light types.*/
const Color& getColor() const { return mColor; }
/** Returns the color of the light. Has only rgb values, no alpha.
Used by all light types.*/
Color& getColor() { return mColor; }
/** Sets the color of the light. Has only rgb values, no alpha.
Used by all light types.*/
void setColor(const Color& color) { mColor = color; }
/** Returns the constant coefficient in the attenuation formula.
Used by point and spot lights.*/
const AnimatableFloat& getConstantAttenuation() const { return mConstantAttenuation; }
/** Returns the constant coefficient in the attenuation formula.
Used by point and spot lights.*/
AnimatableFloat& getConstantAttenuation() { return mConstantAttenuation; }
/** Sets the constant coefficient in the attenuation formula.
Used by point and spot lights.*/
void setConstantAttenuation(double constantAttenuation) { mConstantAttenuation = constantAttenuation; }
/** Returns the linear coefficient in the attenuation formula.
Used by point and spot lights.*/
const AnimatableFloat& getLinearAttenuation() const { return mLinearAttenuation; }
/** Returns the linear coefficient in the attenuation formula.
Used by point and spot lights.*/
AnimatableFloat& getLinearAttenuation() { return mLinearAttenuation; }
/** Sets the linear coefficient in the attenuation formula.
Used by point and spot lights.*/
void setLinearAttenuation(double linearAttenuation) { mLinearAttenuation = linearAttenuation; }
/** Returns the quadratic coefficient in the attenuation formula.
Used by point and spot lights.*/
const AnimatableFloat& getQuadraticAttenuation() const { return mQuadraticAttenuation; }
/** Returns the quadratic coefficient in the attenuation formula.
Used by point and spot lights.*/
AnimatableFloat& getQuadraticAttenuation() { return mQuadraticAttenuation; }
/** Sets the quadratic coefficient in the attenuation formula.
Used by point and spot lights.*/
void setQuadraticAttenuation(double quadraticAttenuation) { mQuadraticAttenuation = quadraticAttenuation; }
/** Returns fall off angle.
Used by spot and lights.*/
const AnimatableFloat& getFallOffAngle() const { return mFallOffAngle; }
/** Returns fall off angle.
Used by spot and lights.*/
AnimatableFloat& getFallOffAngle() { return mFallOffAngle; }
/** Sets fall off angle.
Used by spot and lights.*/
void setFallOffAngle(double fallOffAngl) { mFallOffAngle = fallOffAngl; }
/** Returns fall off exponent.
Used by spot and lights.*/
const AnimatableFloat& getFallOffExponent() const { return mFallOffExponent; }
/** Returns fall off exponent.
Used by spot and lights.*/
AnimatableFloat& getFallOffExponent() { return mFallOffExponent; }
/** Sets fall off exponent.
Used by spot and lights.*/
void setFallOffExponent(double fallOffAngl) { mFallOffExponent = fallOffAngl; }
};
} // namespace COLLADAFW
#endif // __COLLADAFW_LIGHT_H__
|