|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpslib.GenericParticle
pslib.DynamicParticle
pslib.ParentParticle
pslib.OrbiterParticle
public class OrbiterParticle
Orbiter Class
The Orbiter object extends the ParentParticle functionality by incorporating orbit simulation. Object position is calculated from the accumulated gravities of surrounding Orbiter objects.
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 | |
---|---|
OrbiterParticle(float m)
Create a new object instance with the specified mass, default buffer size (1) and no decay |
|
OrbiterParticle(float m,
int b)
Create a new object instance with the specified mass and buffer size, and no decay |
|
OrbiterParticle(float m,
int b,
int d)
Create a new object instance with the specified mass, buffer size and decay |
Method Summary | |
---|---|
OrbiterParticle |
copy()
Return a copy of this particle |
void |
map(OrbiterParticle p)
Map the properties of this particle to that specified preserving references |
void |
setDamping(double d)
Set the gravitational constant |
void |
setMaxForce(float f)
Set the maximum force magnitude |
void |
setMaxVelocity(float v)
Set the maximum velocity magnitude |
void |
update(DynamicParticle[] pa)
Update the particle |
Methods inherited from class pslib.ParentParticle |
---|
activeParticles, attach, attach, attachedParticles, clear, debug, debug, getBufferSize, isDead, map, remove, render, render, setAlpha, setBufferSize, setColour, setColour, setColour, setColour, setPosition, setVelocity, toArray, update |
Methods inherited from class pslib.DynamicParticle |
---|
clearBehaviour, getBehaviour, getDecay, getDecayTime, getInitialDecayTime, getMass, getRenderAlpha, getRenderSize, getSnapshot, isDynamic, map, setAlphaEnvelope, setBehaviour, setBehaviour, setDecayTime, setMass, setSizeEnvelope |
Methods inherited from class pslib.GenericParticle |
---|
getAlpha, getColour, getPosition, getSize, getVelocity, setSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OrbiterParticle(float m)
m
- masspublic OrbiterParticle(float m, int b)
m
- massb
- buffer sizepublic OrbiterParticle(float m, int b, int d)
m
- massb
- buffer sized
- decay (ms)Method Detail |
---|
public final void setDamping(double d)
The gravitational constant is applied in gravitational force calculations
as G in F = G * (m1 * m2) / r
.
Default: 0.001
d
- force dampingpublic final void setMaxVelocity(float v)
If the specified value is greater than zero then the particle velocity vector will be limited in magnitude to prior to application. It should be noted that limiting the particle velocity vector may result in unpredictable simulation results.
Default 0.0
v
- maximum velocitypublic final void setMaxForce(float f)
If the specified value is greater than zero then the accumulated gravitational force vector will be limited in magnitude prior to application. It should be noted that limiting the maximum force magnitude may result in unpredictable simulation results.
Default 0.0
f
- maximum forcepublic void update(DynamicParticle[] pa)
Orbiter velocity is calculated by accumulating the gravitational forces of each element within the orbiter array.
pa
- orbiter arraypublic OrbiterParticle copy()
The returned particle will copy all of this objects variables and will
adhere to the rules defined in DynamicParticle.map()
.
copy
in class ParentParticle
DynamicParticle
public final void map(OrbiterParticle p)
The returned object takes a copy of all orbiter particle variables.
DynamicParticle variables are mapped based on the rules defined in
DynamicParticle.map()
.
p
- particleDynamicParticle
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |