| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com> | 2 * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
| 5 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> | 5 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> |
| 6 * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org> | 6 * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org> |
| 7 * Copyright (C) 2011 University of Szeged | 7 * Copyright (C) 2011 University of Szeged |
| 8 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> | 8 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> |
| 9 * | 9 * |
| 10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 lightStrength *= (paintingData.coneCutOffLimit - cosineOfAngle) / (paint
ingData.coneCutOffLimit - paintingData.coneFullLight); | 90 lightStrength *= (paintingData.coneCutOffLimit - cosineOfAngle) / (paint
ingData.coneCutOffLimit - paintingData.coneFullLight); |
| 91 | 91 |
| 92 if (lightStrength > 1.0f) | 92 if (lightStrength > 1.0f) |
| 93 lightStrength = 1.0f; | 93 lightStrength = 1.0f; |
| 94 | 94 |
| 95 paintingData.colorVector.setX(paintingData.privateColorVector.x() * lightStr
ength); | 95 paintingData.colorVector.setX(paintingData.privateColorVector.x() * lightStr
ength); |
| 96 paintingData.colorVector.setY(paintingData.privateColorVector.y() * lightStr
ength); | 96 paintingData.colorVector.setY(paintingData.privateColorVector.y() * lightStr
ength); |
| 97 paintingData.colorVector.setZ(paintingData.privateColorVector.z() * lightStr
ength); | 97 paintingData.colorVector.setZ(paintingData.privateColorVector.z() * lightStr
ength); |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool SpotLightSource::setX(float x) | 100 bool SpotLightSource::setPosition(const FloatPoint3D& position) |
| 101 { | 101 { |
| 102 if (m_position.x() == x) | 102 if (m_position == position) |
| 103 return false; | 103 return false; |
| 104 m_position.setX(x); | 104 m_position = position; |
| 105 return true; | 105 return true; |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool SpotLightSource::setY(float y) | 108 bool SpotLightSource::setPointsAt(const FloatPoint3D& direction) |
| 109 { | 109 { |
| 110 if (m_position.y() == y) | 110 if (m_direction == direction) |
| 111 return false; | 111 return false; |
| 112 m_position.setY(y); | 112 m_direction = direction; |
| 113 return true; | 113 return true; |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool SpotLightSource::setZ(float z) | |
| 117 { | |
| 118 if (m_position.z() == z) | |
| 119 return false; | |
| 120 m_position.setZ(z); | |
| 121 return true; | |
| 122 } | |
| 123 | |
| 124 bool SpotLightSource::setPointsAtX(float pointsAtX) | |
| 125 { | |
| 126 if (m_direction.x() == pointsAtX) | |
| 127 return false; | |
| 128 m_direction.setX(pointsAtX); | |
| 129 return true; | |
| 130 } | |
| 131 | |
| 132 bool SpotLightSource::setPointsAtY(float pointsAtY) | |
| 133 { | |
| 134 if (m_direction.y() == pointsAtY) | |
| 135 return false; | |
| 136 m_direction.setY(pointsAtY); | |
| 137 return true; | |
| 138 } | |
| 139 | |
| 140 bool SpotLightSource::setPointsAtZ(float pointsAtZ) | |
| 141 { | |
| 142 if (m_direction.z() == pointsAtZ) | |
| 143 return false; | |
| 144 m_direction.setZ(pointsAtZ); | |
| 145 return true; | |
| 146 } | |
| 147 | |
| 148 bool SpotLightSource::setSpecularExponent(float specularExponent) | 116 bool SpotLightSource::setSpecularExponent(float specularExponent) |
| 149 { | 117 { |
| 150 specularExponent = std::min(std::max(specularExponent, 1.0f), 128.0f); | 118 specularExponent = std::min(std::max(specularExponent, 1.0f), 128.0f); |
| 151 if (m_specularExponent == specularExponent) | 119 if (m_specularExponent == specularExponent) |
| 152 return false; | 120 return false; |
| 153 m_specularExponent = specularExponent; | 121 m_specularExponent = specularExponent; |
| 154 return true; | 122 return true; |
| 155 } | 123 } |
| 156 | 124 |
| 157 bool SpotLightSource::setLimitingConeAngle(float limitingConeAngle) | 125 bool SpotLightSource::setLimitingConeAngle(float limitingConeAngle) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 172 { | 140 { |
| 173 ts << "[type=SPOT-LIGHT] "; | 141 ts << "[type=SPOT-LIGHT] "; |
| 174 ts << "[position=\"" << position() << "\"]"; | 142 ts << "[position=\"" << position() << "\"]"; |
| 175 ts << "[direction=\"" << direction() << "\"]"; | 143 ts << "[direction=\"" << direction() << "\"]"; |
| 176 ts << "[specularExponent=\"" << specularExponent() << "\"]"; | 144 ts << "[specularExponent=\"" << specularExponent() << "\"]"; |
| 177 ts << "[limitingConeAngle=\"" << limitingConeAngle() << "\"]"; | 145 ts << "[limitingConeAngle=\"" << limitingConeAngle() << "\"]"; |
| 178 return ts; | 146 return ts; |
| 179 } | 147 } |
| 180 | 148 |
| 181 }; // namespace WebCore | 149 }; // namespace WebCore |
| OLD | NEW |