Example #1
0
bool Node::addChild(Node& child)
{
  if (isChildOf(child))
    return false;

  child.removeFromParent();

  m_children.push_back(&child);
  child.m_parent = this;
  child.setGraph(m_graph);
  child.invalidateWorldTransform();

  invalidateBounds();
  return true;
}
void CompactSubGeometry::updateData(float* data, int numVertices)
{
	if (m_autoDeriveVertexNormals)
		m_vertexNormalsDirty = true;

	if (m_autoDeriveVertexTangents)
		m_vertexTangentsDirty = true;

	m_faceNormalsDirty = true;
	m_faceTangentsDirty = true;

	m_vertexData = data;
	m_activeDataInvalid = true;

	if (numVertices != m_numVertices)
	{
		SAFE_DELETE(m_activeBuffer)
		m_numVertices = numVertices;
	}

	invalidateBounds();
}
Example #3
0
void SubGeometry::updateVertexData(float* vertices, int numVertices)
{
	if (m_autoDeriveVertexNormals)
		m_vertexNormalsDirty = true;

	if (m_autoDeriveVertexTangents)
		m_vertexTangentsDirty = true;

	m_faceNormalsDirty = true;
	m_vertexData = vertices;
	m_verticesInvalid = true;

	if (numVertices != m_numVertices)
	{
		SAFE_DELETE(m_vertexBuffer)
		SAFE_DELETE(m_vertexNormalBuffer)
		SAFE_DELETE(m_vertexTangentBuffer)
		SAFE_DELETE(m_uvBuffer)
		SAFE_DELETE(m_secondaryUVBuffer)
		m_numVertices = numVertices;
	}

	invalidateBounds();
}
Example #4
0
void Node::setLocalBounds(const Sphere& newBounds)
{
  m_localBounds = newBounds;
  invalidateBounds();
}