|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpslib.GenericParticle
pslib.DynamicParticle
pslib.ImageParticle
public class ImageParticle
ImageParticle Class
The ImageParticle object allows an image to be rendered as a billboard within 3D space. By default the object exhibits the usual billboard behaviour; orienting itself towards the camera. Alternatively the particle may exhibit directional behaviour; orienting itself to its current velocity vector. Additionally, rotation and rotation increment may be specified.
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 3 of the License, or (at your option) 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, see http://www.gnu.org/licenses/.
Field Summary |
---|
Fields inherited from interface pslib.PSConstants |
---|
CAM2D_LOOK, CAM2D_RIGHT, CAM2D_UP, CORNER, INVERSE, INVERSE_TRIANGULAR, LEADING, LINEAR, MIDPOINT, NONE, STATIC, TRAILING, TRIANGULAR |
Constructor Summary | |
---|---|
ImageParticle(processing.core.PImage t)
Create a new object instance with the specified texture |
|
ImageParticle(processing.core.PImage t,
int d)
Create a new object instance with the specified texture and decay time |
Method Summary | |
---|---|
DynamicParticle |
copy()
Return a copy of this particle |
processing.core.PImage |
getTexture()
Return a reference to the particle image |
void |
render(processing.opengl.PGraphicsOpenGL glc)
Render the particle to the specified renderer |
void |
render(processing.opengl.PGraphicsOpenGL glc,
PSVector cpv,
PSVector ctv,
PSVector cuv)
Render the particle to the specified renderer |
void |
setDirectional(boolean b)
Set directional behaviour for the billboard |
void |
setRotation(float r)
Set the image rotation in radians |
void |
setRotationIncrement(float i)
Set the rotation increment in radians |
void |
setTexture(processing.core.PImage t)
Set the particle image |
Methods inherited from class pslib.DynamicParticle |
---|
clearBehaviour, debug, debug, getBehaviour, getDecay, getDecayTime, getInitialDecayTime, getMass, getRenderAlpha, getRenderSize, getSnapshot, isDead, isDynamic, map, setAlphaEnvelope, setBehaviour, setBehaviour, setDecayTime, setMass, setSizeEnvelope, update |
Methods inherited from class pslib.GenericParticle |
---|
getAlpha, getColour, getPosition, getSize, getVelocity, setAlpha, setColour, setColour, setPosition, setSize, setVelocity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageParticle(processing.core.PImage t)
t
- texturepublic ImageParticle(processing.core.PImage t, int d)
t
- textured
- decay time (ms)Method Detail |
---|
public final void setTexture(processing.core.PImage t)
t
- texturepublic final processing.core.PImage getTexture()
public final void setDirectional(boolean b)
b
- true = directional, false = staticpublic final void setRotation(float r)
Rotation occurs around the axis defined by difference between particle and camera locations or around the z-axis if the camera location is unspecified.
r
- rotationpublic final void setRotationIncrement(float i)
The rotation increment is applied to the image rotation on each call to render() and offers a crude mechanism for automatic rotation.
i
- incrementpublic void render(processing.opengl.PGraphicsOpenGL glc)
render
in class DynamicParticle
glc
- OpenGL rendererpublic void render(processing.opengl.PGraphicsOpenGL glc, PSVector cpv, PSVector ctv, PSVector cuv)
render
in class DynamicParticle
glc
- OpenGL renderercpv
- camera position vectorctv
- camera target vectorcuv
- camera up vectorpublic DynamicParticle copy()
The returned copy will use a reference to the texture image of the source particle and take copies of the rotation, rotation increment and directional variables. The returned object will adhere to the rules defined in the DynamicParticle map() function.
copy
in class DynamicParticle
DynamicParticle
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |