env3d.jythonrunner
Class GameObject

java.lang.Object
  extended by env3d.GameObjectAdapter
      extended by env3d.advanced.EnvAbstractNode
          extended by env3d.advanced.EnvNode
              extended by env3d.jythonrunner.GameObject

public class GameObject
extends EnvNode

Base class for all objects in our game.


Field Summary
 
Fields inherited from class env3d.advanced.EnvAbstractNode
rotateX, rotateY, rotateZ, scale
 
Fields inherited from class env3d.GameObjectAdapter
assetManager, currentAction, currentModel, currentTexture, internalObject, jme_node, lighting, locator, mat, mat_lit, objectCache, q, qX, qY, qZ
 
Constructor Summary
GameObject(java.lang.String name)
           
 
Method Summary
 void followCam(double followDist, double offX, double offY, double offZ)
          Put the camera behind this object, provide the x, y and z offset relative to the object
 java.lang.String getClassName()
           
 Env getEnv()
          Returns the environment object
 void move()
          The move method reads the jython script and execute it.
 void moveForward(double speed)
          Moves forward at a certain speed, negative speed to move backwards
 void moveRight(double speed)
          Moves to the right at a certain speed, negative to move left
 void setClassName(java.lang.String className)
           
 void setEnv(Env env)
          Sets the env, used by the game class
 void simpleFPSControl(double speed)
          Standard FPS control scheme - camera follow this object.
 void turnToFace(GameObject gameObj)
          Turn this object to face another game object
 
Methods inherited from class env3d.advanced.EnvNode
distance, distance, getModel, getTexture, isTransparent, setModel, setTexture, setTransparent, useLightingMaterial
 
Methods inherited from class env3d.advanced.EnvAbstractNode
attach, getRotateX, getRotateY, getRotateZ, getScale, getX, getY, getZ, remove, setRotateX, setRotateY, setRotateZ, setScale, setX, setY, setZ, update, updateRotation
 
Methods inherited from class env3d.GameObjectAdapter
drawSquare, drawSquare, getFieldFromObject, getJme_node, registerLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameObject

public GameObject(java.lang.String name)
Method Detail

move

public void move()
The move method reads the jython script and execute it.


setEnv

public void setEnv(Env env)
Sets the env, used by the game class

Parameters:
env -

getEnv

public Env getEnv()
Returns the environment object

Returns:

turnToFace

public void turnToFace(GameObject gameObj)
Turn this object to face another game object

Parameters:
gameObj - to object to face

moveForward

public void moveForward(double speed)
Moves forward at a certain speed, negative speed to move backwards

Parameters:
speed -

moveRight

public void moveRight(double speed)
Moves to the right at a certain speed, negative to move left

Parameters:
speed -

followCam

public void followCam(double followDist,
                      double offX,
                      double offY,
                      double offZ)
Put the camera behind this object, provide the x, y and z offset relative to the object


simpleFPSControl

public void simpleFPSControl(double speed)
Standard FPS control scheme - camera follow this object. W,A,S,D for movement, Mouse to look


getClassName

public java.lang.String getClassName()
Returns:
the className

setClassName

public void setClassName(java.lang.String className)
Parameters:
className - the className to set