com.jme3.cinematic.events
クラス MotionTrack

java.lang.Object
  上位を拡張 com.jme3.cinematic.events.AbstractCinematicEvent
      上位を拡張 com.jme3.cinematic.events.MotionTrack
すべての実装されたインタフェース:
CinematicEvent, Savable, Control

public class MotionTrack
extends AbstractCinematicEvent
implements Control

A MotionTrack is a control over the spatial that manage the position and direction of the spatial while following a motion Path You must first create a MotionPath and then create a MotionTrack to associate a spatial and the path.


入れ子のクラスの概要
static class MotionTrack.Direction
          Enum for the different type of target direction behavior
 
コンストラクタの概要
MotionTrack()
          Create MotionTrack, when using this constructor don't forget to assign spatial and path
MotionTrack(Spatial spatial, MotionPath path)
          Creates a MotionPath for the given spatial on the given motion path
MotionTrack(Spatial spatial, MotionPath path, float initialDuration)
          Creates a MotionPath for the given spatial on the given motion path
MotionTrack(Spatial spatial, MotionPath path, float initialDuration, LoopMode loopMode)
          Creates a MotionPath for the given spatial on the given motion path
MotionTrack(Spatial spatial, MotionPath path, LoopMode loopMode)
          Creates a MotionPath for the given spatial on the given motion path
 
メソッドの概要
 Control cloneForSpatial(Spatial spatial)
          Clone this control for the given spatial
 float getCurrentValue()
          this method is meant to be called by the motion path only
 int getCurrentWayPoint()
          this method is meant to be called by the motion path only
 Vector3f getDirection()
          returns the direction the spatial is moving
 MotionTrack.Direction getDirectionType()
          returns the direction type of the target
 MotionPath getPath()
          retun the motion path this control follows
 Quaternion getRotation()
          returns the rotation of the target
 Spatial getSpatial()
           
 void initEvent(Application app, Cinematic cinematic)
           
 boolean isEnabled()
           
 boolean needsDirection()
          this method is meant to be called by the motion path only
 void onPause()
           
 void onPlay()
           
 void onStop()
           
 void onUpdate(float tpf)
           
 void read(JmeImporter im)
           
 void render(RenderManager rm, ViewPort vp)
          Should be called prior to queuing the spatial by the RenderManager.
 void setCurrentValue(float currentValue)
          this method is meant to be called by the motion path only
 void setCurrentWayPoint(int currentWayPoint)
          this method is meant to be called by the motion path only
 void setDirection(Vector3f direction)
          Sets the direction of the spatial This method is used by the motion path.
 void setDirectionType(MotionTrack.Direction directionType)
          Sets the direction type of the target On each update the direction given to the target can have different behavior See the Direction Enum for explanations
 void setEnabled(boolean enabled)
           
 void setLookAt(Vector3f lookAt, Vector3f upVector)
          Set the lookAt for the target This can be used only if direction Type is Direction.LookAt
 void setPath(MotionPath path)
          Sets the motion path to follow
 void setRotation(Quaternion rotation)
          sets the rotation of the target This can be used only if direction Type is Direction.PathAndRotation or Direction.Rotation With PathAndRotation the target will face the direction of the path multiplied by the given Quaternion.
 void setSpatial(Spatial spatial)
           
 void update(float tpf)
          Updates the control.
 void write(JmeExporter ex)
           
 
クラス com.jme3.cinematic.events.AbstractCinematicEvent から継承されたメソッド
addListener, getDuration, getInitalDuration, getInitialDuration, getLoopMode, getPlayState, getSpeed, internalUpdate, pause, play, removeListener, setInitalDuration, setInitialDuration, setLoopMode, setSpeed, stop
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

MotionTrack

public MotionTrack()
Create MotionTrack, when using this constructor don't forget to assign spatial and path


MotionTrack

public MotionTrack(Spatial spatial,
                   MotionPath path)
Creates a MotionPath for the given spatial on the given motion path

パラメータ:
spatial -
path -

MotionTrack

public MotionTrack(Spatial spatial,
                   MotionPath path,
                   float initialDuration)
Creates a MotionPath for the given spatial on the given motion path

パラメータ:
spatial -
path -

MotionTrack

public MotionTrack(Spatial spatial,
                   MotionPath path,
                   LoopMode loopMode)
Creates a MotionPath for the given spatial on the given motion path

パラメータ:
spatial -
path -

MotionTrack

public MotionTrack(Spatial spatial,
                   MotionPath path,
                   float initialDuration,
                   LoopMode loopMode)
Creates a MotionPath for the given spatial on the given motion path

パラメータ:
spatial -
path -
メソッドの詳細

update

public void update(float tpf)
インタフェース Control の記述:
Updates the control. This should not be called from user code.

定義:
インタフェース Control 内の update
パラメータ:
tpf - Time per frame.

initEvent

public void initEvent(Application app,
                      Cinematic cinematic)
定義:
インタフェース CinematicEvent 内の initEvent
オーバーライド:
クラス AbstractCinematicEvent 内の initEvent

onUpdate

public void onUpdate(float tpf)
定義:
クラス AbstractCinematicEvent 内の onUpdate

write

public void write(JmeExporter ex)
           throws java.io.IOException
定義:
インタフェース Savable 内の write
オーバーライド:
クラス AbstractCinematicEvent 内の write
例外:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
定義:
インタフェース Savable 内の read
オーバーライド:
クラス AbstractCinematicEvent 内の read
例外:
java.io.IOException

needsDirection

public boolean needsDirection()
this method is meant to be called by the motion path only

戻り値:

cloneForSpatial

public Control cloneForSpatial(Spatial spatial)
Clone this control for the given spatial

定義:
インタフェース Control 内の cloneForSpatial
パラメータ:
spatial -
戻り値:

onPlay

public void onPlay()
定義:
クラス AbstractCinematicEvent 内の onPlay

onStop

public void onStop()
定義:
クラス AbstractCinematicEvent 内の onStop

onPause

public void onPause()
定義:
クラス AbstractCinematicEvent 内の onPause

getCurrentValue

public float getCurrentValue()
this method is meant to be called by the motion path only

戻り値:

setCurrentValue

public void setCurrentValue(float currentValue)
this method is meant to be called by the motion path only


getCurrentWayPoint

public int getCurrentWayPoint()
this method is meant to be called by the motion path only

戻り値:

setCurrentWayPoint

public void setCurrentWayPoint(int currentWayPoint)
this method is meant to be called by the motion path only


getDirection

public Vector3f getDirection()
returns the direction the spatial is moving

戻り値:

setDirection

public void setDirection(Vector3f direction)
Sets the direction of the spatial This method is used by the motion path.

パラメータ:
direction -

getDirectionType

public MotionTrack.Direction getDirectionType()
returns the direction type of the target

戻り値:
the direction type

setDirectionType

public void setDirectionType(MotionTrack.Direction directionType)
Sets the direction type of the target On each update the direction given to the target can have different behavior See the Direction Enum for explanations

パラメータ:
directionType - the direction type

setLookAt

public void setLookAt(Vector3f lookAt,
                      Vector3f upVector)
Set the lookAt for the target This can be used only if direction Type is Direction.LookAt

パラメータ:
lookAt - the position to look at
upVector - the up vector

getRotation

public Quaternion getRotation()
returns the rotation of the target

戻り値:
the rotation quaternion

setRotation

public void setRotation(Quaternion rotation)
sets the rotation of the target This can be used only if direction Type is Direction.PathAndRotation or Direction.Rotation With PathAndRotation the target will face the direction of the path multiplied by the given Quaternion. With Rotation the rotation of the target will be set with the given Quaternion.

パラメータ:
rotation - the rotation quaternion

getPath

public MotionPath getPath()
retun the motion path this control follows

戻り値:

setPath

public void setPath(MotionPath path)
Sets the motion path to follow

パラメータ:
path -

setEnabled

public void setEnabled(boolean enabled)
定義:
インタフェース Control 内の setEnabled
パラメータ:
enabled - Enable or disable the control. If disabled, update() should do nothing.

isEnabled

public boolean isEnabled()
定義:
インタフェース Control 内の isEnabled
戻り値:
True if enabled, false otherwise.
関連項目:
Control.setEnabled(boolean)

render

public void render(RenderManager rm,
                   ViewPort vp)
インタフェース Control の記述:
Should be called prior to queuing the spatial by the RenderManager. This should not be called from user code.

定義:
インタフェース Control 内の render

setSpatial

public void setSpatial(Spatial spatial)
定義:
インタフェース Control 内の setSpatial
パラメータ:
spatial - the spatial to be controlled. This should not be called from user code.

getSpatial

public Spatial getSpatial()