Example #1
0
	void PointCloud::UpdatePropertyList(const PropertyList& i_properties )
	{
		Object::UpdatePropertyList( i_properties ); //update the parent properties
		//update the child properties

		// Binds the correct shader before updating :
		LowLevelGraphics::LowLevelAPI::BindShaders(GetMaterial()->GetShaderList());

		const Property* xMin = i_properties.GetProperty(POINTCLOUD_XMIN_NAME);
		if (xMin)
		{
			xMin->GetValue(m_xMin);
			GetMaterial()->GetShaderList()->GetShaderProgram()->UpdateShaderParameterWithName("xMin", &m_xMin, SHADER_FLOAT);
		}
		const Property* xMax = i_properties.GetProperty(POINTCLOUD_XMAX_NAME);
		if (xMax)
		{
			xMax->GetValue(m_xMax);
			GetMaterial()->GetShaderList()->GetShaderProgram()->UpdateShaderParameterWithName("xMax", &m_xMax, SHADER_FLOAT);
		}
		const Property* yMin = i_properties.GetProperty(POINTCLOUD_YMIN_NAME);
		if (yMin)
		{
			yMin->GetValue(m_yMin);
			GetMaterial()->GetShaderList()->GetShaderProgram()->UpdateShaderParameterWithName("yMin", &m_yMin, SHADER_FLOAT);
		}
		const Property* yMax = i_properties.GetProperty(POINTCLOUD_YMAX_NAME);
		if (yMax)
		{
			yMax->GetValue(m_yMax);
			GetMaterial()->GetShaderList()->GetShaderProgram()->UpdateShaderParameterWithName("yMax", &m_yMax, SHADER_FLOAT);
		}
		const Property* zMin = i_properties.GetProperty(POINTCLOUD_ZMIN_NAME);
		if (zMin)
		{
			zMin->GetValue(m_zMin);
			GetMaterial()->GetShaderList()->GetShaderProgram()->UpdateShaderParameterWithName("zMin", &m_zMin, SHADER_FLOAT);
		}
		const Property* zMax = i_properties.GetProperty(POINTCLOUD_ZMAX_NAME);
		if (zMax)
		{
			zMax->GetValue(m_zMax);
			GetMaterial()->GetShaderList()->GetShaderProgram()->UpdateShaderParameterWithName("zMax", &m_zMax, SHADER_FLOAT);
		}

		const Property* distanceViewPlane = i_properties.GetProperty(POINTCLOUD_DISTANCEVIEWPLANE_NAME);
		if (distanceViewPlane)
		{
			distanceViewPlane->GetValue(m_distanceViewPlane);
			GetMaterial()->GetShaderList()->GetShaderProgram()->UpdateShaderParameterWithName("distanceViewPlane", &m_distanceViewPlane, SHADER_FLOAT);
		}

		const Property* contraction = i_properties.GetProperty(POINTCLOUD_DISTANCESHELLSPHERE_NAME);
		if (contraction)
		{
			contraction->GetValue(m_distanceShellSphere);
			GetMaterial()->GetShaderList()->GetShaderProgram()->UpdateShaderParameterWithName("distanceShellSphere", &m_distanceShellSphere, SHADER_FLOAT);
		}
	}
Example #2
0
void PointLight::UpdatePropertyList( const PropertyList& i_properties )
{
	const Property* name = i_properties.GetProperty(COMP_PROP_NAME);
	if ( name )
	{
		name->GetValue(m_name);
	}
	const Property* position = i_properties.GetProperty(COMP_PROP_POSITION);
	if ( position )
	{
		glm::vec3 newPos;
		position->GetValue(newPos);
		m_transform.SetTranslate(newPos);
		Update();
	}
}