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

Method UpdateInfo

engine/Poseidon/UI/Controls/UIControlsBase.cpp:163–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161 _w = cls >> "w";
162 _h = cls >> "h";
163}
164
165void Control::Move(float dx, float dy)
166{
167 _x += dx;
168 _y += dy;
169}
170
171DrawCoord SceneToScreen(Vector3Par pos);
172
173void Control::UpdateInfo(ControlObject* object, ControlInObject& info)
174{
175 Vector3 posTL = object->PositionModelToWorld(info.posTL);
176 Vector3 posBR = object->PositionModelToWorld(info.posBR);
177 Vector3Val position = object->Position();
178 Vector3Val posBase = object->GetBasePosition();
179
180 float dz = 0.5 * (posTL.Z() + posBR.Z() - 2.0 * position.Z());
181 float scale = (posBase.Z() + dz) / (position.Z() + dz);
182

Callers 3

LoadControlMethod · 0.45
SetPositionMethod · 0.45
OnDrawMethod · 0.45

Calls 7

SceneToScreenFunction · 0.85
PositionModelToWorldMethod · 0.80
GetBasePositionMethod · 0.80
PositionMethod · 0.45
ZMethod · 0.45
SetPosMethod · 0.45
SetScaleMethod · 0.45

Tested by

no test coverage detected