예제 #1
0
void PointLight::PreDraw(X3DDrawContext* pDC)
{
	if (!getGlobal() && getOn())
	{
		SetLight(pDC);
	}
}
void CX3DDirectionalLightNode::print(int indent)
{
	FILE *fp = CX3DParser::getDebugLogFp();

	char *nodeName = getNodeName();
	if (nodeName)
	{
		float r, g, b;
		float x, y, z;

		CX3DParser::printIndent(indent);
		fprintf(fp, "%s (%s)\n", nodeName, CX3DNode::getNodeTypeString(getNodeType()));

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "ambientIntensity : (%f)\n", getAmbientIntensity()->getValue());

		getColor()->getValue(r, g, b);
		CX3DParser::printIndent(indent+1);
		fprintf(fp, "color : (%f %f %f)\n", r, g, b);

		getDirection()->getValue(x, y, z);
		CX3DParser::printIndent(indent+1);
		fprintf(fp, "direction : (%f %f %f)\n", x, y, z);

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "intensity : (%f)\n", getIntensity()->getValue());

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "on : %s\n", getOn()->getValue() ? "TRUE" : "FALSE");

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "global : %s\n", getGlobal()->getValue() ? "TRUE" : "FALSE");
	}
}
예제 #3
0
void PointLight::DrawGlobalLights(X3DDrawContext* pDC)
{
	if (getGlobal() && getOn())
	{
		SetLight(pDC);
	}
}
예제 #4
0
Action::ResultE DirectionalLight::renderLeave(Action *action)
{
    if(getOn() == false)
        return Action::Continue;

    return Light::renderLeave(action);
}
예제 #5
0
Action::ResultE PointLight::drawLeave(Action *action)
{
    if(getOn() == false)
        return Action::Continue;

    return Light::drawLeave(action);
}
예제 #6
0
Action::ResultE SpotLight::renderLeave(Action *action)
{
    if(getOn() == false)
        return Action::Continue;

    return PointLightBase::renderLeave(action);
}
예제 #7
0
Action::ResultE DirectionalLight::renderEnter(Action *action)
{
    if(getOn() == false)
        return Action::Continue;

    DrawActionBase *da    = dynamic_cast<DrawActionBase *>(action);
    da->getStatistics()->getElem(DirectionalLight::statNDirectionalLights)->inc();
    
    return Light::renderEnter(action);
}
예제 #8
0
Action::ResultE SpotLight::renderEnter(Action *action)
{
    if(getOn() == false)
        return Action::Continue;

    DrawActionBase *da    = dynamic_cast<DrawActionBase *>(action);

    if(da->getStatCollector() != NULL)
    {
        da->getStatCollector()->getElem(SpotLight::statNSpotLights)->inc();
    }

    return PointLight::renderEnter(action);
}
예제 #9
0
Action::ResultE PointLight::drawEnter(Action *action)
{   
    if(getOn() == false)
        return Action::Continue;

    DrawAction *da    = dynamic_cast<DrawAction *>(action);
    GLenum      light = GL_LIGHT0 + da->getLightCount();
    
    Light::drawEnter(action);

    Vec4f pos(_sfPosition.getValue());

    pos[3] = 1;

    glLightfv(light, GL_POSITION   , pos.getValues());
    glLightf (light, GL_SPOT_CUTOFF, 180.f          );

    glPopMatrix();

    da->getStatistics()->getElem(PointLight::statNPointLights)->inc();

    return Action::Continue;
}
예제 #10
0
Vector getDiffuse(ItemPtr item, Vector point) {
	if(item->type==CHECKER && !getOn((VectorAccess)point)) {
		return ZERO;
	}
	return item->surface.diffuse;
}