MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Draw

Method Draw

Source/Engine/Level/Actors/AnimatedModel.cpp:1069–1111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1067}
1068
1069void AnimatedModel::Draw(RenderContext& renderContext)
1070{
1071 if (!SkinnedModel || !SkinnedModel->IsLoaded())
1072 return;
1073 if (renderContext.View.Pass == DrawPass::GlobalSDF)
1074 return;
1075 if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas)
1076 return; // Not supported
1077 ACTOR_GET_WORLD_MATRIX(this, view, world);
1078 GEOMETRY_DRAW_STATE_EVENT_BEGIN(_drawState, world);
1079
1080 _lastMinDstSqr = Math::Min(_lastMinDstSqr, Vector3::DistanceSquared(_transform.Translation, renderContext.View.WorldPosition));
1081 if (_skinningData.IsReady())
1082 {
1083 // Flush skinning data with GPU
1084 if (_skinningData.IsDirty())
1085 {
1086 RenderListExtension.Items.Add({ _skinningData.BoneMatrices, _skinningData.Data.Get(), _skinningData.Data.Count() });
1087 _skinningData.OnFlush();
1088 }
1089
1090 SkinnedMesh::DrawInfo draw;
1091 draw.Buffer = &Entries;
1092 draw.Skinning = &_skinningData;
1093 draw.World = &world;
1094 draw.DrawState = &_drawState;
1095 draw.Deformation = _deformation;
1096 PRAGMA_DISABLE_DEPRECATION_WARNINGS
1097 draw.DrawModes = DrawModes & renderContext.View.GetShadowsDrawPassMask(ShadowsMode);
1098 PRAGMA_ENABLE_DEPRECATION_WARNINGS
1099 draw.Bounds = _sphere;
1100 draw.Bounds.Center -= renderContext.View.Origin;
1101 draw.PerInstanceRandom = GetPerInstanceRandom();
1102 draw.LODBias = LODBias;
1103 draw.ForcedLOD = ForcedLOD;
1104 draw.SortOrder = SortOrder;
1105 draw.SetStencilValue(_layer);
1106
1107 SkinnedModel->Draw(renderContext, draw);
1108 }
1109
1110 GEOMETRY_DRAW_STATE_EVENT_END(_drawState, world);
1111}
1112
1113void AnimatedModel::Draw(RenderContextBatch& renderContextBatch)
1114{

Callers

nothing calls this directly

Calls 9

IsDirtyMethod · 0.80
MinFunction · 0.50
IsLoadedMethod · 0.45
IsReadyMethod · 0.45
AddMethod · 0.45
GetMethod · 0.45
CountMethod · 0.45
SetStencilValueMethod · 0.45
GetMainContextMethod · 0.45

Tested by

no test coverage detected