119{
121
122
124
125
127 {
128 if ( TSceneObject* pSceneObject = pGlowObject->m_pSceneObject )
129 {
130
131 TModelInstance* pModelInstance = pSceneObject->GetInstance();
132
133 if ( !pModelInstance )
134 continue;
135
137
138
139 TMatrix44 oBoneTransform;
141
142
143 TMatrix44 oLightTransform;
144 pSceneObject->GetTransform().GetLocalMatrixImp( oLightTransform );
145
146
147 oLightTransform.
Multiply( oBoneTransform );
148
149
152
155
156
157 oLightTransform.
Multiply( pGlowObject->m_oTransform );
158
159 switch ( pGlowObject->m_eTransformType )
160 {
161 case -3:
162 oLightTransform.
Scale( -1.0f, -1.0f, -1.0f );
163 break;
164 case -2:
165 oLightTransform.
Scale( -1.0f, -1.0f, -1.0f );
166 case 1:
169 break;
170 case -1:
171 oLightTransform.
Scale( -1.0f, -1.0f, -1.0f );
174 break;
175 case 0:
178 break;
179 }
180
181
183 pGlowObject->Setup( oLightTransform, pGlowObject->m_oViewportParams, pGlowObject->m_oProjectionParams, pGlowObject->m_eCameraMode );
184
185
186 pRenderContext->
AddLight( pGlowObject->m_iID );
187 }
188 else
189 {
190
191 TVector4 vLightDir( 1.0f, -1.1f, 0.0f );
192 vLightDir.Normalise();
193 vLightDir.Negate3();
194
195 TQuaternion qLightRot;
197
198 TVector4 vLightPos = vLightDir;
200 vLightPos *= 100.0f;
201
202 TMatrix44 oMVP(
203 1.0f, 0.0f, 0.0f, 0.0f,
204 0.0f, 0.0f, 1.0f, 0.0f,
205 0.0f, -1.0f, 0.0f, 0.0f,
206 0.0f, 0.0f, 0.0f, 1.0f
207 );
208
210 pGlowObject->m_oMVP = oMVP;
211 }
212 }
213}
static constexpr void TransformVector(TVector3 &a_rOutVector, const TMatrix44 &a_rMatrix, const TVector3 &a_rVector)
constexpr void Scale(TFLOAT a_fScalar1, TFLOAT a_fScalar2, TFLOAT a_fScalar3)
const TVector4 & AsBasisVector4(BASISVECTOR a_iIndex) const
void Multiply(const TMatrix44 &a_rLeft, const TMatrix44 &a_rRight)
void SetVectorDirection(const TVector3 &a_rVec3, const TVector3 &a_rVec3_2)
static constinit const TVector3 VEC_POSZ
constexpr void Negate4(const TVector4 &vec)
static void Swap(TVector4 &a_rVec1, TVector4 &a_rVec2)
constexpr void Negate3(const TVector4 &vec)
TSkeletonInstance * GetSkeletonInstance() const
void AddLight(TLightID a_iLightId)
TRenderContext * GetCurrentContext() const
const TMatrix44 & GetBoneTransformCurrent(TINT a_iBone)
static TFORCEINLINE TRenderInterface * GetSingleton()