📄 light.java
字号:
/* Ogre4J
Copyright (C) 2002 macross
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.ogre4j;
import org.ogre4j.math.Vector3;
/**
* Light
*
* @author Ivica Aracic <ivica.aracic@bytelords.de>
*/
public class Light extends NativeObject implements MovableObject {
public native String getName();
public native void setType(int type);
public native int getType();
public native void setDiffuseColour(float red, float green, float blue);
public native void setDiffuseColour(ColourValue colour);
public native ColourValue getDiffuseColour();
public native void setSpecularColour(float red, float green, float blue);
public native void setSpecularColour(ColourValue colour);
public native ColourValue getSpecularColour();
public native void setAttenuation(float range, float ant, float linear, float quadratic);
public void setAttenuationRange(float range) {
setAttenuation(range, getAttenuationConstant(), getAttenuationLinear(), getAttenuationQuadric());
}
public void setAttenuationConstant(float constant) {
setAttenuation(getAttenuationRange(), constant, getAttenuationLinear(), getAttenuationQuadric());
}
public void setAttenuationLinear(float linear) {
setAttenuation(getAttenuationRange(), getAttenuationConstant(), linear, getAttenuationQuadric());
}
public void setAttenuationQuadric(float quadratic) {
setAttenuation(getAttenuationRange(), getAttenuationConstant(), getAttenuationLinear(), quadratic);
}
public native float getAttenuationRange();
public native float getAttenuationConstant();
public native float getAttenuationLinear();
public native float getAttenuationQuadric();
public native void setPosition(float x, float y, float z);
public native void setPosition(Vector3 vec);
public native Vector3 getPosition();
public native void setDirection(float x, float y, float z);
public native void setDirection(Vector3 vec);
public native Vector3 getDirection();
public void setSpotlightRange(float innerAngle, float outerAngle) {
setSpotlightRange(innerAngle, outerAngle, 1.0f);
}
public native void setSpotlightRange(float innerAngle, float outerAngle, float falloff);
public void setSpotlightInnerAngle(float innerAngle) {
setSpotlightRange(innerAngle, getSpotlightOuterAngle(), getSpotlightFalloff());
}
public void setSpotlightOuterAngle(float outerAngle) {
setSpotlightRange(getSpotlightInnerAngle(), outerAngle, getSpotlightFalloff());
}
public void setSpotlightFalloff(float falloff) {
setSpotlightRange(getSpotlightInnerAngle(), getSpotlightOuterAngle(), falloff);
}
public native float getSpotlightInnerAngle();
public native float getSpotlightOuterAngle();
public native float getSpotlightFalloff();
public native Vector3 getDerivedPosition();
public native Vector3 getDerivedDirection();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -