|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.threed.jpct.util.LensFlare
A simple lens flare effect. You need four different textures for this, one burst and three halos. How to create/get these textures is up to you. jPCT doesn't come with any.
Constructor Summary | |
LensFlare(SimpleVector lightPos,
java.lang.String burst,
java.lang.String halo1,
java.lang.String halo2,
java.lang.String halo3)
Create a new lens flare for a light source. |
Method Summary | |
void |
render(FrameBuffer buffer)
Renders the effect. |
void |
setDirection(boolean lightToCam)
If hiding is enabled, the visibility calculations can be done camera->light (default) or light->camera. |
void |
setGlobalScale(float scale)
Sets the global scale of the effect. |
void |
setHiding(boolean hides)
If true (default), all geometry that is a potential collider hides the effect if it's located in a direct line between the camera and the light source. |
void |
setLightPosition(SimpleVector lightPos)
Sets a new light position. |
void |
setMaximumDistance(float distance)
If hiding is enabled, this value specifies how far away from the camera a polygon can maximally be to be considered as a blocker. |
void |
setTransparency(int trans)
Sets the transparency of the effect. |
void |
update(FrameBuffer buffer,
World world)
Updates the lens flare. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LensFlare(SimpleVector lightPos, java.lang.String burst, java.lang.String halo1, java.lang.String halo2, java.lang.String halo3)
lightPos
- the position of the light sourceburst
- the name of the burst texture as added to the TextureManagerhalo1
- the name of the first halo texture as added to the TextureManagerhalo2
- the name of the second halo as added to the TextureManagerhalo3
- the name of the third halo texture added to the TextureManagerMethod Detail |
public void setTransparency(int trans)
trans
- the transparency. 0 is lowest,public void setLightPosition(SimpleVector lightPos)
lightPos
- the new positionpublic void setGlobalScale(float scale)
scale
- the scalepublic void setHiding(boolean hides)
hides
- should geometry hide it or not?public void setMaximumDistance(float distance)
distance
- the distancepublic void setDirection(boolean lightToCam)
lightToCam
- do it light->camera or vice versapublic void update(FrameBuffer buffer, World world)
buffer
- the frame bufferworld
- the worldpublic void render(FrameBuffer buffer)
buffer
- the frame buffer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |