Example #1
0
ccBBox ccSubMesh::getMyOwnBB()
{
	if (!m_bBox.isValid() && size() != 0)
	{
		refreshBB();
	}

	return m_bBox;
}
Example #2
0
ccBBox ccSubMesh::getOwnBB(bool withGLFeatures/*=false*/)
{
	//force BB refresh if necessary
	if (!m_bBox.isValid() && size() != 0)
	{
		refreshBB();
	}

	return m_bBox;
}
Example #3
0
void ccSubMesh::getBoundingBox(CCVector3& bbMin, CCVector3& bbMax)
{
	//force BB refresh if necessary
	if (!m_bBox.isValid() && size() != 0)
	{
		refreshBB();
	}

	bbMin = m_bBox.minCorner();
	bbMax = m_bBox.maxCorner();
}
Example #4
0
ccBBox ccSubMesh::getMyOwnBB()
{
	if (size() != 0)
	{
		if (   !m_bBox.isValid()
			|| getLastModificationTime() < m_associatedMesh->getLastModificationTime()
			|| (m_associatedMesh->getAssociatedCloud() && getLastModificationTime() < m_associatedMesh->getAssociatedCloud()->getLastModificationTime()) )
		{
			refreshBB();
		}
	}

	return m_bBox;
}
Example #5
0
/** Function for the basic terrain modifier tool: it is used to change terrain
 *  height around a point.
 *  \param tm It contains data about the modification, like radius, intensity
 */
void Terrain::modify(TerrainMod* tm)
{
    if (tm->type == HEIGHT_MOD)
    {
        if (!tm->left_click) tm->dh *= -1;

        m_fp_h = &Terrain::vertexHeight;
        callOnVertices(tm);
        if (!tm->left_click) tm->dh *= -1;
        recalculateNormals();
        highlight(tm);
        refreshBB();
        return;
    }
    else
        draw(*tm);
} // modify