Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 4 ■ an IntroduCtIon to Game desIGn: Game desIGn ConCepts, Genres, enGInes, and teChnIques


Jinngine is an open source lightweight 3D physics engine written in Java that gives you real-time
collisions, as well as real-time physics calculation capabilities. A user can set up and simulate physics by
calling API functions to specify geometry, joints, and parameters. Friction is modeled by implementing an
approximation of the Coloumb law of friction. This physics engine focuses on collision and physics only,
has no rendering features, and is built using a velocity-based algorithmic approach that is solved using an
efficient NCP solver. You can use jinngine as your physics engine, and you can also use other components
of this engine as if it were a Java code library, for instance, if you want to only implement collision detection
or if you wanted to only utilize the point-of-contact generation features. Next, let’s take a look at inverse
kinematics, or IK engines, which are used in character animation to define skeletal structures and their joint
movement restrictions.


Inverse Kinematics and Robot Engines: JRoboOp and JavaFX-IK


JRoboOp is an open source Java library (package) designed for IK robotics simulation with visualization
of a 3D robot model. The engine simulates robotic inverse kinematics as well as robot dynamics and is
based upon the C++ library called ROBOOP. This library was developed by Richard Gourdeau of École
Polytechnique de Montréal, and the library is compatible with Java 5 and later as well as with JavaFX 1.3
and later, meaning that it will work great with the Java 7, Java 8, JavaFX 9, and Java 9 versions that we will be
covering during this book. This package is distributed under the GNU Public License (GPL).
The JavaFX-IK library was created about two years ago specifically for JavaFX and is available on
GitHub at https://github.com/netopyr/javafx-ik. It is licensed under the Apache License, version 2.0.
The IK software, which allows you to create Skeleton object structures in the JavaFX Scene Graph using
Bone objects, was created by senior software engineer Michael Heinrichs, of Freiburg, Germany.
Next, let’s take a look at the different types of games that can be created as well as how these differ
in their application of the core game components of sprites, collision detection, physics simulation, and
gameplay AI logic.


Figure 4-3. Dyn4j is an open source, 2D collision detection and physics engine that is available under the BSD
license

Free download pdf