Skip to Main Content
Killer Game Programming in Java
book

Killer Game Programming in Java

by Andrew Davison
May 2005
Intermediate to advanced content levelIntermediate to advanced
998 pages
26h
English
O'Reilly Media, Inc.
Content preview from Killer Game Programming in Java

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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Game Development with LibGDX: From Beginner to Professional

Java Game Development with LibGDX: From Beginner to Professional

Lee Stemkoski

Publisher Resources

ISBN: 0596007302Supplemental ContentErrata Page