|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.scenegraph.SceneGraphObject
org.xith3d.scenegraph.Node
org.xith3d.scenegraph.GroupNode
org.xith3d.scenegraph.Group
org.xith3d.scenegraph.TransformGroup
org.xith3d.schedops.movement.Bullet
public abstract class Bullet
This class can be used as a base for a bullet. Add it to the scheduler of an ExtRenderLoop by calling the method addScheduledOperation(bullet). It is automatically removed from its parent BranchGroup and the scheduler when maxLifetime has been reached.
| Field Summary |
|---|
| Fields inherited from class org.xith3d.scenegraph.GroupNode |
|---|
children, hostGroup, numChildren, totalNumChildren, totalNumShapes |
| Fields inherited from class org.xith3d.scenegraph.Node |
|---|
bounds, boundsAutoCompute, boundsDirty, globalIgnoreBounds, instanceBoundsTypeHint, transformGroup, untransformedBounds |
| Fields inherited from class org.xith3d.scenegraph.SceneGraphObject |
|---|
XITH3D_USERDATAKEY_OLDUSERDATA |
| Constructor Summary | |
|---|---|
Bullet(org.openmali.vecmath2.Vector3f velocity,
long maxLifeTime)
Creates a new Bullet. |
|
| Method Summary | |
|---|---|
long |
getLifeTime()
|
org.openmali.vecmath2.Tuple3f |
getLocation()
|
long |
getMaxLifeTime()
|
float |
getSpeed()
|
org.openmali.vecmath2.Vector3f |
getVelocity()
|
boolean |
isAlive()
if false, the object will be removed from the scheduler next loop iteration |
boolean |
isAnimating()
A Bullet's animation is always running until it is dead. |
boolean |
isPersistent()
A Bullet is always persistent until it is dead. |
void |
setAlive(boolean alive)
Sets this Object alive or dead. |
void |
setLocation(org.openmali.vecmath2.Tuple3f location)
Sets this Bullet's current location. |
void |
setMaxLifeTime(long maxLifeTime)
Sets the maximum time, this Bullet will be alive. |
void |
setSpeed(float speed)
Sets this Bullet's speed along its velocity vector. |
void |
setVelocity(org.openmali.vecmath2.Vector3f velocity)
Sets this bullet's velocity vector. |
void |
startAnimation(long gameTime,
UpdatingThread.TimingMode timingMode)
Starts the animation of this Bullet. |
void |
stopAnimation()
A Bullet's animation cannot be stopped. |
void |
update(long gameTime,
long frameTime,
UpdatingThread.TimingMode timingMode)
Updates this Updatable object. |
| Methods inherited from class org.xith3d.scenegraph.TransformGroup |
|---|
getLocalTransform, getLocalTransform, getPosition, getPosition, getTransform, getTransform, getWorldTransform, newInstance, onTransformChanged, setLocalTransform, setPosition, setPosition, setTransform, traverse, updateTransform |
| Methods inherited from class org.xith3d.scenegraph.Group |
|---|
moveTo |
| Methods inherited from class org.xith3d.scenegraph.SceneGraphObject |
|---|
getName, getUserData, getUserData, getUserDataMap, isLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.xith3d.scenegraph.Transformable |
|---|
getName, setName |
| Constructor Detail |
|---|
public Bullet(org.openmali.vecmath2.Vector3f velocity,
long maxLifeTime)
velocity - the velocity vector this bullet will move along. Its length is the speed.maxLifeTime - the maximum amount of milliseconds this bullet will remain in the scheduler.| Method Detail |
|---|
public boolean isAnimating()
isAnimating in interface Animatable
public void startAnimation(long gameTime,
UpdatingThread.TimingMode timingMode)
startAnimation in interface Animatablepublic void stopAnimation()
stopAnimation in interface AnimatablesetAlive(boolean)public boolean isPersistent()
isPersistent in interface ScheduledOperationpublic long getLifeTime()
public void setVelocity(org.openmali.vecmath2.Vector3f velocity)
velocity - the new velocity vectorpublic org.openmali.vecmath2.Vector3f getVelocity()
public void setLocation(org.openmali.vecmath2.Tuple3f location)
location - the new locationpublic org.openmali.vecmath2.Tuple3f getLocation()
public float getSpeed()
public void setSpeed(float speed)
speed - the new speed for this Bullet
public void update(long gameTime,
long frameTime,
UpdatingThread.TimingMode timingMode)
update in interface UpdatablegameTime - the gameTime in MillisecondsframeTime - the frameTime in Milliseconds (needed time for the last frame)timingMode - the TimingMode to use for frameTime.public void setMaxLifeTime(long maxLifeTime)
maxLifeTime - maximum life time in millisecondspublic long getMaxLifeTime()
public void setAlive(boolean alive)
setAlive in interface ScheduledOperationalive - if false, the object will be removed from the scheduler next loop iterationpublic boolean isAlive()
ScheduledOperation
isAlive in interface ScheduledOperation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||