如何获得一个nodejs个人博客的BoundingBox

sprite - coco2d getContentSize vs getBoundingBox - Stack Overflow
to customize your list.
Join the Stack Overflow Community
Stack Overflow is a community of 6.7 million programmers, just like you, helping each other.
J it only takes a minute:
I am new to cocos2d-x and I want to get the sprite size. But here are tow functions that do the work: getContentSize and getBoundingBox. What is the difference of this functions? Should I always usegetBoundingBox`?
56.6k15104199
14.5k43149257
contentSize refers to the size of the content (ie the texture size) whereas boundingBox also takes into account that the node may be rotated, scaled, skewed.
The bounding box is axis-aligned, which means it forms the rectangle that passes through all 4 corners of the node even when rotated, scaled, skewed, etc. and thus it may be larger than contentSize if any one of these properties has been modified.
However for collision detection of rotated, scaled, skewed, etc nodes the bounding box only provides an "early out" test where not intersecting the bounding box rectangle means there can not be any collision on a more accurate level anyway. If the axis-aligned bounding box intersection test passes you usually go on to perform, for example, an oriented bounding box rectangle intersection test or one where you do a collision mask or polygon intersection test.
56.6k15104199
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
rev .25083
Stack Overflow works best with JavaScript enabled}

我要回帖

更多关于 virtualbox哪个版本好 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信