MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / RenderWallmark

Method RenderWallmark

ogsr_engine/Layers/xrRender/SkeletonCustom.cpp:836–922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

834}
835
836void CKinematics::RenderWallmark(intrusive_ptr<CSkeletonWallmark> wm, FVF::LIT*& V)
837{
838 VERIFY(wm);
839 VERIFY(V);
840 VERIFY(bones, "Invalid visual. Bones already released.");
841 VERIFY(bone_instances, "Invalid visual. bone_instances already deleted.");
842
843 if ((wm == nullptr) || (nullptr == bones) || (nullptr == bone_instances))
844 return;
845
846 ZoneScoped;
847
848 // skin vertices
849 for (u32 f_idx = 0; f_idx < wm->m_Faces.size(); f_idx++)
850 {
851 const CSkeletonWallmark::WMFace F = wm->m_Faces[f_idx];
852 const float w = (Device.fTimeGlobal - wm->TimeStart()) / ps_r__WallmarkTTL;
853 for (u32 k = 0; k < 3; k++)
854 {
855 Fvector P;
856 if (F.bone_id[k][0] == F.bone_id[k][1])
857 {
858 // 1-link
859 Fmatrix& xform0 = LL_GetBoneInstance(F.bone_id[k][0]).mRenderTransform;
860 xform0.transform_tiny(P, F.vert[k]);
861 }
862 else if (F.bone_id[k][1] == F.bone_id[k][2])
863 {
864 // 2-link
865 Fvector P0, P1;
866 Fmatrix& xform0 = LL_GetBoneInstance(F.bone_id[k][0]).mRenderTransform;
867 Fmatrix& xform1 = LL_GetBoneInstance(F.bone_id[k][1]).mRenderTransform;
868 xform0.transform_tiny(P0, F.vert[k]);
869 xform1.transform_tiny(P1, F.vert[k]);
870 P.lerp(P0, P1, F.weight[k][0]);
871 }
872 else if (F.bone_id[k][2] == F.bone_id[k][3])
873 {
874 // 3-link
875 Fvector P0, P1, P2;
876 Fmatrix& xform0 = LL_GetBoneInstance(F.bone_id[k][0]).mRenderTransform;
877 Fmatrix& xform1 = LL_GetBoneInstance(F.bone_id[k][1]).mRenderTransform;
878 Fmatrix& xform2 = LL_GetBoneInstance(F.bone_id[k][2]).mRenderTransform;
879 xform0.transform_tiny(P0, F.vert[k]);
880 xform1.transform_tiny(P1, F.vert[k]);
881 xform2.transform_tiny(P2, F.vert[k]);
882 const float w0 = F.weight[k][0];
883 const float w1 = F.weight[k][1];
884 P0.mul(w0);
885 P1.mul(w1);
886 P2.mul(1 - w0 - w1);
887 P = P0;
888 P.add(P1);
889 P.add(P2);
890 }
891 else
892 {
893 // 4-link

Callers 1

RenderMethod · 0.80

Calls 8

clampFunction · 0.85
color_rgbaFunction · 0.85
transform_tinyMethod · 0.80
sizeMethod · 0.45
lerpMethod · 0.45
mulMethod · 0.45
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected