jmetest.effects.cloth
Class TestCloth

java.lang.Object
  extended bycom.jme.app.AbstractGame
      extended bycom.jme.app.BaseGame
          extended bycom.jme.app.SimpleGame
              extended byjmetest.effects.cloth.TestCloth

public class TestCloth
extends SimpleGame

TestCloth shows a simple demo of jME's Cloth abilities, including interaction with forces and triangle based collision.

Version:
$Id: TestCloth.java,v 1.2 2005/02/10 21:48:31 renanse Exp $
Author:
Joshua Slack

Field Summary
 
Fields inherited from class com.jme.app.SimpleGame
cam, fontLocation, fps, fpsNode, input, lightState, pause, rootNode, showBounds, tempBuffer, timer, tpf, updateBuffer, wireState
 
Fields inherited from class com.jme.app.AbstractGame
ALWAYS_SHOW_PROPS_DIALOG, display, finished, FIRSTRUN_OR_NOCONFIGFILE_SHOW_PROPS_DIALOG, NEVER_SHOW_PROPS_DIALOG, properties
 
Constructor Summary
TestCloth()
           
 
Method Summary
static void main(java.lang.String[] args)
          Entry point for the test,
protected  void simpleInitGame()
          Sets up the scene.
 void simpleUpdate()
          Can be defined in derived classes for custom updating.
 
Methods inherited from class com.jme.app.SimpleGame
cleanup, initGame, initSystem, reinit, render, simpleRender, update
 
Methods inherited from class com.jme.app.BaseGame
quit, start
 
Methods inherited from class com.jme.app.AbstractGame
assertDisplayCreated, finish, getAttributes, getVersion, setDialogBehaviour, setDialogBehaviour, setDialogBehaviour
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestCloth

public TestCloth()
Method Detail

main

public static void main(java.lang.String[] args)
Entry point for the test,

Parameters:
args -

simpleUpdate

public void simpleUpdate()
Description copied from class: SimpleGame
Can be defined in derived classes for custom updating. Called every frame in update.

Overrides:
simpleUpdate in class SimpleGame

simpleInitGame

protected void simpleInitGame()
Sets up the scene. First it moves the default point light and camera position. Then a cloth of 2500 nodes is created and wind, gravity, and drag forces are added. Finally a sphere is added to the scene and as a collider object to the cloth. Texturing is applied and finally the top edge of the cloth is fixed in place by setting those nodes to have infinite mass.

Specified by:
simpleInitGame in class SimpleGame