MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / UVOffset

Method UVOffset

engine/Poseidon/World/Simulation/Animation/Animation.cpp:1135–1165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1133 _origV[level][m] = tex->VToLogical(lShape->V(posI));
1134 }
1135 else
1136 {
1137 _origU[level][m] = 0;
1138 _origV[level][m] = 0;
1139 }
1140 m++;
1141 }
1142 }
1143 }
1144}
1145
1146void AnimationUV::UVOffset(LODShape* shape, float offsetU, float offsetV, int level) const
1147{
1148 if (_selection[level] < 0)
1149 {
1150 return;
1151 }
1152 Shape* lShape = shape->Level(level);
1153 PoseidonAssert(lShape);
1154 const FaceSelection& sel = lShape->NamedSel(_selection[level]).FaceOffsets(lShape);
1155 int m = 0;
1156 for (int i = 0; i < sel.Size(); i++)
1157 {
1158 const Poly& face = lShape->Face(sel[i]);
1159 const Texture* tex = face.GetTexture();
1160 for (int j = 0; j < face.N(); j++)
1161 {
1162 int posI = face.GetVertex(j);
1163 if (tex)
1164 {
1165 lShape->SetU(posI, tex->UToPhysical(_origU[level][m] + offsetU));
1166 lShape->SetV(posI, tex->VToPhysical(_origV[level][m] + offsetV));
1167 }
1168 else

Callers 2

AnimateTextureMethod · 0.80
AnimateMethod · 0.80

Calls 9

LevelMethod · 0.80
GetVertexMethod · 0.80
SizeMethod · 0.45
GetTextureMethod · 0.45
NMethod · 0.45
SetUMethod · 0.45
UToPhysicalMethod · 0.45
SetVMethod · 0.45
VToPhysicalMethod · 0.45

Tested by

no test coverage detected