Initializing the User s Viewpoint


Setting Up the Target

createSceneGraph( ) in WrapFPShooter3D loads the target using PropManager, places it in the scene, and records its location:

     PropManager propMan = new PropManager(TARGET, true);     sceneBG.addChild( propMan.getTG(  ) );     Vector3d targetVec = propMan.getLoc(  );     System.out.println("Location of target: " + targetVec ); 

TARGET is Coolrobo.3ds, and the true argument to the PropManager constructor means that there's a coords datafile that fine-tunes the robot's position. The robot appears facing along the positive z-axis, with its feet resting on the XZ plane, in the middle of the floor. targetVec holds the center point of the shape and is used to calculate if a beam is close enough to the robot to trigger an explosion.



Killer Game Programming in Java
Killer Game Programming in Java
ISBN: 0596007302
EAN: 2147483647
Year: 2006
Pages: 340

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net