当前位置: 首页>>代码示例>>C++>>正文


C++ sphere::getRadius方法代码示例

本文整理汇总了C++中sphere::getRadius方法的典型用法代码示例。如果您正苦于以下问题:C++ sphere::getRadius方法的具体用法?C++ sphere::getRadius怎么用?C++ sphere::getRadius使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sphere的用法示例。


在下文中一共展示了sphere::getRadius方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: intersect

        //! Intersect with a sphere, returning true if there is an intersection.
        bool intersect(const sphere<Type>& s) const
        {
            const Type d1 = (s.getCenter() - m_center).sqrLength();
            const Type d2 = m_radius + s.getRadius();

            return (d1 < d2 * d2);
        }
开发者ID:mojocorp,项目名称:gtl,代码行数:8,代码来源:sphere.hpp

示例2: sphere

sphere sphere::operator +(const sphere& other) const
{
	glm::vec4 center = (c + other.getCenter()) * 0.5f;

	float radius = glm::distance(c, center) + glm::max(r, other.getRadius());

	return sphere(center, radius);
}
开发者ID:EddyGun,项目名称:Vulkan,代码行数:8,代码来源:sphere.cpp

示例3: extendBy

        //! Extend the boundaries of the sphere by the given sphere.
        void extendBy(const sphere<Type>& sphere)
        {
            if (intersect(sphere))
                return;

            const vec3<Type> dir = (m_center - sphere.getCenter()).normalized();
            const vec3<Type> p1 = m_center + m_radius * dir;
            const vec3<Type> p2 = sphere.getCenter() - sphere.getRadius() * dir;

            setPoles(p1, p2);
        }
开发者ID:mojocorp,项目名称:gtl,代码行数:12,代码来源:sphere.hpp

示例4: isVisible

VkBool32 frustum::isVisible(const sphere& sphereWorld) const
{
	float distance;

	for (auto& currentSide : sidesWorld)
	{
		distance = currentSide.distance(sphereWorld.getCenter());

		if (distance + sphereWorld.getRadius() < 0.0f)
		{
			return VK_FALSE;
		}
	}

	return VK_TRUE;
}
开发者ID:YoutaVen,项目名称:Vulkan,代码行数:16,代码来源:frustum.cpp

示例5: distance

float sphere::distance(const sphere& sphere) const
{
	return glm::abs(glm::distance(c, sphere.getCenter())) - r - sphere.getRadius();
}
开发者ID:EddyGun,项目名称:Vulkan,代码行数:4,代码来源:sphere.cpp


注:本文中的sphere::getRadius方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。