//============================================================================== LightComponent::LightComponent(SceneNode* node, LightType type) : SceneComponent(CLASS_TYPE, node) , m_type(type) { setInnerAngle(toRad(45.0)); setOuterAngle(toRad(30.0)); m_radius = 1.0; }
SpotLight* SpotLight::create(const Vec3 &direction, const Vec3 &position, const Color3B &color, float innerAngle, float outerAngle, float range) { auto light = new (std::nothrow) SpotLight(); light->setRotationFromDirection(direction); light->setPosition3D(position); light->setColor(color); light->setInnerAngle(innerAngle); light->setOuterAngle(outerAngle); light->_range = range; light->autorelease(); return light; }