Gaming JavaFX
Richard & Jasper
Sun Microsystems
www.devoxx.com
Overall presentation goal
Have Fun!
www.devoxx.com
Speaker’s qualifications
Core Engineers on JavaFX at Sun Microsystems
Jasper is the design wizard for FX and author of
the Charts API
Richard is API design lead for FX, UI Controls lead,
and key scenegraph developer
Both write lots of cool stuff
www.devoxx.com
Agenda
Physics
Demos
Explosions
www.devoxx.com
Physics
Box2D
Chipmunk
Box2DFlash
FarSeerPhys2D
JBox2D
Motor2D
World
Static Body
Static Body
Body
Shape
Static Body
www.devoxx.com
Stop hitting me!
Hit (collision) detection is expensive
Broad phase uses AABB (axis aligned bounding box) and
tricks to trivially reject
Narrow phase performs hit detection on the geometry
Not dissimilar to how we do picking in JavaFX
www.devoxx.com
Physics Integration
PhysicalScene
A Scene which contains a physics World
Gravity
Dampening / Iterations
PhysicalObject
A Node which has a physics Body
And a Body has a (non-fx) shape as geometry
Took que from http://piliq.com/javafx/?page_id=669
www.devoxx.com
This is Heavy Stuff Dude
Apply Gravity to Scene
Setup Body objects
Physics Engine does the rest
www.devoxx.com
Watch where yer goin eh!
Same demo as before, but this time with an initial
velocity
b.adjustVelocity(new Vector2f(10000, 0));
www.devoxx.com
Prism
Internal working name for new graphics stack
Replaces AWT
Straight to the hardware (OpenGL or Direct3D)
Really Fast
www.devoxx.com
DEMO
www.devoxx.com
Summary
JavaFX 1.2.1 is Game Ready
Write some apps for the Java Store
Have some fun, make some $$
Using Java APIs from FX is easy
www.devoxx.com
Thanks for your attention!
http://fxexperience.com
http://javafx.com

Gaming JavaFX