void GraphicalRobotElement::setCurrentWIM (WorldInfo nwim) { currentWIM.Clear(); if (teamColor == 1) { currentWIM = nwim; } else { WorldInfo MyWorld; MyWorld.Clear(); MyWorld.CopyFrom (nwim); float value = (-1) * MyWorld.myposition().x(); MyWorld.mutable_myposition()->set_x (value); value = (-1) * MyWorld.myposition().y(); MyWorld.mutable_myposition()->set_y (value); value = MyWorld.myposition().phi() + Pi; MyWorld.mutable_myposition()->set_phi (value); currentWIM = MyWorld; } if (LWSTraceVisible) { setLWSTraceVisible (false); updateTraceRect(); setLWSTraceVisible (true); } else { setLWSTraceVisible (false); updateTraceRect(); setLWSTraceVisible (false); } }
QRectF KFieldScene::visionBallRect (BallObject bob, WorldInfo wim) { float xmiddle = (wim.myposition().x() + bob.dist() * cos ( (wim.myposition().phi() + bob.bearing() ) ) ) * 1000; float ymiddle = (wim.myposition().y() + bob.dist() * sin ( (wim.myposition().phi() + bob.bearing() ) ) ) * 1000; return rectFromFC ( xmiddle, ymiddle, 75, 75); }