MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / updateVertTexCoord

Method updateVertTexCoord

Source/Node/Sprite.cpp:201–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void Sprite::updateVertTexCoord() {
202 if (_texture) {
203 const bgfx::TextureInfo& info = _texture->getInfo();
204 float left = _textureRect.getX() / info.width;
205 float top = _textureRect.getY() / info.height;
206 float right = (_textureRect.getX() + _textureRect.getWidth()) / info.width;
207 float bottom = (_textureRect.getY() + _textureRect.getHeight()) / info.height;
208 _quad.rb.u = right;
209 _quad.rb.v = bottom;
210 _quad.lb.u = left;
211 _quad.lb.v = bottom;
212 _quad.lt.u = left;
213 _quad.lt.v = top;
214 _quad.rt.u = right;
215 _quad.rt.v = top;
216 }
217}
218
219void Sprite::updateVertPosition() {
220 float width = getWidth();

Callers

nothing calls this directly

Calls 5

getInfoMethod · 0.45
getXMethod · 0.45
getYMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected