Esempio n. 1
0
MyPanel::MyPanel(string _name, float _x, float _y):
ControlBase(_name)
{
	type= CONTROL_TYPE_PANEL;
	setPos(_x, _y);
	setSize(30, 30);
	adjustVertices();
	setDefaultColors();
}
void StaticMesh::init( MeshBufferPtr mesh )
{
	size_t n_colors;
	size_t n_normals;
	m_lineWidth = 2.0;
	if(mesh)
	{
		m_faceNormals = 0;

		m_normals 			= mesh->getVertexNormalArray(n_normals);
		m_colors        	= mesh->getVertexColorArray(n_colors);
		m_vertices      	= mesh->getVertexArray(m_numVertices);
		m_faces       		= mesh->getFaceArray(m_numFaces);
		m_blackColors		= new unsigned char[ 3 * m_numVertices ];

		for ( size_t i = 0; i < 3 * m_numVertices; i++ ) 
		{
			m_blackColors[i] = 0;
		}

		m_finalized			= true;
		m_visible			= true;
		m_active			= true;

		m_renderMode = 0;
		m_renderMode    |= RenderSurfaces;
		m_renderMode    |= RenderTriangles;

		m_boundingBox = new BoundingBox<Vertex<float> >;

		if(!m_faceNormals)
		{
			interpolateNormals();
		} else
		{
			// cout << "Face normals: " << m_faceNormals << endl;
		}

		if(!m_colors)
		{
			setDefaultColors();
		}

		if(n_colors == 0)
		{
			m_colors = ucharArr( new unsigned char[3 * m_numVertices] );
			for( int i = 0; i < m_numVertices; ++i )
			{
				m_colors[3 * i] = 0;
				m_colors[3 * i + 1] = 255;
				m_colors[3 * i + 2] = 0;
			}
		}

	}
}
Esempio n. 3
0
SMRSimpleRenderer::SMRSimpleRenderer(SMRSkeleton * _squel) : SMRRenderer(_squel)
{
	// set default colors
	setDefaultColors();
}
Esempio n. 4
0
BaseJoint::BaseJoint() {
  setDefaultColors();
  setDefaultProperties();
  registerMouseEvents();
}
Esempio n. 5
0
BaseJoint::BaseJoint(){
	setDefaultColors();
	setDefaultProperties();
}