| 117 | } |
| 118 | |
| 119 | void Tr2Light::AddLight( Tr2LightManager& lightManager, CXMMATRIX transform, float scale, const Float4x3* bones, size_t boneCount ) |
| 120 | { |
| 121 | if( m_isDynamic ) |
| 122 | { |
| 123 | this->Update(); |
| 124 | } |
| 125 | |
| 126 | if( !Tr2LightManager::AreLightFlagsValid( m_lightData.flags ) ) |
| 127 | { |
| 128 | return; |
| 129 | } |
| 130 | |
| 131 | SetBoneMatrix( bones, boneCount ); |
| 132 | XMMATRIX lightTransform = XMMatrixMultiply( m_boneTransform, transform ); |
| 133 | LightFeatures features; |
| 134 | features.parentBrightness = m_brightnessMultiplier; |
| 135 | features.parentScale = scale; |
| 136 | |
| 137 | features.profileIndex = m_lightProfile ? m_lightProfile->GetTextureIndex() + 1 : 0; |
| 138 | |
| 139 | if( m_type == Tr2Light::POINT_LIGHT ) |
| 140 | { |
| 141 | auto data = m_lightData.AsPerPointLightData( lightTransform, features, lightManager.GetCurrentSpaceSceneShadowQuality() ); |
| 142 | lightManager.AddLight( data ); |
| 143 | } |
| 144 | else if( m_type == Tr2Light::SPOT_LIGHT ) |
| 145 | { |
| 146 | auto data = m_lightData.AsPerSpotLightData( lightTransform, features, lightManager.GetCurrentSpaceSceneShadowQuality() ); |
| 147 | lightManager.AddLight( data ); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | |
| 152 | void Tr2Light::GetLight( Vector3& position, float& radius, Color& color ) |
nothing calls this directly
no test coverage detected