MCPcopy Create free account
hub / github.com/carbonengine/trinity / UpdateRtMesh

Method UpdateRtMesh

trinity/Raytracing/Tr2RaytracingGeometry.cpp:172–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172void Tr2RaytracingMesh::UpdateRtMesh( TriGeometryRes* geometry, uint32_t meshIndex, float screenSize )
173{
174 if( m_geometry != geometry || m_meshIndex != meshIndex )
175 {
176 //Geometry has changed, invalidate everything.
177 m_geometry = geometry;
178 m_meshIndex = meshIndex;
179 m_screenSize = screenSize;
180 if( m_geometry && m_geometry->IsGood() )
181 {
182 m_lodIndex = m_geometry->GetLodIndexForScreenSize( m_meshIndex, m_screenSize );
183 }
184 else
185 {
186 m_lodIndex = -1;
187 }
188
189 m_transforms.clear();
190
191 m_isDirty = true;
192 }
193 else if( m_screenSize != screenSize || m_lodIndex == -1 )
194 {
195 m_screenSize = screenSize;
196
197 //screen size has changed, so check if we've changed to a different LOD
198 auto lodIndex = -1;
199 if( m_geometry && m_geometry->IsGood() )
200 {
201 lodIndex = m_geometry->GetLodIndexForScreenSize( m_meshIndex, m_screenSize );
202 }
203
204 m_isDirty |= lodIndex != m_lodIndex;
205 m_lodIndex = lodIndex;
206 }
207}
208
209bool Tr2RaytracingMesh::SetBoneTransforms( size_t count, const Float4x3* transforms, uint32_t offset )
210{

Callers

nothing calls this directly

Calls 2

IsGoodMethod · 0.45

Tested by

no test coverage detected