本文整理汇总了C++中sf::Shape::getTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ Shape::getTransform方法的具体用法?C++ Shape::getTransform怎么用?C++ Shape::getTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sf::Shape
的用法示例。
在下文中一共展示了Shape::getTransform方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProjectOntoAxis
void ICollisionSystem::ProjectOntoAxis(const sf::Shape& theShape, const sf::Vector2f& theAxis, float& theMin, float& theMax)
{
sf::Vector2f anPoint=theShape.getTransform().transformPoint(theShape.getPoint(0));
GQE::Uint32 anPointCount=theShape.getPointCount();
theMin = (anPoint.x*theAxis.x+anPoint.y*theAxis.y);
theMax = theMin;
for (int j = 1; j<anPointCount; j++)
{
anPoint=theShape.getTransform().transformPoint(theShape.getPoint(j));
float Projection = (anPoint.x*theAxis.x+anPoint.y*theAxis.y);
if (Projection<theMin)
theMin=Projection;
if (Projection>theMax)
theMax=Projection;
}
}
示例2: OrientedBox
void TEALShow::OrientedBox( sf::Shape &s, sf::Color col)
{
AddTransformedRectanglePoints( s.getLocalBounds(), s.getTransform(), col );
}
示例3: collidesWith
bool TrackChunk::collidesWith(const sf::Shape &shape) const{
bg::model::ring<sf::Vector2f> ring;
for (std::size_t i=0; i<shape.getPointCount(); ++i)
bg::append(ring, shape.getTransform().transformPoint(shape.getPoint(i)));
return bg::intersects(ring, m_points);
}