feud.testgame.model
Class LocalPlayerObject

java.lang.Object
  extended byfeud.testgame.model.LocalObject
      extended byfeud.testgame.model.LocalPlayerObject

public class LocalPlayerObject
extends LocalObject

A local object that holds a player's data.


Constructor Summary
LocalPlayerObject()
           
 
Method Summary
 void activate()
          Activate a player.
 void alignCamera(com.threed.jpct.Camera camera)
          Align the camera to the player.
 void deactivate()
          Deactivate a player.
 long deadSince()
          Is the player is dead, here's since how long...
 com.threed.jpct.Matrix getViewRotation()
          Gets the "view rotation".
 boolean isActive()
          Is the player active.
 boolean isDead()
          Is the player dead?
 boolean move(com.threed.jpct.World world, KeyStates keys, MouseMapper mouse, long ticks)
          Move the player according to key and mouse input.
 void setAlive()
          Flag the player as alive.
 void setDead()
          Flag the player as dead.
 void setViewRotation(com.threed.jpct.Matrix mat)
          Sets the "view rotation".
 
Methods inherited from class feud.testgame.model.LocalObject
addToValue, copyFrom, equals, getAnimation, getAnimationSpeed, getClientID, getObjectID, getPosition, getRotation, getSpeed, getType, getValue, getView, hasCollided, hashCode, setAnimation, setAnimationSpeed, setCollided, setObjectID, setPosition, setRotation, setSpeed, setType, setValue, setView
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalPlayerObject

public LocalPlayerObject()
Method Detail

getViewRotation

public com.threed.jpct.Matrix getViewRotation()
Gets the "view rotation". This is the direction in which the player is looking. Not the direction in which he/she's moving.

Returns:
Matrix the view rotation

setViewRotation

public void setViewRotation(com.threed.jpct.Matrix mat)
Sets the "view rotation". This is the direction in which the player is looking. Not the direction in which he/she's moving.

Parameters:
mat - the view direction

setDead

public void setDead()
Flag the player as dead.


setAlive

public void setAlive()
Flag the player as alive.


isDead

public boolean isDead()
Is the player dead?

Returns:
boolean is he/she?

deadSince

public long deadSince()
Is the player is dead, here's since how long...

Returns:
long how long is the player dead?

activate

public void activate()
Activate a player. An active player is currently playing but can very well be dead.


deactivate

public void deactivate()
Deactivate a player.


isActive

public boolean isActive()
Is the player active. An active player is currently playing but can very well be dead.

Returns:
boolean is the player active?

alignCamera

public void alignCamera(com.threed.jpct.Camera camera)
Align the camera to the player.

Parameters:
camera - the camera that should be aligned

move

public boolean move(com.threed.jpct.World world,
                    KeyStates keys,
                    MouseMapper mouse,
                    long ticks)
Move the player according to key and mouse input.

Parameters:
world - the world in which the player exists
keys - the currently pressed keys
mouse - the mouse input
ticks - the game time passed since the last call
Returns:
boolean true, if the player has moved. False otherwise.