// Sets the name of the mesh if needed and marks the bounding volume as dirty. void CC3MeshNode::setMesh( CC3Mesh * aMesh ) { if (aMesh == _mesh) return; CC_SAFE_RELEASE( _mesh ); CC_SAFE_RETAIN( aMesh ); _mesh = aMesh; if ( _mesh ) _mesh->deriveNameFrom( this ); alignMaterialAndMesh(); markBoundingVolumeDirty(); }
void CC3TouchBox::populateBox( const CC3Box& aBox ) { CC3Mesh* mesh = prepareParametricMesh(); // Now update the vertex locations with the box data GLuint vIdx = 0; CC3Vector bbMin = aBox.minimum; CC3Vector bbMax = aBox.maximum; mesh->setVertexLocation( cc3v(bbMin.x, bbMin.y, bbMin.z), vIdx++ ); mesh->setVertexLocation( cc3v(bbMin.x, bbMin.y, bbMax.z), vIdx++ ); mesh->setVertexLocation( cc3v(bbMin.x, bbMax.y, bbMin.z), vIdx++ ); mesh->setVertexLocation( cc3v(bbMin.x, bbMax.y, bbMax.z), vIdx++ ); mesh->setVertexLocation( cc3v(bbMax.x, bbMin.y, bbMin.z), vIdx++ ); mesh->setVertexLocation( cc3v(bbMax.x, bbMin.y, bbMax.z), vIdx++ ); mesh->setVertexLocation( cc3v(bbMax.x, bbMax.y, bbMin.z), vIdx++ ); mesh->setVertexLocation( cc3v(bbMax.x, bbMax.y, bbMax.z), vIdx++ ); mesh->updateVertexLocationsGLBuffer(); markBoundingVolumeDirty(); }
void CC3MeshNode::setVertexHomogeneousLocation( const CC3Vector4& aLocation, GLuint index ) { _mesh->setVertexHomogeneousLocation( aLocation, index ); markBoundingVolumeDirty(); }
void CC3MeshNode::moveMeshOriginToCenterOfGeometry() { _mesh->moveMeshOriginToCenterOfGeometry(); markBoundingVolumeDirty(); }
void CC3MeshNode::moveMeshOriginTo( const CC3Vector& aLocation ) { _mesh->moveMeshOriginTo( aLocation ); markBoundingVolumeDirty(); }