├── .gitignore
├── LICENSE
├── README.md
├── android
├── AndroidManifest.xml
├── assets
│ ├── blender_export.py
│ ├── btrees
│ │ └── dog.btree
│ ├── images
│ │ ├── badlogic.jpg
│ │ └── marker.png
│ ├── models
│ │ ├── CREDITS
│ │ ├── LICENSE
│ │ ├── blender
│ │ │ ├── dog.blend
│ │ │ ├── dog.xcf
│ │ │ ├── human.blend
│ │ │ ├── human.xcf
│ │ │ └── scene0.blend
│ │ ├── g3db
│ │ │ ├── asphalt.png
│ │ │ ├── asphalt_cracks.png
│ │ │ ├── asphalt_normal.png
│ │ │ ├── character01.png
│ │ │ ├── character01_normal.png
│ │ │ ├── concrete01.png
│ │ │ ├── concrete01_normal.png
│ │ │ ├── dog01.png
│ │ │ ├── dog01_normal.png
│ │ │ ├── dog_dog.g3db
│ │ │ ├── dog_stick.g3db
│ │ │ ├── door01.png
│ │ │ ├── door01_normal.png
│ │ │ ├── earth.png
│ │ │ ├── earth_normal.png
│ │ │ ├── fence.png
│ │ │ ├── grass-normal.jpg
│ │ │ ├── ground01.png
│ │ │ ├── ground02.png
│ │ │ ├── ground03.png
│ │ │ ├── gum_leaf.png
│ │ │ ├── hardwood.jpg
│ │ │ ├── hardwood_normal.jpg
│ │ │ ├── human_human.g3db
│ │ │ ├── pavement_stones01.png
│ │ │ ├── pavement_stones01_normal.png
│ │ │ ├── plants_grass_01.png
│ │ │ ├── prop_plants_furn.png
│ │ │ ├── red_bricks.png
│ │ │ ├── red_bricks_normal.png
│ │ │ ├── roof_tiles.png
│ │ │ ├── roof_tiles_normal.png
│ │ │ ├── scene0_bed_0.g3db
│ │ │ ├── scene0_bookcase_0.g3db
│ │ │ ├── scene0_car_0.g3db
│ │ │ ├── scene0_chair_0.g3db
│ │ │ ├── scene0_door_0.g3db
│ │ │ ├── scene0_door_1.g3db
│ │ │ ├── scene0_door_fence_0.g3db
│ │ │ ├── scene0_entrance_0.g3db
│ │ │ ├── scene0_entrance_1.g3db
│ │ │ ├── scene0_fence_2.g3db
│ │ │ ├── scene0_fence_3.g3db
│ │ │ ├── scene0_fence_4.g3db
│ │ │ ├── scene0_fountain.g3db
│ │ │ ├── scene0_furn_0.g3db
│ │ │ ├── scene0_grass_0.g3db
│ │ │ ├── scene0_ground_1.g3db
│ │ │ ├── scene0_ground_2.g3db
│ │ │ ├── scene0_ground_3.g3db
│ │ │ ├── scene0_ground_4.g3db
│ │ │ ├── scene0_house_floor_0.g3db
│ │ │ ├── scene0_house_floor_1.g3db
│ │ │ ├── scene0_house_floor_2.g3db
│ │ │ ├── scene0_navmesh.g3db
│ │ │ ├── scene0_roof_0.g3db
│ │ │ ├── scene0_roof_10.g3db
│ │ │ ├── scene0_roof_3.g3db
│ │ │ ├── scene0_roof_4.g3db
│ │ │ ├── scene0_roof_5.g3db
│ │ │ ├── scene0_roof_6.g3db
│ │ │ ├── scene0_roof_7.g3db
│ │ │ ├── scene0_roof_8.g3db
│ │ │ ├── scene0_stairs_2.g3db
│ │ │ ├── scene0_stairs_4.g3db
│ │ │ ├── scene0_stairs_5.g3db
│ │ │ ├── scene0_table_0.g3db
│ │ │ ├── scene0_table_1.g3db
│ │ │ ├── scene0_tree_0.g3db
│ │ │ ├── scene0_tree_0_leaves.g3db
│ │ │ ├── scene0_truck_0.g3db
│ │ │ ├── scene0_wall_inside_0.g3db
│ │ │ ├── scene0_wall_inside_1.g3db
│ │ │ ├── scene0_wall_inside_3.g3db
│ │ │ ├── scene0_wall_inside_4.g3db
│ │ │ ├── scene0_wall_inside_5.g3db
│ │ │ ├── scene0_wall_inside_door_0.g3db
│ │ │ ├── scene0_wall_outside_0.g3db
│ │ │ ├── scene0_wall_outside_1.g3db
│ │ │ ├── scene0_wall_outside_corner_0.g3db
│ │ │ ├── scene0_wall_outside_corner_1.g3db
│ │ │ ├── scene0_wall_outside_door_0.g3db
│ │ │ ├── scene0_wall_outside_door_1.g3db
│ │ │ ├── scene0_wall_outside_window_0.g3db
│ │ │ ├── scene0_wall_outside_window_1.g3db
│ │ │ ├── scene0_wall_vertical.g3db
│ │ │ ├── snow_gum_mod.png
│ │ │ ├── tree_branch.png
│ │ │ ├── wallpaper01.png
│ │ │ ├── wallpaper01_normal.png
│ │ │ ├── wood01.png
│ │ │ └── wood01_normal.png
│ │ └── json
│ │ │ ├── dog.json
│ │ │ ├── human.json
│ │ │ └── scene0.json
│ ├── particles
│ │ └── fountain.pfx
│ ├── shaders
│ │ ├── CREDITS
│ │ ├── LICENSE
│ │ ├── uber.frag
│ │ └── uber.vert
│ ├── skins
│ │ ├── CREDITS
│ │ ├── LICENSE
│ │ ├── buttons.atlas
│ │ ├── buttons.png
│ │ ├── buttons.svg
│ │ ├── default.fnt
│ │ ├── uiskin.atlas
│ │ ├── uiskin.json
│ │ └── uiskin.png
│ └── sounds
│ │ ├── bark.mp3
│ │ ├── whine.mp3
│ │ └── whistle.mp3
├── build.gradle
├── ic_launcher-web.png
├── proguard-project.txt
├── project.properties
├── res
│ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
└── src
│ └── com
│ └── mygdx
│ └── game
│ └── android
│ └── AndroidLauncher.java
├── build.gradle
├── core
├── META-INF
│ └── MANIFEST.MF
├── build.gradle
└── src
│ ├── META-INF
│ └── MANIFEST.MF
│ └── com
│ └── mygdx
│ └── game
│ ├── GameEngine.java
│ ├── GameRenderer.java
│ ├── GameScreen.java
│ ├── GameStage.java
│ ├── GdxDemo3D.java
│ ├── LoadingGameScreen.java
│ ├── blender
│ ├── BlenderAssetManager.java
│ └── objects
│ │ ├── BlenderCamera.java
│ │ ├── BlenderEmpty.java
│ │ ├── BlenderLight.java
│ │ ├── BlenderModel.java
│ │ └── BlenderObject.java
│ ├── debugdrawers
│ ├── ArmatureDebugDrawer.java
│ └── NavMeshDebugDrawer.java
│ ├── gdxkit
│ ├── GdxGame.java
│ ├── GdxScreen.java
│ ├── LoadableGdxScreen.java
│ └── LoadingGdxScreen.java
│ ├── objects
│ ├── Billboard.java
│ ├── DogCharacter.java
│ ├── GameCharacter.java
│ ├── GameModel.java
│ ├── GameModelBody.java
│ ├── GameObject.java
│ ├── HumanCharacter.java
│ ├── InvisibleBody.java
│ ├── Ragdoll.java
│ ├── SteerableBody.java
│ ├── Stick.java
│ └── dog
│ │ ├── AlreadyCriedForHumanDeathCondition.java
│ │ ├── CalculatePathToHumanTask.java
│ │ ├── CalculatePathToStickTask.java
│ │ ├── FollowPathTask.java
│ │ ├── GiveStickTask.java
│ │ ├── HumanWantToPlayCondition.java
│ │ ├── IsHumanDeadCondition.java
│ │ ├── IsHumanInRangeCondition.java
│ │ ├── LieDownTask.java
│ │ ├── LoopedAnimationTaskBase.java
│ │ ├── MovementAnimationTaskBase.java
│ │ ├── OneShotAnimationTaskBase.java
│ │ ├── PickUpStickTask.java
│ │ ├── PissTask.java
│ │ ├── SetAlreadyCriedForHumanDeathTask.java
│ │ ├── SetThrowButtonTask.java
│ │ ├── SitTask.java
│ │ ├── SpinAroundTask.java
│ │ ├── SpinAroundToFaceHumanTask.java
│ │ ├── StandTask.java
│ │ ├── StickThrownCondition.java
│ │ ├── TaskAnimation.java
│ │ ├── WanderTask.java
│ │ └── WhineTask.java
│ ├── pathfinding
│ ├── Edge.java
│ ├── NavMesh.java
│ ├── NavMeshGraph.java
│ ├── NavMeshGraphPath.java
│ ├── NavMeshHeuristic.java
│ ├── NavMeshPointPath.java
│ ├── NavMeshRaycastCallback.java
│ └── Triangle.java
│ ├── scene
│ ├── GameObjectBlueprint.java
│ ├── GameScene.java
│ └── GameSceneManager.java
│ ├── settings
│ ├── DebugViewSettings.java
│ ├── GameSettings.java
│ └── ShaderSettings.java
│ ├── shaders
│ └── UberShader.java
│ ├── steerers
│ ├── CollisionAvoidanceSteererBase.java
│ ├── FollowPathSteerer.java
│ └── WanderSteerer.java
│ ├── ui
│ ├── BooleanSettingsMenu.java
│ ├── FloatSettingsMenu.java
│ ├── FloatValueLabel.java
│ ├── GameSpeedController.java
│ ├── IntValueLabel.java
│ └── ObjectValueLabel.java
│ └── utilities
│ ├── AnimationListener.java
│ ├── BehaviorTreeController.java
│ ├── BulletLocation.java
│ ├── BulletSteeringUtils.java
│ ├── CameraController.java
│ ├── Constants.java
│ ├── Engine.java
│ ├── Entity.java
│ ├── GeometryUtils.java
│ ├── GhostCamera.java
│ ├── ModelFactory.java
│ ├── MyShapeRenderer.java
│ ├── Observable.java
│ ├── Observer.java
│ ├── Sounds.java
│ ├── Steerer.java
│ └── VertexColorTextureBlend.java
├── desktop
├── build.gradle
└── src
│ └── com
│ └── mygdx
│ └── game
│ └── desktop
│ └── DesktopLauncher.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
├── Info.plist.xml
├── build.gradle
├── data
│ ├── Default-375w-667h@2x.png
│ ├── Default-414w-736h@3x.png
│ ├── Default-568h@2x.png
│ ├── Default.png
│ ├── Default@2x.png
│ ├── Default@2x~ipad.png
│ ├── Default~ipad.png
│ ├── Icon-72.png
│ ├── Icon-72@2x.png
│ ├── Icon.png
│ └── Icon@2x.png
├── robovm.properties
├── robovm.xml
└── src
│ └── com
│ └── mygdx
│ └── game
│ └── IOSLauncher.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Java
2 |
3 | *.class
4 | *.war
5 | *.ear
6 | hs_err_pid*
7 |
8 | ## GWT
9 | war/
10 | html/war/gwt_bree/
11 | html/gwt-unitCache/
12 | .apt_generated/
13 | html/war/WEB-INF/deploy/
14 | html/war/WEB-INF/classes/
15 | .gwt/
16 | gwt-unitCache/
17 | www-test/
18 | .gwt-tmp/
19 |
20 | ## Android Studio and Intellij and Android in general
21 | android/libs/armeabi/
22 | android/libs/armeabi-v7a/
23 | android/libs/x86/
24 | android/gen/
25 | .idea/
26 | *.ipr
27 | *.iws
28 | *.iml
29 | out/
30 | com_crashlytics_export_strings.xml
31 |
32 | ## Eclipse
33 | .classpath
34 | .project
35 | .metadata
36 | **/bin/
37 | tmp/
38 | *.tmp
39 | *.bak
40 | *.swp
41 | *~.nib
42 | local.properties
43 | .settings/
44 | .loadpath
45 | .externalToolBuilders/
46 | *.launch
47 |
48 | ## NetBeans
49 | **/nbproject/private/
50 | build/
51 | nbbuild/
52 | dist/
53 | nbdist/
54 | nbactions.xml
55 | nb-configuration.xml
56 |
57 | ## Gradle
58 |
59 | .gradle
60 | gradle-app.setting
61 | build/
62 |
63 | ## OS Specific
64 | .DS_Store
65 |
66 | ## 3d Models
67 | *.blend1
68 | *.obj
69 | *.mtl
70 | *.fbx
71 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GdxDemo3D
2 | GdxDemo3D is a game project built with [libGDX](https://github.com/libgdx), demonstrating various aspects of the game library, as well as its extensions, such as the physics engine [Bullet](http://bulletphysics.org/) wrapper and the artificial intelligence library [gdx-ai](https://github.com/libgdx/gdx-ai).
3 |
4 | 
5 | A simple 3D world is included, with a multi storey house and various other items.
6 |
7 | 
8 | Animated human and dog characters are used as actors in the world. Ragdoll physics allows for dynamic character animation when a human falls down.
9 |
10 | 
11 | The [gdx-ai pathfinding](https://github.com/libgdx/gdx-ai/wiki/Pathfinding) module in conjunction with a navigation mesh handles pathfinding, the [gdx-ai steering behaviors](https://github.com/libgdx/gdx-ai/wiki/Steering-Behaviors) module handles character movement while [state machines](https://github.com/libgdx/gdx-ai/wiki/State-Machine) and [behavior trees](https://github.com/libgdx/gdx-ai/wiki/Behavior-Trees) are used to model human and dog brains respectively.
12 |
13 | 
14 | The Bullet physics library is used to handle collisions and forces between objects.
15 |
16 | 
17 | Objects in the world can be modified directly in Blender and exported into the game with an automated script.
18 |
--------------------------------------------------------------------------------
/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
14 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/android/assets/btrees/dog.btree:
--------------------------------------------------------------------------------
1 | import calculatePathToHuman:"com.mygdx.game.objects.dog.CalculatePathToHumanTask"
2 | import calculatePathToStick:"com.mygdx.game.objects.dog.CalculatePathToStickTask"
3 | import followPath:"com.mygdx.game.objects.dog.FollowPathTask"
4 | import giveStick:"com.mygdx.game.objects.dog.GiveStickTask"
5 | import lieDown:"com.mygdx.game.objects.dog.LieDownTask"
6 | import pickUpStick:"com.mygdx.game.objects.dog.PickUpStickTask"
7 | import piss:"com.mygdx.game.objects.dog.PissTask"
8 | import setThrowButton:"com.mygdx.game.objects.dog.SetThrowButtonTask"
9 | import sit:"com.mygdx.game.objects.dog.SitTask"
10 | import spinAround:"com.mygdx.game.objects.dog.SpinAroundTask"
11 | import spinAroundToFaceHuman:"com.mygdx.game.objects.dog.SpinAroundToFaceHumanTask"
12 | import stand:"com.mygdx.game.objects.dog.StandTask"
13 | import stickThrown?:"com.mygdx.game.objects.dog.StickThrownCondition"
14 | import wander:"com.mygdx.game.objects.dog.WanderTask"
15 | import whine:"com.mygdx.game.objects.dog.WhineTask"
16 |
17 | import alreadyCriedForHumanDeath?:"com.mygdx.game.objects.dog.AlreadyCriedForHumanDeathCondition"
18 | import isHumanDead?:"com.mygdx.game.objects.dog.IsHumanDeadCondition"
19 | import isHumanInRange?:"com.mygdx.game.objects.dog.IsHumanInRangeCondition"
20 | import humanWantToPlay?:"com.mygdx.game.objects.dog.HumanWantToPlayCondition"
21 | import setAlreadyCriedForHumanDeath:"com.mygdx.game.objects.dog.SetAlreadyCriedForHumanDeathTask"
22 |
23 |
24 | subtree name:"shouldFeelSadForHumanDeath?"
25 | sequence
26 | invert
27 | alreadyCriedForHumanDeath?
28 | isHumanDead?
29 | isHumanInRange? meters:20
30 |
31 | subtree name:"feelSadForHumanDeath"
32 | sequence
33 | calculatePathToHuman
34 | followPath gait:"run"
35 | whine
36 | parallel policy:"selector"
37 | wait seconds:"uniform,10,25"
38 | lieDown
39 | whine
40 | parallel policy:"selector"
41 | wait seconds:"uniform,5,9"
42 | sit
43 | setAlreadyCriedForHumanDeath # this makes the subtree's guard fail; the dog will start acting on his own
44 |
45 | subtree name:"playWithMan"
46 | sequence
47 | calculatePathToHuman
48 | followPath gait:"run"
49 | giveStick
50 | spinAroundToFaceHuman
51 | setThrowButton enabled:true
52 | parallel policy:"selector" # wait for the man to throw the stick
53 | stickThrown?
54 | repeat
55 | sequence
56 | parallel policy:"selector"
57 | wait seconds:"uniform,3,5"
58 | randomSelector
59 | stand
60 | sit
61 | spinAround
62 | setThrowButton enabled:false
63 | calculatePathToStick
64 | followPath gait:"run"
65 | pickUpStick
66 |
67 | subtree name:"actOnYourOwn"
68 | selector
69 | (random success:0.1) piss
70 | parallel policy:"selector"
71 | wait seconds:"uniform,3,6"
72 | randomSelector
73 | wander gait:"run"
74 | wander gait:"walk"
75 | lieDown
76 | sit
77 |
78 | root
79 | dynamicGuardSelector
80 | ($shouldFeelSadForHumanDeath?) $feelSadForHumanDeath
81 | (humanWantToPlay?) $playWithMan
82 | () $actOnYourOwn # fallback behavior (no guard)
83 |
--------------------------------------------------------------------------------
/android/assets/images/badlogic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/images/badlogic.jpg
--------------------------------------------------------------------------------
/android/assets/images/marker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/images/marker.png
--------------------------------------------------------------------------------
/android/assets/models/CREDITS:
--------------------------------------------------------------------------------
1 | Texture & Model: Furn plant, Grass
2 | Artist: Blender Foundation | apricot.blender.org
3 | License: CC-BY 3.0
4 | Website: http://opengameart.org/content/low-poly-plants
5 |
6 | Texture: Hardwood
7 | Artist: bart
8 | License: CC-BY 3.0
9 | Website: http://opengameart.org/node/11950
10 |
11 | Texture: Pavement stones
12 | Artist: Duion
13 | License: CC-BY 3.0
14 | Website: http://opengameart.org/content/terrainsgravelpavementsoilpack01
15 |
16 | Textures & Model: Gum tree
17 | Artist: lattice
18 | License: CC-BY 3.0
19 | Website: http://opengameart.org/content/gum-tree
20 |
21 | All other models and textures
22 | Artist: jsjolund
23 | License: CC-BY 3.0
24 | Website: https://github.com/jsjolund/GdxDemo3D
25 |
--------------------------------------------------------------------------------
/android/assets/models/blender/dog.blend:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/blender/dog.blend
--------------------------------------------------------------------------------
/android/assets/models/blender/dog.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/blender/dog.xcf
--------------------------------------------------------------------------------
/android/assets/models/blender/human.blend:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/blender/human.blend
--------------------------------------------------------------------------------
/android/assets/models/blender/human.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/blender/human.xcf
--------------------------------------------------------------------------------
/android/assets/models/blender/scene0.blend:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/blender/scene0.blend
--------------------------------------------------------------------------------
/android/assets/models/g3db/asphalt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/asphalt.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/asphalt_cracks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/asphalt_cracks.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/asphalt_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/asphalt_normal.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/character01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/character01.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/character01_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/character01_normal.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/concrete01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/concrete01.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/concrete01_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/concrete01_normal.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/dog01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/dog01.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/dog01_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/dog01_normal.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/dog_dog.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/dog_dog.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/dog_stick.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/dog_stick.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/door01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/door01.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/door01_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/door01_normal.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/earth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/earth.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/earth_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/earth_normal.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/fence.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/fence.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/grass-normal.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/grass-normal.jpg
--------------------------------------------------------------------------------
/android/assets/models/g3db/ground01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/ground01.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/ground02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/ground02.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/ground03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/ground03.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/gum_leaf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/gum_leaf.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/hardwood.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/hardwood.jpg
--------------------------------------------------------------------------------
/android/assets/models/g3db/hardwood_normal.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/hardwood_normal.jpg
--------------------------------------------------------------------------------
/android/assets/models/g3db/human_human.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/human_human.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/pavement_stones01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/pavement_stones01.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/pavement_stones01_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/pavement_stones01_normal.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/plants_grass_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/plants_grass_01.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/prop_plants_furn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/prop_plants_furn.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/red_bricks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/red_bricks.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/red_bricks_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/red_bricks_normal.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/roof_tiles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/roof_tiles.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/roof_tiles_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/roof_tiles_normal.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_bed_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_bed_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_bookcase_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_bookcase_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_car_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_car_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_chair_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_chair_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_door_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_door_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_door_1.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_door_1.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_door_fence_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_door_fence_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_entrance_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_entrance_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_entrance_1.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_entrance_1.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_fence_2.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_fence_2.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_fence_3.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_fence_3.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_fence_4.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_fence_4.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_fountain.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_fountain.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_furn_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_furn_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_grass_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_grass_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_ground_1.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_ground_1.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_ground_2.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_ground_2.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_ground_3.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_ground_3.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_ground_4.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_ground_4.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_house_floor_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_house_floor_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_house_floor_1.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_house_floor_1.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_house_floor_2.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_house_floor_2.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_navmesh.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_navmesh.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_roof_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_roof_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_roof_10.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_roof_10.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_roof_3.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_roof_3.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_roof_4.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_roof_4.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_roof_5.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_roof_5.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_roof_6.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_roof_6.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_roof_7.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_roof_7.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_roof_8.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_roof_8.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_stairs_2.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_stairs_2.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_stairs_4.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_stairs_4.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_stairs_5.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_stairs_5.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_table_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_table_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_table_1.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_table_1.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_tree_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_tree_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_tree_0_leaves.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_tree_0_leaves.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_truck_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_truck_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_inside_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_inside_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_inside_1.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_inside_1.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_inside_3.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_inside_3.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_inside_4.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_inside_4.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_inside_5.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_inside_5.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_inside_door_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_inside_door_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_outside_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_outside_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_outside_1.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_outside_1.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_outside_corner_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_outside_corner_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_outside_corner_1.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_outside_corner_1.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_outside_door_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_outside_door_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_outside_door_1.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_outside_door_1.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_outside_window_0.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_outside_window_0.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_outside_window_1.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_outside_window_1.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/scene0_wall_vertical.g3db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/scene0_wall_vertical.g3db
--------------------------------------------------------------------------------
/android/assets/models/g3db/snow_gum_mod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/snow_gum_mod.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/tree_branch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/tree_branch.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/wallpaper01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/wallpaper01.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/wallpaper01_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/wallpaper01_normal.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/wood01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/wood01.png
--------------------------------------------------------------------------------
/android/assets/models/g3db/wood01_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/models/g3db/wood01_normal.png
--------------------------------------------------------------------------------
/android/assets/models/json/dog.json:
--------------------------------------------------------------------------------
1 | {"empty": [{"rotation": {"z": -0.0, "x": 0.0, "y": 0.0}, "custom_properties": {"mass": 0.1, "collision_shape": "box"}, "type": "NoneType", "scale": {"z": 0.21861596405506134, "x": 1.753739356994629, "y": 0.21861596405506134}, "layers": [true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false], "position": {"z": -3.9581310749053955, "x": 0.1309005618095398, "y": 0.9002383947372437}, "name": "stick"}], "model": [{"rotation": {"z": -0.0, "x": 0.0, "y": 0.0}, "model_file_name": "dog_dog", "custom_properties": {}, "type": "Mesh", "scale": {"z": 1.0, "x": 1.0, "y": 1.0}, "layers": [true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false], "position": {"z": -0.0, "x": 0.0, "y": 0.0}, "name": "dog"}, {"rotation": {"z": -0.0, "x": 0.0, "y": 0.0}, "model_file_name": "dog_stick", "custom_properties": {}, "type": "Mesh", "scale": {"z": 1.0, "x": 1.0, "y": 1.0}, "layers": [true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false], "position": {"z": -3.9581310749053955, "x": 0.1309005618095398, "y": 0.9002383947372437}, "name": "stick"}]}
2 |
--------------------------------------------------------------------------------
/android/assets/particles/fountain.pfx:
--------------------------------------------------------------------------------
1 | {unique:{billboardBatch:{class:com.badlogic.gdx.graphics.g3d.particles.ResourceData$SaveData,data:{cfg:{class:com.badlogic.gdx.graphics.g3d.particles.batches.BillboardParticleBatch$Config,mode:Screen}},indices:[0]}},data:[],assets:[{filename:pre_particle.png,type:com.badlogic.gdx.graphics.Texture}],resource:{class:com.badlogic.gdx.graphics.g3d.particles.ParticleEffect,controllers:[{name:Billboard Controller,emitter:{class:com.badlogic.gdx.graphics.g3d.particles.emitters.RegularEmitter,minParticleCount:150,maxParticleCount:300,continous:true,emission:{active:true,lowMin:200,lowMax:200,highMin:250,highMax:250,relative:false,scaling:[0.59574467],timeline:[0]},delay:{active:false,lowMin:0,lowMax:0},duration:{active:true,lowMin:0,lowMax:0},life:{active:true,lowMin:1000,lowMax:1000,highMin:1000,highMax:1000,relative:false,scaling:[0,1,1],timeline:[0,0.4041096,0.9726027]},lifeOffset:{active:false,lowMin:0,lowMax:0,highMin:0,highMax:0,relative:false,scaling:[1],timeline:[0]}},influencers:[{class:com.badlogic.gdx.graphics.g3d.particles.influencers.SpawnInfluencer,spawnShape:{class:com.badlogic.gdx.graphics.g3d.particles.values.PointSpawnShapeValue,active:false,xOffsetValue:{active:false,lowMin:0,lowMax:0},yOffsetValue:{active:false,lowMin:0,lowMax:0},zOffsetValue:{active:false,lowMin:0,lowMax:0},spawnWidthValue:{active:false,lowMin:0,lowMax:0,highMin:0,highMax:0,relative:false,scaling:[1],timeline:[0]},spawnHeightValue:{active:false,lowMin:0,lowMax:0,highMin:0.1,highMax:0.1,relative:false,scaling:[1],timeline:[0]},spawnDepthValue:{active:false,lowMin:0,lowMax:0,highMin:0,highMax:0,relative:false,scaling:[1],timeline:[0]},edges:false}},{class:com.badlogic.gdx.graphics.g3d.particles.influencers.ColorInfluencer$Single,alpha:{active:false,lowMin:0,lowMax:0,highMin:1,highMax:1,relative:false,scaling:[0,0,1,0.6573034],timeline:[0,0.001,0.002,0.97607654]},color:{active:false,colors:[0.68235296,0.7882353,0.83137256,0.9843137,0.9843137,0.9843137],timeline:[0,1]}},{class:com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsInfluencer,velocities:[{class:com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier$PolarAcceleration,isGlobal:false,strengthValue:{active:false,lowMin:10,lowMax:50,highMin:30,highMax:20,relative:false,scaling:[0,1,1,0],timeline:[0,0.001,0.41095892,0.9794521]},thetaValue:{active:false,lowMin:0,lowMax:0,highMin:0,highMax:360,relative:false,scaling:[1,1],timeline:[0,1]},phiValue:{active:true,lowMin:-360,lowMax:-360,highMin:-180,highMax:-180,relative:false,scaling:[0,0,1,1],timeline:[0,0.24657534,0.37671232,1]}},{class:com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier$BrownianAcceleration,isGlobal:false,strengthValue:{active:false,lowMin:5,lowMax:5,highMin:10,highMax:10,relative:false,scaling:[0.4680851,1],timeline:[0,1]}}]},{class:com.badlogic.gdx.graphics.g3d.particles.influencers.ScaleInfluencer,value:{active:false,lowMin:0.1,lowMax:0.1,highMin:0.5,highMax:0.5,relative:false,scaling:[0.65957445,0],timeline:[0,1]}}],renderer:{class:com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardRenderer}}]}}
--------------------------------------------------------------------------------
/android/assets/shaders/CREDITS:
--------------------------------------------------------------------------------
1 | Shader code is derived from the work of Xoppa
2 | http://gist.github.com/xoppa/9766698
3 |
--------------------------------------------------------------------------------
/android/assets/shaders/LICENSE:
--------------------------------------------------------------------------------
1 | KTHXBYE License Version 2.0!
2 |
3 | * Do NOT slap your corporation's license header anywhere, it's the law :D
4 | * You can totally do this:
5 | - fork it, spoon it, knife it
6 | - redistribute it, in source, binary, pizza or lasagne form
7 | - modify it, convert it, remix it, blend it
8 | * ALWAYS retain the CREDITS file, it credits the sources for all art, namely
9 | - The AWESOME Kenney aka Asset Jesus (http://www.kenney.nl)
10 | - "Bacterial Love" by RoleMusic (http://freemusicarchive.org/music/Rolemusic/Pop_Singles_Compilation_2014/01_rolemusic_-_bacterial_love)
11 | * ALWAYS retain this LICENSE file and any related material such as license headers.
12 | * IF USED FOR COMMERCIAL PURPOSES (including training material, talks, etc.) YOU MUST:
13 | - Take a photo of you wearing a pink hat, standing on one leg, holding a turtle
14 | - Turtle may be substituted by chicken, polar bear, or great white shark
15 | - Post the photo to Twitter along with the message "Am I pretty @badlogicgames?"
16 |
17 | If you violate this license, Karma will be a bitch (and i'll be petty on Twitter)!
18 |
19 | Kthxbye, <3 Mario (Zechner, Copyright 2014-2234)
--------------------------------------------------------------------------------
/android/assets/skins/CREDITS:
--------------------------------------------------------------------------------
1 | uiskin.* files and default.fnt are from the libgdx test assets
2 | http://github.com/libgdx/libgdx/tree/master/tests/gdx-tests-android/assets/data
3 |
4 | buttons.* files made by jsjolund
--------------------------------------------------------------------------------
/android/assets/skins/buttons.atlas:
--------------------------------------------------------------------------------
1 | buttons.png
2 | size: 512,256
3 | format: RGBA8888
4 | filter: Linear,Linear
5 | repeat: none
6 | run-up
7 | rotate: false
8 | xy: 0, 0
9 | size: 128, 128
10 | orig: 128, 128
11 | offset: 0, 0
12 | index: -1
13 | run-down
14 | rotate: false
15 | xy: 0, 128
16 | size: 128, 128
17 | orig: 128, 128
18 | offset: 0, 0
19 | index: -1
20 | walk-up
21 | rotate: false
22 | xy: 128, 0
23 | size: 128, 128
24 | orig: 128, 128
25 | offset: 0, 0
26 | index: -1
27 | walk-down
28 | rotate: false
29 | xy: 128, 128
30 | size: 128, 128
31 | orig: 128, 128
32 | offset: 0, 0
33 | index: -1
34 | crouch-up
35 | rotate: false
36 | xy: 256, 0
37 | size: 128, 128
38 | orig: 128, 128
39 | offset: 0, 0
40 | index: -1
41 | crouch-down
42 | rotate: false
43 | xy: 256, 128
44 | size: 128, 128
45 | orig: 128, 128
46 | offset: 0, 0
47 | index: -1
48 | crawl-up
49 | rotate: false
50 | xy: 384, 0
51 | size: 128, 128
52 | orig: 128, 128
53 | offset: 0, 0
54 | index: -1
55 | crawl-down
56 | rotate: false
57 | xy: 384, 128
58 | size: 128, 128
59 | orig: 128, 128
60 | offset: 0, 0
61 | index: -1
62 | play-up
63 | rotate: false
64 | xy: 512, 0
65 | size: 128, 128
66 | orig: 128, 128
67 | offset: 0, 0
68 | index: -1
69 | play-down
70 | rotate: false
71 | xy: 512, 128
72 | size: 128, 128
73 | orig: 128, 128
74 | offset: 0, 0
75 | index: -1
76 | pause-up
77 | rotate: false
78 | xy: 640, 0
79 | size: 128, 128
80 | orig: 128, 128
81 | offset: 0, 0
82 | index: -1
83 | pause-down
84 | rotate: false
85 | xy: 640, 128
86 | size: 128, 128
87 | orig: 128, 128
88 | offset: 0, 0
89 | index: -1
90 | slow-up
91 | rotate: false
92 | xy: 768, 0
93 | size: 128, 128
94 | orig: 128, 128
95 | offset: 0, 0
96 | index: -1
97 | slow-down
98 | rotate: false
99 | xy: 768, 128
100 | size: 128, 128
101 | orig: 128, 128
102 | offset: 0, 0
103 | index: -1
104 | throw-up
105 | rotate: false
106 | xy: 896, 0
107 | size: 128, 128
108 | orig: 128, 128
109 | offset: 0, 0
110 | index: -1
111 | throw-down
112 | rotate: false
113 | xy: 896, 128
114 | size: 128, 128
115 | orig: 128, 128
116 | offset: 0, 0
117 | index: -1
118 | kill-up
119 | rotate: false
120 | xy: 1024, 0
121 | size: 128, 128
122 | orig: 128, 128
123 | offset: 0, 0
124 | index: -1
125 | kill-down
126 | rotate: false
127 | xy: 1024, 128
128 | size: 128, 128
129 | orig: 128, 128
130 | offset: 0, 0
131 | index: -1
132 | slider-background
133 | rotate: false
134 | xy: 1152, 0
135 | size: 128, 256
136 | orig: 128, 256
137 | offset: 0, 0
138 | index: -1
139 | slider-knob-up
140 | rotate: false
141 | xy: 1280, 0
142 | size: 128, 64
143 | orig: 128, 64
144 | offset: 0, 0
145 | index: -1
146 | slider-knob-down
147 | rotate: false
148 | xy: 1280, 64
149 | size: 128, 64
150 | orig: 128, 64
151 | offset: 0, 0
152 | index: -1
153 | whistle-up
154 | rotate: false
155 | xy: 1408, 0
156 | size: 128, 128
157 | orig: 128, 128
158 | offset: 0, 0
159 | index: -1
160 | whistle-down
161 | rotate: false
162 | xy: 1408, 128
163 | size: 128, 128
164 | orig: 128, 128
165 | offset: 0, 0
166 | index: -1
--------------------------------------------------------------------------------
/android/assets/skins/buttons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/skins/buttons.png
--------------------------------------------------------------------------------
/android/assets/skins/uiskin.atlas:
--------------------------------------------------------------------------------
1 |
2 | uiskin.png
3 | size: 256,128
4 | format: RGBA8888
5 | filter: Linear,Linear
6 | repeat: none
7 | check-off
8 | rotate: false
9 | xy: 11, 5
10 | size: 14, 14
11 | orig: 14, 14
12 | offset: 0, 0
13 | index: -1
14 | textfield
15 | rotate: false
16 | xy: 11, 5
17 | size: 14, 14
18 | split: 3, 3, 3, 3
19 | orig: 14, 14
20 | offset: 0, 0
21 | index: -1
22 | check-on
23 | rotate: false
24 | xy: 125, 35
25 | size: 14, 14
26 | orig: 14, 14
27 | offset: 0, 0
28 | index: -1
29 | cursor
30 | rotate: false
31 | xy: 23, 1
32 | size: 3, 3
33 | split: 1, 1, 1, 1
34 | orig: 3, 3
35 | offset: 0, 0
36 | index: -1
37 | default
38 | rotate: false
39 | xy: 1, 50
40 | size: 254, 77
41 | orig: 254, 77
42 | offset: 0, 0
43 | index: -1
44 | default-pane
45 | rotate: false
46 | xy: 11, 1
47 | size: 5, 3
48 | split: 1, 1, 1, 1
49 | orig: 5, 3
50 | offset: 0, 0
51 | index: -1
52 | default-rect-pad
53 | rotate: false
54 | xy: 11, 1
55 | size: 5, 3
56 | split: 1, 1, 1, 1
57 | orig: 5, 3
58 | offset: 0, 0
59 | index: -1
60 | default-pane-noborder
61 | rotate: false
62 | xy: 170, 44
63 | size: 1, 1
64 | split: 0, 0, 0, 0
65 | orig: 1, 1
66 | offset: 0, 0
67 | index: -1
68 | default-rect
69 | rotate: false
70 | xy: 38, 25
71 | size: 3, 3
72 | split: 1, 1, 1, 1
73 | orig: 3, 3
74 | offset: 0, 0
75 | index: -1
76 | default-rect-down
77 | rotate: false
78 | xy: 170, 46
79 | size: 3, 3
80 | split: 1, 1, 1, 1
81 | orig: 3, 3
82 | offset: 0, 0
83 | index: -1
84 | default-round
85 | rotate: false
86 | xy: 112, 29
87 | size: 12, 20
88 | split: 5, 5, 5, 4
89 | pad: 4, 4, 1, 1
90 | orig: 12, 20
91 | offset: 0, 0
92 | index: -1
93 | default-round-down
94 | rotate: false
95 | xy: 99, 29
96 | size: 12, 20
97 | split: 5, 5, 5, 4
98 | pad: 4, 4, 1, 1
99 | orig: 12, 20
100 | offset: 0, 0
101 | index: -1
102 | default-round-large
103 | rotate: false
104 | xy: 57, 29
105 | size: 20, 20
106 | split: 5, 5, 5, 4
107 | orig: 20, 20
108 | offset: 0, 0
109 | index: -1
110 | default-scroll
111 | rotate: false
112 | xy: 78, 29
113 | size: 20, 20
114 | split: 2, 2, 2, 2
115 | orig: 20, 20
116 | offset: 0, 0
117 | index: -1
118 | default-select
119 | rotate: false
120 | xy: 29, 29
121 | size: 27, 20
122 | split: 4, 14, 4, 4
123 | orig: 27, 20
124 | offset: 0, 0
125 | index: -1
126 | default-select-selection
127 | rotate: false
128 | xy: 26, 16
129 | size: 3, 3
130 | split: 1, 1, 1, 1
131 | orig: 3, 3
132 | offset: 0, 0
133 | index: -1
134 | default-slider
135 | rotate: false
136 | xy: 29, 20
137 | size: 8, 8
138 | split: 2, 2, 2, 2
139 | orig: 8, 8
140 | offset: 0, 0
141 | index: -1
142 | default-slider-knob
143 | rotate: false
144 | xy: 1, 1
145 | size: 9, 18
146 | orig: 9, 18
147 | offset: 0, 0
148 | index: -1
149 | default-splitpane
150 | rotate: false
151 | xy: 17, 1
152 | size: 5, 3
153 | split: 0, 5, 0, 0
154 | orig: 5, 3
155 | offset: 0, 0
156 | index: -1
157 | default-splitpane-vertical
158 | rotate: false
159 | xy: 125, 29
160 | size: 3, 5
161 | split: 0, 0, 0, 5
162 | orig: 3, 5
163 | offset: 0, 0
164 | index: -1
165 | default-window
166 | rotate: false
167 | xy: 1, 20
168 | size: 27, 29
169 | split: 4, 3, 20, 3
170 | orig: 27, 29
171 | offset: 0, 0
172 | index: -1
173 | selection
174 | rotate: false
175 | xy: 174, 48
176 | size: 1, 1
177 | orig: 1, 1
178 | offset: 0, 0
179 | index: -1
180 | tree-minus
181 | rotate: false
182 | xy: 140, 35
183 | size: 14, 14
184 | orig: 14, 14
185 | offset: 0, 0
186 | index: -1
187 | tree-plus
188 | rotate: false
189 | xy: 155, 35
190 | size: 14, 14
191 | orig: 14, 14
192 | offset: 0, 0
193 | index: -1
194 | white
195 | rotate: false
196 | xy: 129, 31
197 | size: 3, 3
198 | orig: 3, 3
199 | offset: 0, 0
200 | index: -1
201 |
--------------------------------------------------------------------------------
/android/assets/skins/uiskin.json:
--------------------------------------------------------------------------------
1 | {
2 | com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: default.fnt } },
3 | com.badlogic.gdx.graphics.Color: {
4 | green: { a: 1, b: 0, g: 1, r: 0 },
5 | white: { a: 1, b: 1, g: 1, r: 1 },
6 | red: { a: 1, b: 0, g: 0, r: 1 },
7 | black: { a: 1, b: 0, g: 0, r: 0 },
8 | },
9 | com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
10 | dialogDim: { name: white, color: { r: 0, g: 0, b: 0, a: 0.45 } },
11 | },
12 | com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
13 | default: { down: default-round-down, up: default-round },
14 | toggle: { down: default-round-down, checked: default-round-down, up: default-round }
15 | },
16 | com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
17 | default: { down: default-round-down, up: default-round, font: default-font, fontColor: white },
18 | toggle: { down: default-round-down, up: default-round, checked: default-round-down, font: default-font, fontColor: white, downFontColor: red }
19 | },
20 | com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: {
21 | default: { vScroll: default-scroll, hScrollKnob: default-round-large, background: default-rect, hScroll: default-scroll, vScrollKnob: default-round-large }
22 | },
23 | com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: {
24 | default: {
25 | font: default-font, fontColor: white, background: default-select,
26 | scrollStyle: default,
27 | listStyle: { font: default-font, selection: default-select-selection }
28 | }
29 | },
30 | com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: {
31 | default-vertical: { handle: default-splitpane-vertical },
32 | default-horizontal: { handle: default-splitpane }
33 | },
34 | com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: {
35 | default: { titleFont: default-font, background: default-window, titleFontColor: white },
36 | dialog: { titleFont: default-font, background: default-window, titleFontColor: white, stageBackground: dialogDim }
37 | },
38 | com.badlogic.gdx.scenes.scene2d.ui.ProgressBar$ProgressBarStyle: {
39 | default-horizontal: { background: default-slider, knob: default-slider-knob },
40 | default-vertical: { background: default-slider, knob: default-round-large }
41 | },
42 | com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: {
43 | default-horizontal: { background: default-slider, knob: default-slider-knob },
44 | default-vertical: { background: default-slider, knob: default-round-large }
45 | },
46 | com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
47 | default: { font: default-font, fontColor: white }
48 | },
49 | com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: {
50 | default: { selection: selection, background: textfield, font: default-font, fontColor: white, cursor: cursor }
51 | },
52 | com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: {
53 | default: { checkboxOn: check-on, checkboxOff: check-off, font: default-font, fontColor: white }
54 | },
55 | com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: {
56 | default: { fontColorUnselected: white, selection: selection, fontColorSelected: white, font: default-font }
57 | },
58 | com.badlogic.gdx.scenes.scene2d.ui.Touchpad$TouchpadStyle: {
59 | default: { background: default-pane, knob: default-round-large }
60 | },
61 | com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: {
62 | default: { minus: tree-minus, plus: tree-plus, selection: default-select-selection }
63 | },
64 | }
65 |
--------------------------------------------------------------------------------
/android/assets/skins/uiskin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/skins/uiskin.png
--------------------------------------------------------------------------------
/android/assets/sounds/bark.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/sounds/bark.mp3
--------------------------------------------------------------------------------
/android/assets/sounds/whine.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/sounds/whine.mp3
--------------------------------------------------------------------------------
/android/assets/sounds/whistle.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/assets/sounds/whistle.mp3
--------------------------------------------------------------------------------
/android/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/ic_launcher-web.png
--------------------------------------------------------------------------------
/android/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
22 | -verbose
23 |
24 | -dontwarn android.support.**
25 | -dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication
26 | -dontwarn com.badlogic.gdx.utils.GdxBuild
27 | -dontwarn com.badlogic.gdx.physics.box2d.utils.Box2DBuild
28 | -dontwarn com.badlogic.gdx.jnigen.BuildTarget*
29 |
30 | -keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {
31 | (com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration);
32 | }
33 |
34 | -keepclassmembers class com.badlogic.gdx.physics.box2d.World {
35 | boolean contactFilter(long, long);
36 | void beginContact(long);
37 | void endContact(long);
38 | void preSolve(long, long);
39 | void postSolve(long, long);
40 | boolean reportFixture(long);
41 | float reportRayFixture(long, float, float, float, float, float);
42 | }
43 |
--------------------------------------------------------------------------------
/android/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 |
--------------------------------------------------------------------------------
/android/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/android/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | my-gdx-game
5 |
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/src/com/mygdx/game/android/AndroidLauncher.java:
--------------------------------------------------------------------------------
1 | package com.mygdx.game.android;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.badlogic.gdx.backends.android.AndroidApplication;
6 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
7 | import com.mygdx.game.GdxDemo3D;
8 |
9 | public class AndroidLauncher extends AndroidApplication {
10 | @Override
11 | protected void onCreate (Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
14 | initialize(new GdxDemo3D(), config);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/core/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path: jinput-platform-2.0.5-natives-osx.jar jinput-platform-2.0.
3 | 5-natives-linux.jar gdx-freetype-1.6.6-SNAPSHOT.jar gdx-backend-andro
4 | id-1.6.6-SNAPSHOT.jar jinput-2.0.5.jar lwjgl_util-2.9.2.jar robovm-co
5 | coatouch-1.6.0.jar ashley-1.5.0.jar gdx-controllers-1.6.6-SNAPSHOT.ja
6 | r gdx-controllers-android-1.6.6-SNAPSHOT.jar gdx-tools-1.6.6-SNAPSHOT
7 | .jar gdx-backend-robovm-1.6.6-SNAPSHOT.jar gdx-platform-1.6.6-SNAPSHO
8 | T-natives-desktop.jar gdx-1.6.6-SNAPSHOT.jar gdx-bullet-platform-1.6.
9 | 6-SNAPSHOT-natives-desktop.jar jlayer-1.0.1-gdx.jar gdx-platform-1.6.
10 | 6-SNAPSHOT-natives-ios.jar jinput-platform-2.0.5-natives-windows.jar
11 | lwjgl-platform-2.9.2-natives-windows.jar robovm-rt-1.6.0.jar gdx-cont
12 | rollers-platform-1.6.6-SNAPSHOT-natives-desktop.jar gdx-bullet-1.6.6-
13 | SNAPSHOT.jar gdx-ai-1.5.0.jar lwjgl-2.9.2.jar lwjgl-platform-2.9.2-na
14 | tives-linux.jar gdx-backend-headless-1.6.6-SNAPSHOT.jar gdx-freetype-
15 | platform-1.6.6-SNAPSHOT-natives-desktop.jar lwjgl-platform-2.9.2-nati
16 | ves-osx.jar gdx-bullet-platform-1.6.6-SNAPSHOT-natives-ios.jar gdx-fr
17 | eetype-platform-1.6.6-SNAPSHOT-natives-ios.jar robovm-objc-1.6.0.jar
18 | jorbis-0.0.17.jar gdx-controllers-desktop-1.6.6-SNAPSHOT.jar gdx-back
19 | end-lwjgl-1.6.6-SNAPSHOT.jar jutils-1.0.0.jar
20 | Main-Class: com.mygdx.game.desktop.DesktopLauncher
21 |
22 |
--------------------------------------------------------------------------------
/core/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "java"
2 |
3 | sourceCompatibility = 1.6
4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
5 |
6 | sourceSets.main.java.srcDirs = [ "src/" ]
7 |
8 |
9 | eclipse.project {
10 | name = appName + "-core"
11 | }
12 |
--------------------------------------------------------------------------------
/core/src/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Main-Class: com.mygdx.game.desktop.DesktopLauncher
3 |
4 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/GdxDemo3D.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game;
18 |
19 | import com.badlogic.gdx.Application;
20 | import com.badlogic.gdx.Gdx;
21 | import com.badlogic.gdx.Screen;
22 | import com.badlogic.gdx.utils.Logger;
23 | import com.mygdx.game.gdxkit.GdxGame;
24 |
25 | /**
26 | * @author jsjolund
27 | */
28 | public class GdxDemo3D extends GdxGame {
29 |
30 | private static final String TAG = "GdxDemo3D";
31 |
32 | public static final int WIDTH = 1280;
33 | public static final int HEIGHT = 720;
34 |
35 | public void toggleFullscreen() {
36 | if (Gdx.graphics.isFullscreen()) {
37 | Gdx.app.debug(TAG, "Disabling fullscreen w=" + WIDTH + ", h=" + HEIGHT);
38 | Gdx.graphics.setWindowedMode(WIDTH, HEIGHT);
39 | } else {
40 | Gdx.app.debug(TAG, "Enabling fullscreen w=" + Gdx.graphics.getDisplayMode().width + ", h="
41 | + Gdx.graphics.getDisplayMode().height);
42 | Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
43 | }
44 | }
45 |
46 | @Override
47 | public void create() {
48 | Gdx.app.setLogLevel(Application.LOG_DEBUG);
49 |
50 | getAssetManager().getLogger().setLevel(Logger.DEBUG);
51 |
52 | Screen currentScreen = new LoadingGameScreen(this, new GameScreen(this));
53 | setScreen(currentScreen);
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/LoadingGameScreen.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game;
18 |
19 | import com.badlogic.gdx.Gdx;
20 | import com.badlogic.gdx.graphics.Camera;
21 | import com.badlogic.gdx.graphics.Color;
22 | import com.badlogic.gdx.graphics.GL20;
23 | import com.badlogic.gdx.graphics.OrthographicCamera;
24 | import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
25 | import com.badlogic.gdx.utils.viewport.FitViewport;
26 | import com.badlogic.gdx.utils.viewport.Viewport;
27 | import com.mygdx.game.gdxkit.LoadableGdxScreen;
28 | import com.mygdx.game.gdxkit.LoadingGdxScreen;
29 |
30 | /** @author davebaol */
31 | public class LoadingGameScreen extends LoadingGdxScreen {
32 |
33 | private static final float PROGRESS_BAR_WIDTH = GdxDemo3D.WIDTH / 3f;
34 | private static final float PROGRESS_BAR_HEIGHT = GdxDemo3D.HEIGHT / 20f;
35 |
36 | private ShapeRenderer shapeRenderer;
37 | private Viewport viewport;
38 | private Camera camera;
39 |
40 | public LoadingGameScreen (GdxDemo3D game, LoadableGdxScreen nextScreen) {
41 | super(game, nextScreen);
42 | }
43 |
44 | @Override
45 | public void resize (int width, int height) {
46 | viewport.update(width, height);
47 | }
48 |
49 | @Override
50 | public void show () {
51 | camera = new OrthographicCamera();
52 | camera.position.set(GdxDemo3D.WIDTH * .5f, GdxDemo3D.HEIGHT * .5f, 0);
53 | camera.update();
54 | viewport = new FitViewport(GdxDemo3D.WIDTH, GdxDemo3D.HEIGHT, camera);
55 | shapeRenderer = new ShapeRenderer();
56 | }
57 |
58 | @Override
59 | public void renderProgress (float delta, float progress) {
60 | Gdx.gl.glClearColor(Color.BLACK.r, Color.BLACK.g, Color.BLACK.b, Color.BLACK.a);
61 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
62 |
63 | shapeRenderer.setProjectionMatrix(camera.projection);
64 | shapeRenderer.setTransformMatrix(camera.view);
65 | shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);
66 | float x = (GdxDemo3D.WIDTH - PROGRESS_BAR_WIDTH) / 2;
67 | float y = (GdxDemo3D.HEIGHT - PROGRESS_BAR_HEIGHT) / 2;
68 | float k = 4;
69 | shapeRenderer.setColor(Color.WHITE);
70 | shapeRenderer.rect(x - k, y - k, PROGRESS_BAR_WIDTH + k * 2, PROGRESS_BAR_HEIGHT + k * 2);
71 | shapeRenderer.setColor(Color.BLUE);
72 | shapeRenderer.rect(x, y, PROGRESS_BAR_WIDTH * progress, PROGRESS_BAR_HEIGHT);
73 | shapeRenderer.end();
74 | }
75 |
76 | @Override
77 | public void dispose () {
78 | shapeRenderer.dispose();
79 | }
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/blender/objects/BlenderCamera.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 |
18 | package com.mygdx.game.blender.objects;
19 |
20 | import com.badlogic.gdx.graphics.PerspectiveCamera;
21 |
22 | /**
23 | * Placeholder for a {@link PerspectiveCamera}
24 | *
25 | * @author jsjolund
26 | */
27 | public class BlenderCamera extends BlenderObject {
28 | public float fov;
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/blender/objects/BlenderEmpty.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.blender.objects;
18 |
19 | /**
20 | * A generic game object placeholder
21 | *
22 | * @author jsjolund
23 | */
24 | public class BlenderEmpty extends BlenderObject {
25 |
26 | // TODO: add blender empty shape type, e.g. box, cone
27 | }
28 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/blender/objects/BlenderLight.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.blender.objects;
18 |
19 | import com.badlogic.gdx.graphics.Color;
20 | import com.badlogic.gdx.graphics.g3d.environment.BaseLight;
21 |
22 | /**
23 | * Placeholder for a {@link BaseLight}
24 | *
25 | * @author jsjolund
26 | */
27 | public class BlenderLight extends BlenderObject {
28 | public Color lamp_color;
29 | public float lamp_energy;
30 | public float lamp_distance;
31 | public float lamp_falloff;
32 | }
33 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/blender/objects/BlenderModel.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.blender.objects;
18 |
19 | import com.badlogic.gdx.graphics.g3d.ModelInstance;
20 |
21 | /**
22 | * Placeholder for a {@link ModelInstance}
23 | *
24 | * @author jsjolund
25 | */
26 | public class BlenderModel extends BlenderObject {
27 | public String model_file_name;
28 |
29 | /**
30 | * Placeholder for a {@link ModelInstance}
31 | *
32 | * @param name
33 | * @param path
34 | */
35 | public BlenderModel(String name, String path) {
36 | this.model_file_name = path;
37 | super.name = name;
38 | }
39 |
40 | public BlenderModel() {
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/blender/objects/BlenderObject.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.blender.objects;
18 |
19 | import com.badlogic.gdx.math.Vector3;
20 | import com.badlogic.gdx.utils.ArrayMap;
21 |
22 | /**
23 | * A generic game object placeholder
24 | *
25 | * @author jsjolund
26 | */
27 | public abstract class BlenderObject {
28 |
29 | public String type;
30 | public String name;
31 | public Vector3 position;
32 | public Vector3 rotation;
33 | public Vector3 scale;
34 | public boolean[] layers;
35 | public ArrayMap custom_properties;
36 | }
37 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/gdxkit/GdxGame.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.gdxkit;
18 |
19 | import com.badlogic.gdx.Game;
20 | import com.badlogic.gdx.assets.AssetManager;
21 |
22 | /**
23 | * @author davebaol
24 | */
25 | public abstract class GdxGame extends Game {
26 |
27 | private final AssetManager assetManager;
28 |
29 | public GdxGame() {
30 | assetManager = new AssetManager();
31 | }
32 |
33 | public AssetManager getAssetManager() {
34 | return assetManager;
35 | }
36 |
37 | @Override
38 | public void dispose () {
39 | assetManager.dispose();
40 | super.dispose();
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/gdxkit/GdxScreen.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.gdxkit;
18 |
19 | import com.badlogic.gdx.ScreenAdapter;
20 |
21 | /**
22 | * @author davebaol
23 | */
24 | public class GdxScreen extends ScreenAdapter {
25 |
26 | private final G game;
27 |
28 | public GdxScreen (G game) {
29 | this.game = game;
30 | }
31 |
32 | public G getGame () {
33 | return game;
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/gdxkit/LoadableGdxScreen.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.gdxkit;
18 |
19 |
20 | /**
21 | * @author davebaol
22 | */
23 | public abstract class LoadableGdxScreen extends GdxScreen {
24 |
25 | public LoadableGdxScreen (G game) {
26 | super(game);
27 | }
28 |
29 | public abstract void loadingFinished ();
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/gdxkit/LoadingGdxScreen.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.gdxkit;
18 |
19 | /** @author davebaol */
20 | public abstract class LoadingGdxScreen extends GdxScreen {
21 |
22 | private final LoadableGdxScreen nextScreen;
23 |
24 | public LoadingGdxScreen (G game, LoadableGdxScreen nextScreen) {
25 | super(game);
26 | this.nextScreen = nextScreen;
27 | }
28 |
29 | public abstract void renderProgress (float delta, float progress);
30 |
31 | @Override
32 | public final void render (float delta) {
33 | if (getGame().getAssetManager().update()) {
34 | nextScreen.loadingFinished();
35 | getGame().setScreen(nextScreen);
36 | }
37 |
38 | renderProgress(delta, getGame().getAssetManager().getProgress());
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/Billboard.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects;
18 |
19 | import com.badlogic.gdx.graphics.Camera;
20 | import com.badlogic.gdx.graphics.g3d.Model;
21 | import com.badlogic.gdx.math.Matrix4;
22 | import com.badlogic.gdx.math.Quaternion;
23 | import com.badlogic.gdx.math.Vector3;
24 |
25 | /**
26 | * A simple billboard-like class which rotates a model to face the camera on update.
27 | *
28 | * @author jsjolund
29 | */
30 | public class Billboard extends GameModel {
31 |
32 | private final Vector3 offset = new Vector3();
33 | private final Vector3 worldPos = new Vector3();
34 | private final Quaternion quat = new Quaternion();
35 | private boolean faceUp;
36 | private Matrix4 followTransform;
37 | private Camera camera;
38 |
39 | /**
40 | * @param model The model which is to be instantiated
41 | * @param name Id of the model (doesn't really matter)
42 | * @param camera The camera which the billboard should face
43 | * @param faceUp If true, the model will always face the Y-axis, but otherwise rotate with the camera
44 | * @param followTransform The billboard will follow the translation of this matrix
45 | * @param offset Constant offset from the follow-matrix translation
46 | */
47 | public Billboard(Model model, String name, Camera camera, boolean faceUp, Matrix4 followTransform, Vector3 offset) {
48 | super(model, name, followTransform.getTranslation(new Vector3()), new Vector3(), new Vector3(1, 1, 1));
49 | this.faceUp = faceUp;
50 | this.offset.set(offset);
51 | this.followTransform = followTransform;
52 | this.camera = camera;
53 | }
54 |
55 | public void setCamera(Camera camera) {
56 | this.camera = camera;
57 | }
58 |
59 | public void setFollowTransform(Matrix4 followTransform, Vector3 offset) {
60 | this.followTransform = followTransform;
61 | this.offset.set(offset);
62 | }
63 |
64 | @Override
65 | public void update(float deltaTime) {
66 | super.update(deltaTime);
67 | followTransform.getTranslation(worldPos);
68 | camera.view.getRotation(quat).conjugate();
69 | if (faceUp) {
70 | modelInstance.transform.setFromEulerAngles(quat.getYaw(), -90, quat.getRoll());
71 | } else {
72 | modelInstance.transform.set(quat);
73 | }
74 | modelInstance.transform.setTranslation(worldPos.add(offset));
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/GameCharacter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects;
18 |
19 | import com.badlogic.gdx.graphics.g3d.Model;
20 | import com.badlogic.gdx.graphics.g3d.model.Node;
21 | import com.badlogic.gdx.math.Matrix4;
22 | import com.badlogic.gdx.math.Quaternion;
23 | import com.badlogic.gdx.math.Vector3;
24 | import com.badlogic.gdx.physics.bullet.collision.btCollisionShape;
25 | import com.mygdx.game.utilities.BulletSteeringUtils;
26 |
27 | /**
28 | * @author jsjolund
29 | */
30 | public abstract class GameCharacter extends SteerableBody {
31 |
32 | public final Vector3 selectionMarkerOffset;
33 |
34 | public GameCharacter(Model model, String name,
35 | Vector3 location, Vector3 rotation, Vector3 scale,
36 | btCollisionShape shape, float mass,
37 | short belongsToFlag, short collidesWithFlag,
38 | boolean callback, boolean noDeactivate,
39 | SteerSettings steerSettings) {
40 |
41 | super(model, name, location, rotation, scale, shape, mass, belongsToFlag, collidesWithFlag, callback,
42 | noDeactivate, steerSettings);
43 | selectionMarkerOffset = new Vector3(0, -halfExtents.y * 0.95f, 0);
44 | }
45 |
46 | private final static Vector3 TMP_V1 = new Vector3();
47 | private final static Vector3 TMP_V2 = new Vector3();
48 | private final static Vector3 TMP_V3 = new Vector3();
49 | private final static Quaternion TMP_Q = new Quaternion();
50 | private final static Matrix4 TMP_M = new Matrix4();
51 |
52 | public float getBoneOrientation(String nodeId) {
53 | return BulletSteeringUtils.vectorToAngle(getBoneDirection(nodeId, TMP_V3));
54 | }
55 |
56 | /**
57 | * Direction vector of an armature bone, in world coordinate system.
58 | *
59 | * @param nodeId Name of the bone
60 | * @param out Output vector
61 | * @return Output vector for chaining
62 | */
63 | public Vector3 getBoneDirection(String nodeId, Vector3 out) {
64 | Node node = modelInstance.getNode(nodeId);
65 | Node endPointNode = (node.hasChildren()) ? node.getChild(0) : node;
66 | node.globalTransform.getTranslation(TMP_V1);
67 | endPointNode.globalTransform.getTranslation(TMP_V2);
68 | TMP_V1.sub(TMP_V2).scl(-1);
69 | modelInstance.transform.getRotation(TMP_Q);
70 | TMP_Q.transform(TMP_V1);
71 | return out.set(TMP_V1).nor();
72 | }
73 |
74 | /**
75 | * Midpoint of an armature bone, in world coordinate system.
76 | *
77 | * @param nodeId Name of the bone
78 | * @param out Output vector
79 | * @return Output vector for chaining
80 | */
81 | public Vector3 getBoneMidpointWorldPosition(String nodeId, Vector3 out) {
82 | Node node = modelInstance.getNode(nodeId);
83 | Node endPointNode = (node.hasChildren()) ? node.getChild(0) : node;
84 | // Use global transform to account for model scaling
85 | node.globalTransform.getTranslation(TMP_V1);
86 | TMP_V3.set(TMP_V1);
87 | endPointNode.globalTransform.getTranslation(TMP_V2);
88 | TMP_V3.sub(TMP_V1.sub(TMP_V2).scl(0.5f));
89 | modelInstance.transform.getRotation(TMP_Q, true).transform(TMP_V3);
90 | TMP_V3.add(getPosition());
91 | return out.set(TMP_V3);
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/GameObject.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects;
18 |
19 | import com.badlogic.gdx.math.collision.Ray;
20 | import com.badlogic.gdx.utils.Bits;
21 | import com.mygdx.game.utilities.Entity;
22 |
23 | /**
24 | * @author jsjolund
25 | */
26 | public abstract class GameObject extends Entity {
27 | public final String name;
28 |
29 | public GameObject(String name) {
30 | this.name = name;
31 | }
32 |
33 | public abstract void update(float deltaTime);
34 |
35 | public abstract void dispose();
36 |
37 | public void handleMovementRequest(Ray ray, Bits visibleLayers) {
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/InvisibleBody.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 |
18 | package com.mygdx.game.objects;
19 |
20 | import com.badlogic.gdx.math.Matrix4;
21 | import com.badlogic.gdx.math.Vector3;
22 | import com.badlogic.gdx.physics.bullet.collision.Collision;
23 | import com.badlogic.gdx.physics.bullet.collision.btCollisionObject;
24 | import com.badlogic.gdx.physics.bullet.collision.btCollisionShape;
25 | import com.badlogic.gdx.physics.bullet.dynamics.btRigidBody;
26 |
27 | /**
28 | * @author jsjolund
29 | */
30 | public class InvisibleBody extends GameObject {
31 |
32 | private final static Vector3 localInertia = new Vector3();
33 | public final btRigidBody body;
34 | public final short belongsToFlag;
35 | public final short collidesWithFlag;
36 | public final btCollisionShape shape;
37 | public final btRigidBody.btRigidBodyConstructionInfo constructionInfo;
38 | protected final float mass;
39 |
40 | public InvisibleBody(String name,
41 | btCollisionShape shape,
42 | float mass,
43 | Matrix4 transform,
44 | short belongsToFlag,
45 | short collidesWithFlag,
46 | boolean callback,
47 | boolean noDeactivate) {
48 | super(name);
49 | this.mass = mass;
50 | this.shape = shape;
51 | this.belongsToFlag = belongsToFlag;
52 | this.collidesWithFlag = collidesWithFlag;
53 |
54 | if (mass > 0f) {
55 | shape.calculateLocalInertia(mass, localInertia);
56 | } else {
57 | localInertia.set(0, 0, 0);
58 |
59 | }
60 | this.constructionInfo = new btRigidBody.btRigidBodyConstructionInfo(
61 | mass, null, shape, localInertia);
62 | body = new btRigidBody(constructionInfo);
63 | body.setWorldTransform(transform);
64 | body.setContactCallbackFlag(belongsToFlag);
65 | if (callback) {
66 | body.setCollisionFlags(body.getCollisionFlags()
67 | | btCollisionObject.CollisionFlags.CF_CUSTOM_MATERIAL_CALLBACK);
68 | }
69 | if (noDeactivate) {
70 | body.setActivationState(Collision.DISABLE_DEACTIVATION);
71 | }
72 | }
73 |
74 | public InvisibleBody(String id,
75 | btCollisionShape shape,
76 | float mass,
77 | Vector3 location,
78 | Vector3 rotation,
79 | short belongsToFlag,
80 | short collidesWithFlag,
81 | boolean callback,
82 | boolean noDeactivate) {
83 | this(id, shape, mass,
84 | new Matrix4()
85 | .rotate(Vector3.X, rotation.x)
86 | .rotate(Vector3.Z, rotation.z)
87 | .rotate(Vector3.Y, rotation.y)
88 | .setTranslation(location),
89 | belongsToFlag, collidesWithFlag, callback, noDeactivate);
90 | }
91 |
92 | @Override
93 | public void update(float deltaTime) {
94 |
95 | }
96 |
97 | @Override
98 | public void dispose() {
99 | // Let the calling class be responsible for shape dispose since it can be reused
100 | // shape.dispose();
101 | constructionInfo.dispose();
102 | body.dispose();
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/Stick.java:
--------------------------------------------------------------------------------
1 | package com.mygdx.game.objects;
2 |
3 | import com.badlogic.gdx.graphics.g3d.Model;
4 | import com.badlogic.gdx.math.Vector3;
5 | import com.badlogic.gdx.physics.bullet.collision.btCollisionShape;
6 |
7 | public class Stick extends GameModelBody {
8 |
9 | public HumanCharacter owner;
10 | public boolean hasLanded;
11 |
12 | /**
13 | * Creates a model with rigid body
14 | *
15 | * @param model Model to instantiate
16 | * @param name Name of model
17 | * @param location World position at which to place the model instance
18 | * @param rotation The rotation of the model instance in degrees
19 | * @param scale Scale of the model instance
20 | * @param shape Collision shape with which to construct a rigid body
21 | * @param mass Mass of the body
22 | * @param belongsToFlag Flag for which collision layers this body belongs to
23 | * @param collidesWithFlag Flag for which collision layers this body collides with
24 | * @param callback If this body should trigger collision contact callbacks.
25 | * @param noDeactivate If this body should never 'sleep'
26 | */
27 | public Stick(Model model, String name, Vector3 location, Vector3 rotation, Vector3 scale, btCollisionShape shape, float mass, short belongsToFlag, short collidesWithFlag, boolean callback, boolean noDeactivate) {
28 | super(model, name, location, rotation, scale, shape, mass, belongsToFlag, collidesWithFlag, callback, noDeactivate);
29 | }
30 |
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/AlreadyCriedForHumanDeathCondition.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.LeafTask;
20 | import com.badlogic.gdx.ai.btree.Task;
21 | import com.mygdx.game.objects.DogCharacter;
22 |
23 | /**
24 | * Condition task that checks if the dog has already cried after the man has died.
25 | *
26 | * @author davebaol
27 | */
28 | public class AlreadyCriedForHumanDeathCondition extends LeafTask {
29 |
30 | public AlreadyCriedForHumanDeathCondition () {
31 | }
32 |
33 | @Override
34 | public Status execute () {
35 | return getObject().alreadyCriedForHumanDeath? Status.SUCCEEDED : Status.FAILED;
36 | }
37 |
38 | @Override
39 | protected Task copyTo (Task task) {
40 | return task;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/CalculatePathToHumanTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.LeafTask;
20 | import com.badlogic.gdx.ai.btree.Task;
21 | import com.badlogic.gdx.math.Vector3;
22 | import com.mygdx.game.GameScreen;
23 | import com.mygdx.game.objects.DogCharacter;
24 | import com.mygdx.game.objects.HumanCharacter;
25 | import com.mygdx.game.pathfinding.Triangle;
26 |
27 | /**
28 | * Action task that traces a path from the dog's current position to its owner (actually, 1 meter in front of him).
29 | *
30 | * @author davebaol
31 | */
32 | public class CalculatePathToHumanTask extends LeafTask {
33 |
34 | private static final Vector3 TMP_VEC_1 = new Vector3();
35 | private static final Vector3 TMP_VEC_2 = new Vector3();
36 | private static final Vector3 TMP_VEC_3 = new Vector3();
37 |
38 | public CalculatePathToHumanTask() {
39 | }
40 |
41 | @Override
42 | public Status execute() {
43 | DogCharacter dog = getObject();
44 | HumanCharacter human = dog.human;
45 |
46 | Vector3 humanDirection = human.getDirection(TMP_VEC_1);
47 | Vector3 humanPosition = human.getGroundPosition(TMP_VEC_2);
48 | float targetDogDistanceToHuman = 2;
49 | Vector3 dogTargetPoint = TMP_VEC_3;
50 |
51 | Triangle dogTargetTri = GameScreen.screen.engine.getScene().navMesh.getClosestValidPointAt(
52 | humanPosition,
53 | humanDirection,
54 | targetDogDistanceToHuman,
55 | dogTargetPoint, human.visibleOnLayers);
56 |
57 | return dog.followPath(dogTargetTri, dogTargetPoint) ? Status.SUCCEEDED : Status.FAILED;
58 | }
59 |
60 | @Override
61 | protected Task copyTo(Task task) {
62 | return task;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/CalculatePathToStickTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.LeafTask;
20 | import com.badlogic.gdx.ai.btree.Task;
21 | import com.badlogic.gdx.math.Vector3;
22 | import com.mygdx.game.GameScreen;
23 | import com.mygdx.game.objects.DogCharacter;
24 | import com.mygdx.game.pathfinding.NavMesh;
25 | import com.mygdx.game.pathfinding.Triangle;
26 |
27 | /**
28 | * Action task that traces a path from the dog's current position to the stick.
29 | *
30 | * @author davebaol
31 | */
32 | public class CalculatePathToStickTask extends LeafTask {
33 |
34 | private final static Vector3 TMP_V1 = new Vector3();
35 | private final static Vector3 TMP_V2 = new Vector3();
36 |
37 | public CalculatePathToStickTask() {
38 | }
39 |
40 | public void startAnimation(DogCharacter dog) {
41 | }
42 |
43 | @Override
44 | public void start() {
45 | getObject().stickThrown = false;
46 | }
47 |
48 | @Override
49 | public Status execute() {
50 | DogCharacter dog = getObject();
51 |
52 | NavMesh navMesh = GameScreen.screen.engine.getScene().navMesh;
53 |
54 | Vector3 stickPos = dog.human.stick.body.getWorldTransform().getTranslation(TMP_V1);
55 | Vector3 stickNavmeshPos = TMP_V2;
56 | Triangle stickNavmeshTri = navMesh.verticalRayTest(stickPos, TMP_V2, null);
57 |
58 | if (stickNavmeshTri == null) {
59 | stickNavmeshTri = navMesh.getClosestTriangle(stickPos, stickNavmeshPos, null);
60 | }
61 |
62 | return dog.followPath(stickNavmeshTri, stickNavmeshPos) ? Status.SUCCEEDED : Status.FAILED;
63 | }
64 |
65 | @Override
66 | protected Task copyTo(Task task) {
67 | return task;
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/FollowPathTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.Task;
20 | import com.mygdx.game.objects.DogCharacter;
21 | import com.mygdx.game.objects.DogCharacter.DogSteerSettings;
22 |
23 | /**
24 | * Movement task that makes the dog follow the current path.
25 | *
26 | * @author davebaol
27 | */
28 | public class FollowPathTask extends MovementAnimationTaskBase {
29 |
30 | public FollowPathTask () {
31 | }
32 |
33 | @Override
34 | protected void setSteeringLimits (DogCharacter dog, float steeringMultiplier) {
35 | super.setSteeringLimits(dog, steeringMultiplier);
36 | dog.followPathSteerer.followPathSB.setDecelerationRadius(DogSteerSettings.decelerationRadius * steeringMultiplier);
37 | }
38 |
39 | @Override
40 | public Status execute () {
41 | DogCharacter dog = getObject();
42 | updateAnimation(dog);
43 | if (getStatus() == Task.Status.RUNNING && !dog.isSteering()) {
44 | return Status.SUCCEEDED;
45 | }
46 | return Status.RUNNING;
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/GiveStickTask.java:
--------------------------------------------------------------------------------
1 | package com.mygdx.game.objects.dog;
2 |
3 | import com.badlogic.gdx.ai.btree.LeafTask;
4 | import com.badlogic.gdx.ai.btree.Task;
5 | import com.mygdx.game.objects.DogCharacter;
6 |
7 | public class GiveStickTask extends LeafTask {
8 |
9 | @Override
10 | public Task.Status execute() {
11 | if (getObject().stickCarried)
12 | getObject().giveStickToHuman();
13 | return Status.SUCCEEDED;
14 | }
15 |
16 | @Override
17 | protected Task copyTo(Task task) {
18 | return task;
19 | }
20 | }
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/HumanWantToPlayCondition.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.LeafTask;
20 | import com.badlogic.gdx.ai.btree.Task;
21 | import com.mygdx.game.objects.DogCharacter;
22 |
23 | /**
24 | * Condition task that checks if the man wants to play.
25 | *
26 | * @author davebaol
27 | */
28 | public class HumanWantToPlayCondition extends LeafTask {
29 |
30 | public HumanWantToPlayCondition () {
31 | }
32 |
33 | @Override
34 | public Status execute () {
35 | return getObject().humanWantToPlay? Status.SUCCEEDED : Status.FAILED;
36 | }
37 |
38 | @Override
39 | protected Task copyTo (Task task) {
40 | return task;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/IsHumanDeadCondition.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.LeafTask;
20 | import com.badlogic.gdx.ai.btree.Task;
21 | import com.mygdx.game.objects.DogCharacter;
22 |
23 | /**
24 | * Condition task that checks if the dog's owner is dead.
25 | *
26 | * @author davebaol
27 | */
28 | public class IsHumanDeadCondition extends LeafTask {
29 |
30 | public IsHumanDeadCondition () {
31 | }
32 |
33 | @Override
34 | public Status execute () {
35 | return getObject().humanIsDead? Status.SUCCEEDED : Status.FAILED;
36 | }
37 |
38 | @Override
39 | protected Task copyTo (Task task) {
40 | return task;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/IsHumanInRangeCondition.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.LeafTask;
20 | import com.badlogic.gdx.ai.btree.Task;
21 | import com.badlogic.gdx.ai.btree.annotation.TaskAttribute;
22 | import com.mygdx.game.objects.DogCharacter;
23 |
24 | /**
25 | * Condition task that checks if the dog's owner is within a given radius in meters.
26 | *
27 | * @author davebaol
28 | */
29 | public class IsHumanInRangeCondition extends LeafTask {
30 |
31 | @TaskAttribute(required=true)
32 | public float meters;
33 |
34 | public IsHumanInRangeCondition () {
35 | this(20);
36 | }
37 |
38 | public IsHumanInRangeCondition (float meters) {
39 | this.meters = meters;
40 | }
41 |
42 | @Override
43 | public Status execute () {
44 | return getObject().isHumanCloseEnough(meters)? Status.SUCCEEDED : Status.FAILED;
45 | }
46 |
47 | @Override
48 | protected Task copyTo (Task task) {
49 | ((IsHumanInRangeCondition)task).meters = meters;
50 | return task;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/LieDownTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 |
20 | /**
21 | * Idle task that makes the dog lie down.
22 | *
23 | * @author davebaol
24 | */
25 | public class LieDownTask extends LoopedAnimationTaskBase {
26 |
27 | public LieDownTask () {
28 | }
29 |
30 | @Override
31 | protected TaskAnimation getTaskAnimation () {
32 | return TaskAnimation.LieDown;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/MovementAnimationTaskBase.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.Task;
20 | import com.badlogic.gdx.ai.btree.annotation.TaskAttribute;
21 | import com.mygdx.game.objects.DogCharacter;
22 | import com.mygdx.game.objects.DogCharacter.DogSteerSettings;
23 |
24 | /**
25 | * The base class for dog's movement animated tasks. It defines the task attribute {@link #gait} that allows you to specify
26 | * how the dog should move, i.e. the animation to use. Typical values are {@link TaskAnimation#Walk} and {@link TaskAnimation#Run}
27 | * but there's nothing stopping you from using any of the other values defined by the {@link TaskAnimation} enumeration, although
28 | * most of them are not suitable for movement.
29 | *
30 | * @author davebaol
31 | */
32 | public abstract class MovementAnimationTaskBase extends LoopedAnimationTaskBase {
33 |
34 | @TaskAttribute(required=true)
35 | public TaskAnimation gait;
36 |
37 | public MovementAnimationTaskBase () {
38 | this.gait = TaskAnimation.Walk;
39 | }
40 |
41 | @Override
42 | protected TaskAnimation getTaskAnimation() {
43 | return gait;
44 | }
45 |
46 | @Override
47 | protected void setSteeringLimits (DogCharacter dog, float steeringMultiplier) {
48 | dog.setMaxLinearSpeed(DogSteerSettings.maxLinearSpeed * steeringMultiplier);
49 | dog.setMaxLinearAcceleration(DogSteerSettings.maxLinearAcceleration * steeringMultiplier);
50 | dog.setMaxAngularSpeed(DogSteerSettings.maxAngularSpeed * steeringMultiplier);
51 | dog.setMaxAngularAcceleration(DogSteerSettings.maxAngularAcceleration * steeringMultiplier);
52 | }
53 |
54 | @Override
55 | protected Task copyTo (Task task) {
56 | MovementAnimationTaskBase thisTask = (MovementAnimationTaskBase)task;
57 | thisTask.gait = gait;
58 | return super.copyTo(task);
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/OneShotAnimationTaskBase.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.mygdx.game.objects.DogCharacter;
20 |
21 | /**
22 | * The base class for dog's animated tasks that must last for one animation loop.
23 | * The task keeps running until the animation is completed, which finally makes the task succeed.
24 | *
25 | * @author davebaol
26 | */
27 | public abstract class OneShotAnimationTaskBase extends LoopedAnimationTaskBase {
28 |
29 | public OneShotAnimationTaskBase () {
30 | super(true); // Use an animation listener
31 | }
32 |
33 | @Override
34 | protected int getAnimationLoopCount () {
35 | return 1; // one shot
36 | }
37 |
38 | @Override
39 | public Status execute () {
40 | DogCharacter dog = getObject();
41 | updateAnimation(dog);
42 | return animationListener == dog.currentAnimationListener && animationListener.isAnimationCompleted()? Status.SUCCEEDED : Status.RUNNING;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/PickUpStickTask.java:
--------------------------------------------------------------------------------
1 | package com.mygdx.game.objects.dog;
2 |
3 |
4 | import com.badlogic.gdx.ai.btree.LeafTask;
5 | import com.badlogic.gdx.ai.btree.Task;
6 | import com.mygdx.game.objects.DogCharacter;
7 |
8 | public class PickUpStickTask extends LeafTask {
9 |
10 | @Override
11 | public Status execute() {
12 | getObject().setCarryStick();
13 | return Status.SUCCEEDED;
14 | }
15 |
16 | @Override
17 | protected Task copyTo(Task task) {
18 | return task;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/PissTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 |
20 | /**
21 | * A one shot animation task that makes the dog piss.
22 | *
23 | * @author davebaol
24 | */
25 | public class PissTask extends OneShotAnimationTaskBase {
26 |
27 | public PissTask () {
28 | }
29 |
30 | @Override
31 | protected TaskAnimation getTaskAnimation () {
32 | return TaskAnimation.Piss;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/SetAlreadyCriedForHumanDeathTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.LeafTask;
20 | import com.badlogic.gdx.ai.btree.Task;
21 | import com.mygdx.game.objects.DogCharacter;
22 |
23 | /**
24 | * Action task that sets the dog's property {@link DogCharacter#alreadyCriedForHumanDeath}.
25 | *
26 | * @author davebaol
27 | */
28 | public class SetAlreadyCriedForHumanDeathTask extends LeafTask {
29 |
30 | public SetAlreadyCriedForHumanDeathTask() {
31 | }
32 |
33 | @Override
34 | public Status execute() {
35 | DogCharacter dog = getObject();
36 | dog.alreadyCriedForHumanDeath = true;
37 | return Status.SUCCEEDED;
38 | }
39 |
40 | @Override
41 | protected Task copyTo(Task task) {
42 | return task;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/SetThrowButtonTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.LeafTask;
20 | import com.badlogic.gdx.ai.btree.Task;
21 | import com.badlogic.gdx.ai.btree.annotation.TaskAttribute;
22 | import com.badlogic.gdx.ai.msg.MessageManager;
23 | import com.mygdx.game.objects.DogCharacter;
24 | import com.mygdx.game.objects.HumanCharacter;
25 | import com.mygdx.game.utilities.Constants;
26 |
27 | /**
28 | * Action task that enables/disables the man's throw button.
29 | *
30 | * @author davebaol
31 | */
32 | public class SetThrowButtonTask extends LeafTask {
33 |
34 | @TaskAttribute(required=true)
35 | public boolean enabled;
36 |
37 | public SetThrowButtonTask () {
38 | }
39 |
40 | public void startAnimation(DogCharacter dog) {
41 | }
42 |
43 | @Override
44 | public Status execute () {
45 | DogCharacter dog = getObject();
46 | HumanCharacter human = dog.human;
47 | if (human.selected && dog.humanWantToPlay) {
48 | int msg = enabled ? Constants.MSG_GUI_SET_DOG_BUTTON_TO_THROW : Constants.MSG_GUI_CLEAR_DOG_BUTTON;
49 | boolean sendTelegram = enabled && dog.humanWantToPlay && !dog.stickThrown;
50 | if (!enabled)
51 | sendTelegram = dog.humanWantToPlay && dog.stickThrown;
52 | if (sendTelegram) {
53 | MessageManager.getInstance().dispatchMessage(msg, human);
54 | }
55 | }
56 | return Status.SUCCEEDED;
57 | }
58 |
59 | @Override
60 | protected Task copyTo (Task task) {
61 | SetThrowButtonTask stbTask = (SetThrowButtonTask)task;
62 | stbTask.enabled = enabled;
63 | return task;
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/SitTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 |
20 | /**
21 | * Idle task that makes the dog sit.
22 | *
23 | * @author davebaol
24 | */
25 | public class SitTask extends LoopedAnimationTaskBase {
26 |
27 | public SitTask () {
28 | }
29 |
30 | @Override
31 | protected TaskAnimation getTaskAnimation () {
32 | return TaskAnimation.Sit;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/SpinAroundTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.mygdx.game.objects.DogCharacter;
20 |
21 |
22 | /**
23 | * A one shot animation task that makes the dog spin around.
24 | *
25 | * @author davebaol
26 | */
27 | public class SpinAroundTask extends OneShotAnimationTaskBase {
28 |
29 | public SpinAroundTask () {
30 | }
31 |
32 | @Override
33 | protected TaskAnimation getTaskAnimation () {
34 | return TaskAnimation.SpinAround;
35 | }
36 |
37 | @Override
38 | public void end() {
39 | // Cleanly stop spinning around if task gets cancelled
40 | if (mustTruncateAnimationCleanly()) {
41 | truncateAnimationCleanly(getObject());
42 | }
43 | super.end();
44 | }
45 |
46 | protected boolean mustTruncateAnimationCleanly() {
47 | return getStatus() == Status.CANCELLED;
48 | }
49 |
50 | protected void truncateAnimationCleanly(DogCharacter dog) {
51 | // Get current model orientation
52 | float currentDogOrientation = dog.getBoneOrientation(DogCharacter.DogArmature.FRONT_SPINE.id);
53 |
54 | // Finish animation
55 | truncateAnimationCleanly(dog, currentDogOrientation);
56 | }
57 |
58 | protected void truncateAnimationCleanly(DogCharacter dog, float orientation) {
59 | // Set body and model orientation since the body does not rotate during spin around animation
60 | dog.setOrientation(orientation);
61 |
62 | // Set stand animation
63 | // Notice that we have to change the animation instantaneously to avoid the rapid but still
64 | // noticeable rotation effect due to animation blending occurring when transitionTime > 0
65 | dog.animations.animate(TaskAnimation.Stand.animationId, 1, 1, animationListener, 0.0f);
66 | updateAnimation(dog);
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/SpinAroundToFaceHumanTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.utils.ArithmeticUtils;
20 | import com.badlogic.gdx.graphics.g3d.utils.AnimationController.AnimationDesc;
21 | import com.badlogic.gdx.math.MathUtils;
22 | import com.mygdx.game.GameScreen;
23 | import com.mygdx.game.objects.DogCharacter;
24 | import com.mygdx.game.utilities.Constants;
25 |
26 | /**
27 | * A one shot animation task that makes the dog spin around until it's facing its owner.
28 | *
29 | * @author davebaol
30 | */
31 | public class SpinAroundToFaceHumanTask extends SpinAroundTask {
32 |
33 | private static final float ORIENTATION_TOLERANCE = 8 * MathUtils.degreesToRadians; // 8 degrees tolerance
34 |
35 | private float targetOrientation;
36 | private boolean facingHuman;
37 |
38 | public SpinAroundToFaceHumanTask () {
39 | }
40 |
41 | @Override
42 | public AnimationDesc startAnimation(DogCharacter dog) {
43 | AnimationDesc animationDesc = super.startAnimation(dog);
44 | if (dog.currentTaskAnimation == getTaskAnimation()) {
45 | // Calculate target orientation to make the dog face human
46 | targetOrientation = ArithmeticUtils.wrapAngleAroundZero(dog.human.getOrientation() + Constants.PI);
47 | }
48 | return animationDesc;
49 | }
50 |
51 | @Override
52 | public void start() {
53 | // Init the flag indicating whether the task has to succeed
54 | facingHuman = false;
55 | super.start();
56 | }
57 |
58 | @Override
59 | public Status execute () {
60 | if (facingHuman) {
61 | return Status.SUCCEEDED;
62 | }
63 | DogCharacter dog = getObject();
64 | updateAnimation(dog);
65 | if (dog.currentTaskAnimation == getTaskAnimation()) {
66 | // Get current model orientation
67 | float currentDogOrientation = dog.getBoneOrientation(DogCharacter.DogArmature.FRONT_SPINE.id);
68 |
69 | // Calculate the difference between current and target orientation
70 | float orientationDiff = ArithmeticUtils.wrapAngleAroundZero(currentDogOrientation - targetOrientation);
71 |
72 | // Is dog facing human with enough precision?
73 | if (MathUtils.isZero(orientationDiff, ORIENTATION_TOLERANCE)) {
74 | // Make the task succeed on the next frame
75 | facingHuman = true;
76 |
77 | // Bark
78 | GameScreen.screen.sounds.bark.play();
79 |
80 | // Finish the animation
81 | truncateAnimationCleanly(dog, currentDogOrientation);
82 | }
83 | }
84 | return Status.RUNNING;
85 | }
86 |
87 | @Override
88 | protected boolean mustTruncateAnimationCleanly() {
89 | return !facingHuman;
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/StandTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 |
20 | /**
21 | * Idle task that makes the dog stand.
22 | *
23 | * @author davebaol
24 | */
25 | public class StandTask extends LoopedAnimationTaskBase {
26 |
27 | public StandTask () {
28 | }
29 |
30 | @Override
31 | protected TaskAnimation getTaskAnimation () {
32 | return TaskAnimation.Stand;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/StickThrownCondition.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.LeafTask;
20 | import com.badlogic.gdx.ai.btree.Task;
21 | import com.mygdx.game.objects.DogCharacter;
22 |
23 | /**
24 | * Condition task that checks if the man has thrown the stick.
25 | *
26 | * @author davebaol
27 | */
28 | public class StickThrownCondition extends LeafTask {
29 |
30 | public StickThrownCondition () {
31 | }
32 |
33 | @Override
34 | public Status execute () {
35 | return getObject().stickThrown? Status.SUCCEEDED : Status.FAILED;
36 | }
37 |
38 | @Override
39 | protected Task copyTo (Task task) {
40 | return task;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/TaskAnimation.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.mygdx.game.objects.DogCharacter.DogSteerSettings;
20 |
21 | /**
22 | * An enumeration of task animations.
23 | *
24 | * @author davebaol
25 | */
26 | public enum TaskAnimation {
27 | Stand("armature|idle_stand"),
28 | Sit("armature|idle_sit"),
29 | LieDown("armature|idle_lie_down"),
30 | Piss("armature|action_piss"),
31 | SpinAround("armature|idle_search"),
32 | Walk("armature|move_walk", 0.7f, Stand) {
33 | @Override
34 | public float getSteeringMultiplier() {
35 | return 1f;
36 | }
37 | },
38 | Run("armature|move_run", 0.2f, Stand) {
39 | @Override
40 | public float getSteeringMultiplier() {
41 | return DogSteerSettings.runMultiplier;
42 | }
43 | };
44 |
45 | public final String animationId;
46 | public final float animationSpeedMultiplier;
47 | public final TaskAnimation idleTaskAnimation;
48 |
49 | /**
50 | * Creates an idle task animation
51 | * @param animationId the animation id
52 | */
53 | TaskAnimation(String animationId) {
54 | this(animationId, -1, null);
55 | }
56 |
57 | /**
58 | * Creates a movement or idle task animation
59 | * @param animationId the animation id
60 | * @param animationSpeedMultiplier the animation speed multiplier
61 | * @param idleTaskAnimation the animation to use when the speed is close enough to 0 (is {@code null} for idle task animations)
62 | */
63 | TaskAnimation(String animationId, float animationSpeedMultiplier, TaskAnimation idleTaskAnimation) {
64 | this.animationId = animationId;
65 | this.animationSpeedMultiplier = animationSpeedMultiplier;
66 | this.idleTaskAnimation = idleTaskAnimation;
67 | }
68 |
69 | public float getSteeringMultiplier() {
70 | return -1;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/WanderTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.mygdx.game.objects.DogCharacter;
20 |
21 | /**
22 | * Movement task that makes the dog wander.
23 | *
24 | * @author davebaol
25 | */
26 | public class WanderTask extends MovementAnimationTaskBase {
27 |
28 | public WanderTask () {
29 | }
30 |
31 | @Override
32 | protected void setSteeringLimits (DogCharacter dog, float steeringMultiplier) {
33 | super.setSteeringLimits(dog, steeringMultiplier);
34 | dog.wanderSteerer.startWandering();
35 | }
36 |
37 | @Override
38 | public void end () {
39 | getObject().wanderSteerer.stopWandering();
40 | super.end();
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/objects/dog/WhineTask.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.objects.dog;
18 |
19 | import com.badlogic.gdx.ai.btree.LeafTask;
20 | import com.badlogic.gdx.ai.btree.Task;
21 | import com.mygdx.game.GameScreen;
22 | import com.mygdx.game.objects.DogCharacter;
23 |
24 | /**
25 | * Action task that makes the dog whine.
26 | *
27 | * @author davebaol
28 | */
29 | public class WhineTask extends LeafTask {
30 |
31 | public WhineTask() {
32 | }
33 |
34 | @Override
35 | public Status execute() {
36 | GameScreen.screen.sounds.whine.play();
37 | return Status.SUCCEEDED;
38 | }
39 |
40 | @Override
41 | protected Task copyTo(Task task) {
42 | return task;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/pathfinding/Edge.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.pathfinding;
18 |
19 | import com.badlogic.gdx.ai.pfa.Connection;
20 | import com.badlogic.gdx.math.Vector3;
21 |
22 | /**
23 | * @author jsjolund
24 | */
25 | public class Edge implements Connection {
26 |
27 | public Vector3 rightVertex;
28 | public Vector3 leftVertex;
29 |
30 | public Triangle fromNode;
31 | public Triangle toNode;
32 |
33 | public Edge(Triangle fromNode, Triangle toNode,
34 | Vector3 rightVertex, Vector3 leftVertex) {
35 | this.fromNode = fromNode;
36 | this.toNode = toNode;
37 | this.rightVertex = rightVertex;
38 | this.leftVertex = leftVertex;
39 | }
40 |
41 | @Override
42 | public float getCost() {
43 | return 1;
44 | }
45 |
46 | @Override
47 | public Triangle getFromNode() {
48 | return fromNode;
49 | }
50 |
51 | @Override
52 | public Triangle getToNode() {
53 | return toNode;
54 | }
55 |
56 | @Override
57 | public String toString() {
58 | final StringBuffer sb = new StringBuffer("Edge{");
59 | sb.append("fromNode=").append(fromNode.triIndex);
60 | sb.append(", toNode=").append(toNode == null ? "null" : toNode.triIndex);
61 | sb.append(", rightVertex=").append(rightVertex);
62 | sb.append(", leftVertex=").append(leftVertex);
63 | sb.append('}');
64 | return sb.toString();
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/pathfinding/NavMeshGraphPath.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | * Licensed under the Apache License, Version 2.0 (the "License");
4 | * you may not use this file except in compliance with the License.
5 | * You may obtain a copy of the License at
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | * Unless required by applicable law or agreed to in writing, software
8 | * distributed under the License is distributed on an "AS IS" BASIS,
9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | * See the License for the specific language governing permissions and
11 | * limitations under the License.
12 | ******************************************************************************/
13 |
14 | package com.mygdx.game.pathfinding;
15 |
16 | import com.badlogic.gdx.ai.pfa.Connection;
17 | import com.badlogic.gdx.ai.pfa.DefaultGraphPath;
18 | import com.badlogic.gdx.math.Vector3;
19 |
20 | /**
21 | * @author jsjolund
22 | */
23 | public class NavMeshGraphPath extends DefaultGraphPath> {
24 | /**
25 | * The start point when generating a point path for this triangle path
26 | */
27 | public Vector3 start;
28 | /**
29 | * The end point when generating a point path for this triangle path
30 | */
31 | public Vector3 end;
32 | /**
33 | * If the triangle path is empty, the point path will span this triangle
34 | */
35 | public Triangle startTri;
36 |
37 | /**
38 | * @return Last triangle in the path.
39 | */
40 | public Triangle getEndTriangle() {
41 | return (getCount() > 0) ? get(getCount() - 1).getToNode() : startTri;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/pathfinding/NavMeshHeuristic.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | * Licensed under the Apache License, Version 2.0 (the "License");
4 | * you may not use this file except in compliance with the License.
5 | * You may obtain a copy of the License at
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | * Unless required by applicable law or agreed to in writing, software
8 | * distributed under the License is distributed on an "AS IS" BASIS,
9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | * See the License for the specific language governing permissions and
11 | * limitations under the License.
12 | ******************************************************************************/
13 |
14 | package com.mygdx.game.pathfinding;
15 |
16 | import com.badlogic.gdx.ai.pfa.Heuristic;
17 | import com.badlogic.gdx.math.Vector3;
18 |
19 | /**
20 | * @author jsjolund
21 | */
22 | public class NavMeshHeuristic implements Heuristic {
23 |
24 | private final static Vector3 A_AB = new Vector3();
25 | private final static Vector3 A_BC = new Vector3();
26 | private final static Vector3 A_CA = new Vector3();
27 | private final static Vector3 B_AB = new Vector3();
28 | private final static Vector3 B_BC = new Vector3();
29 | private final static Vector3 B_CA = new Vector3();
30 |
31 | /**
32 | * Estimates the distance between two triangles, by calculating the distance
33 | * between their edge midpoints.
34 | *
35 | * @param node
36 | * @param endNode
37 | * @return
38 | */
39 | @Override
40 | public float estimate(Triangle node, Triangle endNode) {
41 | float dst2;
42 | float minDst2 = Float.POSITIVE_INFINITY;
43 | A_AB.set(node.a).add(node.b).scl(0.5f);
44 | A_BC.set(node.b).add(node.c).scl(0.5f);
45 | A_CA.set(node.c).add(node.a).scl(0.5f);
46 |
47 | B_AB.set(endNode.a).add(endNode.b).scl(0.5f);
48 | B_BC.set(endNode.b).add(endNode.c).scl(0.5f);
49 | B_CA.set(endNode.c).add(endNode.a).scl(0.5f);
50 |
51 | if ((dst2 = A_AB.dst2(B_AB)) < minDst2) minDst2 = dst2;
52 | if ((dst2 = A_AB.dst2(B_BC)) < minDst2) minDst2 = dst2;
53 | if ((dst2 = A_AB.dst2(B_CA)) < minDst2) minDst2 = dst2;
54 |
55 | if ((dst2 = A_BC.dst2(B_AB)) < minDst2) minDst2 = dst2;
56 | if ((dst2 = A_BC.dst2(B_BC)) < minDst2) minDst2 = dst2;
57 | if ((dst2 = A_BC.dst2(B_CA)) < minDst2) minDst2 = dst2;
58 |
59 | if ((dst2 = A_CA.dst2(B_AB)) < minDst2) minDst2 = dst2;
60 | if ((dst2 = A_CA.dst2(B_BC)) < minDst2) minDst2 = dst2;
61 | if ((dst2 = A_CA.dst2(B_CA)) < minDst2) minDst2 = dst2;
62 |
63 | return (float) Math.sqrt(minDst2);
64 | }
65 |
66 | // /**
67 | // * Estimates the distance between two triangles, by calculating the distance
68 | // * between their closest vertices.
69 | // * @param node
70 | // * @param endNode
71 | // * @return
72 | // */
73 | // @Override
74 | // public float estimate(Triangle node, Triangle endNode) {
75 | // float dst2;
76 | // float minDst2 = Float.POSITIVE_INFINITY;
77 | // if ((dst2 = node.a.dst2(endNode.a)) < minDst2) minDst2 = dst2;
78 | // if ((dst2 = node.a.dst2(endNode.b)) < minDst2) minDst2 = dst2;
79 | // if ((dst2 = node.a.dst2(endNode.c)) < minDst2) minDst2 = dst2;
80 | // if ((dst2 = node.b.dst2(endNode.a)) < minDst2) minDst2 = dst2;
81 | // if ((dst2 = node.b.dst2(endNode.b)) < minDst2) minDst2 = dst2;
82 | // if ((dst2 = node.b.dst2(endNode.c)) < minDst2) minDst2 = dst2;
83 | // if ((dst2 = node.c.dst2(endNode.a)) < minDst2) minDst2 = dst2;
84 | // if ((dst2 = node.c.dst2(endNode.b)) < minDst2) minDst2 = dst2;
85 | // if ((dst2 = node.c.dst2(endNode.c)) < minDst2) minDst2 = dst2;
86 | // return (float) Math.sqrt(minDst2);
87 | // }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/pathfinding/NavMeshRaycastCallback.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.pathfinding;
18 |
19 | import com.badlogic.gdx.math.Vector3;
20 | import com.badlogic.gdx.physics.bullet.collision.btTriangleRaycastCallback;
21 | import com.badlogic.gdx.physics.bullet.linearmath.btVector3;
22 | import com.badlogic.gdx.utils.Bits;
23 |
24 | /**
25 | * @author jsjolund
26 | */
27 | public class NavMeshRaycastCallback extends btTriangleRaycastCallback {
28 |
29 | public Vector3 hitNormalLocal = new Vector3();
30 | public float hitFraction = 1;
31 | public int partId = -1;
32 | public int triangleIndex = -1;
33 |
34 | private btVector3 tmpSetFrom = new btVector3();
35 | private btVector3 tmpSetTo = new btVector3();
36 | private Bits meshPartIndices;
37 |
38 | public NavMeshRaycastCallback(Vector3 from, Vector3 to) {
39 | super(from, to);
40 | }
41 |
42 | public void clearReport() {
43 | hitNormalLocal.setZero();
44 | hitFraction = 1;
45 | partId = -1;
46 | triangleIndex = -1;
47 | }
48 |
49 | @Override
50 | public float reportHit(Vector3 hitNormalLocal, float hitFraction, int partId, int triangleIndex) {
51 | if ((meshPartIndices == null || meshPartIndices.get(partId)) && hitFraction < this.hitFraction) {
52 | this.hitNormalLocal.set(hitNormalLocal);
53 | this.hitFraction = hitFraction;
54 | this.partId = partId;
55 | this.triangleIndex = triangleIndex;
56 | return hitFraction;
57 | }
58 | return 1;
59 | }
60 |
61 | public void setFrom(Vector3 value) {
62 | tmpSetFrom.setValue(value.x, value.y, value.z);
63 | super.setFrom(tmpSetFrom);
64 | }
65 |
66 | public void setTo(Vector3 value) {
67 | tmpSetTo.setValue(value.x, value.y, value.z);
68 | super.setTo(tmpSetTo);
69 | }
70 |
71 | @Override
72 | public void dispose() {
73 | tmpSetFrom.dispose();
74 | tmpSetTo.dispose();
75 | super.dispose();
76 | }
77 |
78 | public void setAllowedMeshPartIndices(Bits meshPartIndices) {
79 | this.meshPartIndices = meshPartIndices;
80 | }
81 | }
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/scene/GameSceneManager.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.scene;
18 |
19 | import com.badlogic.gdx.Gdx;
20 | import com.badlogic.gdx.assets.loaders.ModelLoader;
21 | import com.badlogic.gdx.assets.loaders.TextureLoader;
22 | import com.badlogic.gdx.graphics.g3d.particles.ParticleEffectLoader;
23 | import com.badlogic.gdx.utils.Disposable;
24 | import com.badlogic.gdx.utils.GdxRuntimeException;
25 | import com.badlogic.gdx.utils.ObjectMap;
26 |
27 | /**
28 | * @author jsjolund
29 | */
30 | public class GameSceneManager implements Disposable {
31 |
32 | private static final String TAG = "GameSceneManager";
33 |
34 | private final ObjectMap sceneMap = new ObjectMap();
35 | private final ObjectMap sharedBlueprints = new ObjectMap();
36 |
37 | private final String modelPath;
38 | private final String modelExt;
39 | private final String pfxPath;
40 | private final ModelLoader.ModelParameters modelParameters;
41 | private final TextureLoader.TextureParameter textureParameter;
42 | private final ParticleEffectLoader.ParticleEffectLoadParameter pfxParameter;
43 |
44 | public GameSceneManager(ModelLoader.ModelParameters modelParameters,
45 | TextureLoader.TextureParameter textureParameter,
46 | ParticleEffectLoader.ParticleEffectLoadParameter pfxParameter,
47 | String pfxPath, String modelPath, String modelExt) {
48 | this.modelPath = modelPath;
49 | this.modelExt = modelExt;
50 | this.pfxPath = pfxPath;
51 |
52 | this.modelParameters = modelParameters;
53 | this.textureParameter = textureParameter;
54 | this.pfxParameter = pfxParameter;
55 | }
56 |
57 | public GameScene open(String sceneId) {
58 | if (!sceneMap.containsKey(sceneId)) {
59 | sceneMap.put(sceneId, new GameScene(modelParameters, textureParameter, pfxParameter,
60 | pfxPath, modelPath, modelExt, sharedBlueprints));
61 | Gdx.app.debug(TAG, "Added scene '" + sceneId + "'");
62 | }
63 | return sceneMap.get(sceneId);
64 | }
65 |
66 | public void addSharedBlueprint(String blueprintId, GameObjectBlueprint blueprint) {
67 | if (sharedBlueprints.containsKey(blueprintId)) {
68 | throw new GdxRuntimeException("Shared blueprint already exists '" + blueprintId + "'");
69 | }
70 | sharedBlueprints.put(blueprintId, blueprint);
71 | Gdx.app.debug(TAG, "Added shared blueprint '" + blueprintId + "'");
72 | }
73 |
74 | public void dispose(String sceneId) {
75 | Gdx.app.debug(TAG, "Disposing scene '" + sceneId + "'");
76 | sceneMap.get(sceneId).dispose();
77 | }
78 |
79 | @Override
80 | public void dispose() {
81 | for (GameScene scene : sceneMap.values()) {
82 | scene.dispose();
83 | }
84 | for (GameObjectBlueprint bp : sharedBlueprints.values()) {
85 | bp.dispose();
86 | }
87 | }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/settings/DebugViewSettings.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.settings;
18 |
19 | public class DebugViewSettings {
20 | public static boolean drawArmature = false;
21 | public static boolean drawCollShapes = false;
22 | public static boolean drawConstraints = false;
23 | public static boolean drawModels = true;
24 | public static boolean drawMouseNavMeshPos = false;
25 | public static boolean drawNavmesh = false;
26 | public static boolean drawSteering = false;
27 | public static boolean drawUIDebug = false;
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/settings/GameSettings.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.settings;
18 |
19 | import com.badlogic.gdx.Input;
20 | import com.badlogic.gdx.math.Vector3;
21 |
22 | public class GameSettings {
23 |
24 | public static final float CAMERA_FOV = 60;
25 | public static final float CAMERA_FAR = 100f;
26 | public static final float CAMERA_NEAR = 0.1f;
27 | public static final float CAMERA_MAX_PAN_VELOCITY = 50;
28 | public static final float CAMERA_MIN_ZOOM = 1;
29 | public static final float CAMERA_ZOOM_STEP = 4;
30 | public static final float CAMERA_MAX_ZOOM = 40;
31 | public static final float CAMERA_LERP_ALPHA = 5f;
32 |
33 | public static final float CAMERA_PICK_RAY_DST = 100;
34 |
35 | public static final float SCENE_AMBIENT_LIGHT = 0.1f;
36 |
37 | public static final Vector3 GRAVITY = new Vector3(0, -9.8f, 0);
38 |
39 | public static final int SHADOW_MAP_WIDTH = 2048;
40 | public static final int SHADOW_MAP_HEIGHT = 2048;
41 | public static final float SHADOW_VIEWPORT_HEIGHT = 100;
42 | public static final float SHADOW_VIEWPORT_WIDTH = 100;
43 | public static final float SHADOW_NEAR = 1;
44 | public static final float SHADOW_FAR = 100;
45 | public static final float SHADOW_INTENSITY = 1f;
46 |
47 | public static float GAME_SPEED = 1;
48 | public static float GAME_SPEED_PAUSE = 0;
49 | public static float GAME_SPEED_PLAY = 1;
50 | public static float GAME_SPEED_SLOW = 0.05f;
51 |
52 | public static float MOUSE_SENSITIVITY = 0.1f;
53 | public static float MOUSE_DRAG_THRESHOLD = 10f;
54 |
55 | public static int KEY_PAUSE = Input.Keys.SPACE;
56 | public static int KEY_PAN_FORWARD = Input.Keys.W;
57 | public static int KEY_PAN_LEFT = Input.Keys.A;
58 | public static int KEY_PAN_BACKWARD = Input.Keys.S;
59 | public static int KEY_PAN_RIGHT = Input.Keys.D;
60 |
61 | public static float SOUND_VOLUME = 1f;
62 | public static float MUSIC_VOLUME = 1f;
63 | }
64 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/settings/ShaderSettings.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.settings;
18 |
19 | public class ShaderSettings {
20 | public static float hue = 1f;
21 | public static float saturation = 0.5f;
22 | public static float value = 0.8f;
23 | public static float specOpacity = 0.5f;
24 | public static float lightIntensity = 3f;
25 | public static float ambient = 5f;
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/steerers/CollisionAvoidanceSteererBase.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.steerers;
18 |
19 | import com.badlogic.gdx.ai.steer.SteeringAcceleration;
20 | import com.badlogic.gdx.ai.steer.SteeringBehavior;
21 | import com.badlogic.gdx.ai.steer.behaviors.CollisionAvoidance;
22 | import com.badlogic.gdx.ai.steer.behaviors.PrioritySteering;
23 | import com.badlogic.gdx.ai.steer.proximities.RadiusProximity;
24 | import com.badlogic.gdx.graphics.Color;
25 | import com.badlogic.gdx.math.Vector3;
26 | import com.mygdx.game.GameRenderer;
27 | import com.mygdx.game.GameScreen;
28 | import com.mygdx.game.objects.SteerableBody;
29 | import com.mygdx.game.utilities.MyShapeRenderer;
30 | import com.mygdx.game.utilities.Steerer;
31 |
32 | /**
33 | * Base class for steerers requiring collision avoidance behavior with priority.
34 | *
35 | * @author davebaol
36 | */
37 | public abstract class CollisionAvoidanceSteererBase extends Steerer {
38 |
39 | protected final CollisionAvoidance collisionAvoidanceSB;
40 | protected final RadiusProximity proximity;
41 |
42 | protected final PrioritySteering prioritySteering;
43 |
44 | public CollisionAvoidanceSteererBase(final SteerableBody steerableBody) {
45 | super(steerableBody);
46 |
47 | this.proximity = new RadiusProximity(steerableBody, GameScreen.screen.engine.characters, steerableBody.getBoundingRadius() * 1.8f);
48 | this.collisionAvoidanceSB = new CollisionAvoidance(steerableBody, proximity) {
49 | @Override
50 | protected SteeringAcceleration calculateRealSteering(SteeringAcceleration steering) {
51 | super.calculateRealSteering(steering);
52 | steering.linear.y = 0; // remove any vertical acceleration
53 | return steering;
54 | }
55 | };
56 |
57 | this.prioritySteering = new PrioritySteering(steerableBody, 0.001f) //
58 | .add(collisionAvoidanceSB);
59 | }
60 |
61 | @Override
62 | public SteeringBehavior getSteeringBehavior() {
63 | return prioritySteering;
64 | }
65 |
66 | @Override
67 | public void draw(GameRenderer gameRenderer) {
68 | MyShapeRenderer shapeRenderer = gameRenderer.shapeRenderer;
69 | shapeRenderer.setProjectionMatrix(gameRenderer.viewport.getCamera().combined);
70 |
71 | // Draw collision avoidance proximity
72 | shapeRenderer.begin(MyShapeRenderer.ShapeType.Line);
73 | shapeRenderer.setColor(Color.YELLOW);
74 | Vector3 pos = steerableBody.getPosition();
75 | shapeRenderer.circle3(pos.x, pos.y - steerableBody.halfExtents.y, pos.z, proximity.getRadius(), 12);
76 |
77 | shapeRenderer.end();
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/steerers/WanderSteerer.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.steerers;
18 |
19 | import com.badlogic.gdx.ai.steer.SteeringAcceleration;
20 | import com.badlogic.gdx.ai.steer.behaviors.Wander;
21 | import com.badlogic.gdx.graphics.Color;
22 | import com.badlogic.gdx.math.MathUtils;
23 | import com.badlogic.gdx.math.Vector3;
24 | import com.mygdx.game.GameRenderer;
25 | import com.mygdx.game.objects.SteerableBody;
26 | import com.mygdx.game.utilities.MyShapeRenderer;
27 |
28 | /**
29 | * A steerer to wander while avoiding collisions.
30 | *
31 | * @author davebaol
32 | */
33 | public class WanderSteerer extends CollisionAvoidanceSteererBase {
34 |
35 | final Wander wanderSB;
36 | boolean keepWandering;
37 |
38 | public WanderSteerer(final SteerableBody steerableBody) {
39 | super(steerableBody);
40 |
41 | this.wanderSB = new Wander(steerableBody) {
42 | @Override
43 | protected SteeringAcceleration calculateRealSteering(SteeringAcceleration steering) {
44 | super.calculateRealSteering(steering);
45 | steering.linear.y = 0; // remove any vertical acceleration
46 | return steering;
47 | }
48 | };
49 | this.wanderSB.setWanderOffset(8) //
50 | .setWanderOrientation(0) //
51 | .setWanderRadius(0.5f) //
52 | .setWanderRate(MathUtils.PI2 * 4);
53 |
54 | this.prioritySteering.add(wanderSB);
55 | }
56 |
57 | public void startWandering() {
58 | steerableBody.steerer = this;
59 | keepWandering = true;
60 | }
61 |
62 | public void stopWandering() {
63 | keepWandering = false;
64 | }
65 |
66 | @Override
67 | public boolean processSteering (SteeringAcceleration steering) {
68 | return keepWandering;
69 | }
70 |
71 | @Override
72 | public void startSteering () {
73 | }
74 |
75 | @Override
76 | public boolean stopSteering () {
77 | return false;
78 | }
79 |
80 | @Override
81 | public void draw(GameRenderer gameRenderer) {
82 | super.draw(gameRenderer);
83 |
84 | MyShapeRenderer shapeRenderer = gameRenderer.shapeRenderer;
85 |
86 | // Draw wander circle
87 | shapeRenderer.begin(MyShapeRenderer.ShapeType.Line);
88 | shapeRenderer.setColor(Color.CORAL);
89 | Vector3 wanderCenter = wanderSB.getWanderCenter();
90 | shapeRenderer.circle3(wanderCenter.x, wanderCenter.y - steerableBody.halfExtents.y, wanderCenter.z, wanderSB.getWanderRadius(), 12);
91 | shapeRenderer.end();
92 |
93 | // Draw wander target
94 | shapeRenderer.begin(MyShapeRenderer.ShapeType.Filled);
95 | shapeRenderer.setColor(Color.CORAL);
96 | Vector3 wanderTarget = wanderSB.getInternalTargetPosition();
97 | shapeRenderer.circle3(wanderTarget.x, wanderTarget.y - steerableBody.halfExtents.y, wanderTarget.z, .1f, 6);
98 | shapeRenderer.end();
99 | }
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/ui/BooleanSettingsMenu.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.ui;
18 |
19 | import com.badlogic.gdx.Gdx;
20 | import com.badlogic.gdx.scenes.scene2d.Actor;
21 | import com.badlogic.gdx.scenes.scene2d.InputEvent;
22 | import com.badlogic.gdx.scenes.scene2d.InputListener;
23 | import com.badlogic.gdx.scenes.scene2d.ui.CheckBox;
24 | import com.badlogic.gdx.scenes.scene2d.ui.Skin;
25 | import com.badlogic.gdx.scenes.scene2d.ui.Table;
26 | import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
27 | import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
28 | import com.badlogic.gdx.utils.Align;
29 | import com.badlogic.gdx.utils.reflect.ClassReflection;
30 | import com.badlogic.gdx.utils.reflect.Field;
31 | import com.badlogic.gdx.utils.reflect.ReflectionException;
32 |
33 | /**
34 | * @author jsjolund
35 | */
36 | public class BooleanSettingsMenu extends Table {
37 |
38 | private static final String TAG = "BooleanSettingsMenu";
39 |
40 | public BooleanSettingsMenu(String buttonText, Skin skin, Class> booleanSettingsClass) {
41 | final Table innerTable = new Table();
42 |
43 | Field[] fields = ClassReflection.getDeclaredFields(booleanSettingsClass);
44 | for (final Field field : fields) {
45 | boolean fieldValueBoolean = false;
46 | try {
47 | fieldValueBoolean = (Boolean)field.get(field);
48 | } catch (Exception e) {
49 | Gdx.app.debug(TAG, "Cannot parse value for boolean " + field.getName());
50 | }
51 | final CheckBox checkBox = new CheckBox(field.getName(), skin);
52 | checkBox.setChecked(fieldValueBoolean);
53 | innerTable.add(checkBox).pad(1).align(Align.left);
54 | innerTable.row();
55 | checkBox.addListener(new ChangeListener() {
56 | @Override
57 | public void changed(ChangeEvent event, Actor actor) {
58 | try {
59 | field.set(field, (Boolean)checkBox.isChecked());
60 | } catch (ReflectionException e) {
61 | Gdx.app.debug(TAG, "Cannot set value for " + field.getName());
62 | }
63 | }
64 | });
65 | }
66 | innerTable.setVisible(false);
67 | final TextButton button = new TextButton(buttonText, skin);
68 | button.addListener(new InputListener() {
69 | public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
70 | innerTable.setVisible(!innerTable.isVisible());
71 | return true;
72 | }
73 | });
74 | add(innerTable).fillX();
75 | row();
76 | add(button).fillX();
77 | row();
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/ui/FloatSettingsMenu.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.ui;
18 |
19 | import com.badlogic.gdx.Gdx;
20 | import com.badlogic.gdx.scenes.scene2d.InputEvent;
21 | import com.badlogic.gdx.scenes.scene2d.InputListener;
22 | import com.badlogic.gdx.scenes.scene2d.ui.*;
23 | import com.badlogic.gdx.utils.reflect.ClassReflection;
24 | import com.badlogic.gdx.utils.reflect.Field;
25 | import com.badlogic.gdx.utils.reflect.ReflectionException;
26 |
27 | /**
28 | * @author jsjolund
29 | */
30 | public class FloatSettingsMenu extends Table {
31 |
32 | private static final String TAG = "FloatSettingsMenu";
33 |
34 | public FloatSettingsMenu(String buttonText, Skin skin, Class> floatSettingsClass) {
35 | final Table innerTable = new Table();
36 |
37 | Field[] fields = ClassReflection.getFields(floatSettingsClass);
38 | for (final Field field : fields) {
39 | final Label fieldName = new Label(field.getName(), skin);
40 | float fieldValueFloat = 0;
41 | try {
42 | fieldValueFloat = (Float)field.get(field);
43 | } catch (Exception e) {
44 | Gdx.app.debug(TAG, "Cannot parse float value for " + field.getName());
45 | }
46 | final TextField fieldValue = new TextField(String.valueOf(fieldValueFloat), skin);
47 | innerTable.add(fieldName).fillX();
48 | innerTable.row();
49 | innerTable.add(fieldValue).fillX();
50 | innerTable.row();
51 | fieldValue.addListener(new InputListener() {
52 | @Override
53 | public boolean keyTyped(InputEvent event, char character) {
54 | String userInput = fieldValue.getText();
55 | float newFieldValue;
56 | try {
57 | newFieldValue = Float.parseFloat(userInput);
58 | } catch (NumberFormatException e) {
59 | return true;
60 | }
61 | try {
62 | field.set(field, (Float)newFieldValue);
63 | } catch (ReflectionException e) {
64 | Gdx.app.debug(TAG, "Cannot set value for " + field.getName());
65 | }
66 | return true;
67 | }
68 | });
69 | }
70 | innerTable.setVisible(false);
71 | final TextButton button = new TextButton(buttonText, skin);
72 | button.addListener(new InputListener() {
73 | public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
74 | innerTable.setVisible(!innerTable.isVisible());
75 | return true;
76 | }
77 | });
78 | add(innerTable).fillX();
79 | row();
80 | add(button).fillX();
81 | row();
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/ui/FloatValueLabel.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2014 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.ui;
18 |
19 | import com.badlogic.gdx.graphics.Color;
20 | import com.badlogic.gdx.scenes.scene2d.ui.Label;
21 | import com.badlogic.gdx.scenes.scene2d.ui.Skin;
22 | import com.badlogic.gdx.utils.StringBuilder;
23 |
24 | /** A label continuously showing the most up-to-date float value prefixed by a constant string.
25 | *
26 | * @author davebaol */
27 | public abstract class FloatValueLabel extends Label {
28 |
29 | float oldValue;
30 | int appendIndex;
31 |
32 | public FloatValueLabel (CharSequence text, float initialValue, Skin skin) {
33 | this(text, initialValue, skin.get(LabelStyle.class));
34 | }
35 |
36 | public FloatValueLabel (CharSequence text, float initialValue, Skin skin, String styleName) {
37 | this(text, initialValue, skin.get(styleName, LabelStyle.class));
38 | }
39 |
40 | public FloatValueLabel (CharSequence text, float initialValue, Skin skin, String fontName, Color color) {
41 | this(text, initialValue, new LabelStyle(skin.getFont(fontName), color));
42 | }
43 |
44 | public FloatValueLabel (CharSequence text, float initialValue, Skin skin, String fontName, String colorName) {
45 | this(text, initialValue, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName)));
46 | }
47 |
48 | public FloatValueLabel (CharSequence text, float initialValue, LabelStyle style) {
49 | super(text.toString() + initialValue, style);
50 | this.oldValue = initialValue;
51 | this.appendIndex = text.length();
52 | }
53 |
54 | public abstract float getValue();
55 |
56 | @Override
57 | public void act (float delta) {
58 | float newValue = getValue();
59 | if (oldValue != newValue) {
60 | oldValue = newValue;
61 | StringBuilder sb = getText();
62 | sb.setLength(appendIndex);
63 | sb.append(oldValue);
64 | invalidateHierarchy();
65 | }
66 | super.act(delta);
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/ui/GameSpeedController.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.ui;
18 |
19 | import com.badlogic.gdx.graphics.g2d.TextureAtlas;
20 | import com.badlogic.gdx.scenes.scene2d.Actor;
21 | import com.badlogic.gdx.scenes.scene2d.ui.ImageButton;
22 | import com.badlogic.gdx.scenes.scene2d.ui.Table;
23 | import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
24 | import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
25 | import com.mygdx.game.settings.GameSettings;
26 |
27 | /**
28 | * @author jsjolund
29 | */
30 | public class GameSpeedController extends Table {
31 |
32 | private final ImageButton imageButton;
33 | private final ImageButton.ImageButtonStyle btnPauseStyle;
34 | private final ImageButton.ImageButtonStyle btnPlayStyle;
35 | private final ImageButton.ImageButtonStyle btnSlowStyle;
36 |
37 | public GameSpeedController(TextureAtlas buttonAtlas) {
38 | btnPauseStyle = new ImageButton.ImageButtonStyle();
39 | btnPauseStyle.up = new TextureRegionDrawable(buttonAtlas.findRegion("pause-up"));
40 | btnPauseStyle.down = new TextureRegionDrawable(buttonAtlas.findRegion("pause-down"));
41 |
42 | btnPlayStyle = new ImageButton.ImageButtonStyle();
43 | btnPlayStyle.up = new TextureRegionDrawable(buttonAtlas.findRegion("play-up"));
44 | btnPlayStyle.down = new TextureRegionDrawable(buttonAtlas.findRegion("play-down"));
45 |
46 | btnSlowStyle = new ImageButton.ImageButtonStyle();
47 | btnSlowStyle.up = new TextureRegionDrawable(buttonAtlas.findRegion("slow-up"));
48 | btnSlowStyle.down = new TextureRegionDrawable(buttonAtlas.findRegion("slow-down"));
49 |
50 | imageButton = new ImageButton(btnPauseStyle);
51 |
52 | add(imageButton);
53 |
54 | imageButton.addListener(new ChangeListener() {
55 | @Override
56 | public void changed(ChangeEvent event, Actor actor) {
57 | setGameSpeed();
58 | event.cancel();
59 | }
60 | });
61 | }
62 |
63 | public void setGameSpeed() {
64 | if (GameSettings.GAME_SPEED == GameSettings.GAME_SPEED_PLAY) {
65 | GameSettings.GAME_SPEED = GameSettings.GAME_SPEED_PAUSE;
66 | imageButton.setStyle(btnSlowStyle);
67 |
68 | } else if (GameSettings.GAME_SPEED == GameSettings.GAME_SPEED_PAUSE) {
69 | GameSettings.GAME_SPEED = GameSettings.GAME_SPEED_SLOW;
70 | imageButton.setStyle(btnPlayStyle);
71 |
72 | } else if (GameSettings.GAME_SPEED == GameSettings.GAME_SPEED_SLOW) {
73 | GameSettings.GAME_SPEED = GameSettings.GAME_SPEED_PLAY;
74 | imageButton.setStyle(btnPauseStyle);
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/ui/IntValueLabel.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2014 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.ui;
18 |
19 | import com.badlogic.gdx.graphics.Color;
20 | import com.badlogic.gdx.scenes.scene2d.ui.Label;
21 | import com.badlogic.gdx.scenes.scene2d.ui.Skin;
22 | import com.badlogic.gdx.utils.StringBuilder;
23 |
24 | /** A label continuously showing the most up-to-date integer value prefixed by a constant string.
25 | *
26 | * @author davebaol */
27 | public abstract class IntValueLabel extends Label {
28 |
29 | int oldValue;
30 | int appendIndex;
31 |
32 | public IntValueLabel (CharSequence text, int initialValue, Skin skin) {
33 | this(text, initialValue, skin.get(LabelStyle.class));
34 | }
35 |
36 | public IntValueLabel (CharSequence text, int initialValue, Skin skin, String styleName) {
37 | this(text, initialValue, skin.get(styleName, LabelStyle.class));
38 | }
39 |
40 | public IntValueLabel (CharSequence text, int initialValue, Skin skin, String fontName, Color color) {
41 | this(text, initialValue, new LabelStyle(skin.getFont(fontName), color));
42 | }
43 |
44 | public IntValueLabel (CharSequence text, int initialValue, Skin skin, String fontName, String colorName) {
45 | this(text, initialValue, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName)));
46 | }
47 |
48 | public IntValueLabel (CharSequence text, int initialValue, LabelStyle style) {
49 | super(text.toString() + initialValue, style);
50 | this.oldValue = initialValue;
51 | this.appendIndex = text.length();
52 | }
53 |
54 | public abstract int getValue();
55 |
56 | @Override
57 | public void act (float delta) {
58 | int newValue = getValue();
59 | if (oldValue != newValue) {
60 | oldValue = newValue;
61 | StringBuilder sb = getText();
62 | sb.setLength(appendIndex);
63 | sb.append(oldValue);
64 | invalidateHierarchy();
65 | }
66 | super.act(delta);
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/ui/ObjectValueLabel.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2014 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.ui;
18 |
19 | import com.badlogic.gdx.graphics.Color;
20 | import com.badlogic.gdx.scenes.scene2d.ui.Label;
21 | import com.badlogic.gdx.scenes.scene2d.ui.Skin;
22 | import com.badlogic.gdx.utils.StringBuilder;
23 |
24 | /** A label continuously showing the most up-to-date value prefixed by a constant string.
25 | *
26 | * @param the type of the value
27 | *
28 | * @author davebaol */
29 | public abstract class ObjectValueLabel extends Label {
30 |
31 | T oldValue;
32 | int appendIndex;
33 |
34 | public ObjectValueLabel (CharSequence text, T initialValue, Skin skin) {
35 | this(text, initialValue, skin.get(LabelStyle.class));
36 | }
37 |
38 | public ObjectValueLabel (CharSequence text, T initialValue, Skin skin, String styleName) {
39 | this(text, initialValue, skin.get(styleName, LabelStyle.class));
40 | }
41 |
42 | public ObjectValueLabel (CharSequence text, T initialValue, Skin skin, String fontName, Color color) {
43 | this(text, initialValue, new LabelStyle(skin.getFont(fontName), color));
44 | }
45 |
46 | public ObjectValueLabel (CharSequence text, T initialValue, Skin skin, String fontName, String colorName) {
47 | this(text, initialValue, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName)));
48 | }
49 |
50 | public ObjectValueLabel (CharSequence text, T initialValue, LabelStyle style) {
51 | super(text.toString() + initialValue, style);
52 | this.oldValue = initialValue;
53 | this.appendIndex = text.length();
54 | }
55 |
56 | public abstract T getValue();
57 |
58 | public abstract void copyValue(T newValue, T oldValue);
59 |
60 | @Override
61 | public void act (float delta) {
62 | T newValue = getValue();
63 | if (!oldValue.equals(newValue)) {
64 | copyValue(newValue, oldValue);
65 | StringBuilder sb = getText();
66 | sb.setLength(appendIndex);
67 | sb.append(oldValue);
68 | invalidateHierarchy();
69 | }
70 | super.act(delta);
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/AnimationListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 | import com.badlogic.gdx.graphics.g3d.utils.AnimationController;
20 |
21 | /**
22 | * @author davebaol
23 | */
24 | public class AnimationListener implements AnimationController.AnimationListener {
25 |
26 | boolean animationCompleted;
27 |
28 | public boolean isAnimationCompleted () {
29 | return animationCompleted;
30 | }
31 |
32 | public void setAnimationCompleted (boolean animationCompleted) {
33 | this.animationCompleted = animationCompleted;
34 | }
35 |
36 | @Override
37 | public void onEnd(AnimationController.AnimationDesc animation) {
38 | animationCompleted = true;
39 | }
40 |
41 | @Override
42 | public void onLoop(AnimationController.AnimationDesc animation) {
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/BehaviorTreeController.java:
--------------------------------------------------------------------------------
1 | package com.mygdx.game.utilities;
2 |
3 | import com.badlogic.gdx.Gdx;
4 | import com.badlogic.gdx.ai.btree.BehaviorTree;
5 | import com.badlogic.gdx.scenes.scene2d.Group;
6 | import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
7 | import com.mygdx.game.objects.DogCharacter;
8 | import com.mygdx.game.objects.dog.*;
9 |
10 | import io.piotrjastrzebski.bte.AIEditor;
11 |
12 | public class BehaviorTreeController {
13 |
14 | private final AIEditor btreeEditor;
15 | private DogCharacter currentDog;
16 |
17 | public BehaviorTreeController () {
18 | btreeEditor = createDogBTEditor();
19 | }
20 |
21 | public void step(DogCharacter dog, float deltaTime) {
22 | if (currentDog == dog) {
23 | btreeEditor.update(deltaTime);
24 | }
25 | else {
26 | try {
27 | dog.tree.step();
28 | } catch (Exception ex) {
29 | Gdx.app.log("BehaviorTreeController", "Exception from dog '" + dog.dogName + "': " + ex.getMessage());
30 | }
31 | }
32 | }
33 |
34 | public void toggleEditorWindow(Group group, TextButton toggle) {
35 | btreeEditor.toggleWindow(group);
36 | toggle.setText(btreeEditor.isWindowVisible() ? "Hide Editor" : "Show Editor");
37 | }
38 |
39 | public void setCurrentDog(DogCharacter dog) {
40 | currentDog = dog;
41 | btreeEditor.getWindow().getTitleLabel().setText(dog.dogName);
42 | btreeEditor.initialize(dog.tree);
43 | }
44 |
45 | public void reset() {
46 | currentDog = null;
47 | btreeEditor.reset();
48 | }
49 |
50 | private static AIEditor createDogBTEditor() {
51 | AIEditor editor = new AIEditor();
52 | // add default task classes to task drawer with default tags
53 | editor.addDefaultTaskClasses();
54 | editor.setUpdateStrategy(new AIEditor.BehaviorTreeStepStrategy() {
55 | @Override public boolean shouldStep (@SuppressWarnings("rawtypes") BehaviorTree behaviorTree, float v) {
56 | return true;
57 | }
58 | });
59 |
60 | // Add dog-specific tasks
61 | editor.addTaskClass("dog", AlreadyCriedForHumanDeathCondition.class);
62 | editor.addTaskClass("dog", CalculatePathToHumanTask.class);
63 | editor.addTaskClass("dog", CalculatePathToStickTask.class);
64 | editor.addTaskClass("dog", FollowPathTask.class);
65 | editor.addTaskClass("dog", GiveStickTask.class);
66 | editor.addTaskClass("dog", HumanWantToPlayCondition.class);
67 | editor.addTaskClass("dog", IsHumanDeadCondition.class);
68 | editor.addTaskClass("dog", IsHumanInRangeCondition.class);
69 | editor.addTaskClass("dog", LieDownTask.class);
70 | editor.addTaskClass("dog", PissTask.class);
71 | editor.addTaskClass("dog", PickUpStickTask.class);
72 | editor.addTaskClass("dog", SetAlreadyCriedForHumanDeathTask.class);
73 | editor.addTaskClass("dog", SetThrowButtonTask.class);
74 | editor.addTaskClass("dog", SitTask.class);
75 | editor.addTaskClass("dog", SpinAroundTask.class);
76 | editor.addTaskClass("dog", SpinAroundToFaceHumanTask.class);
77 | editor.addTaskClass("dog", StandTask.class);
78 | editor.addTaskClass("dog", StickThrownCondition.class);
79 | editor.addTaskClass("dog", WanderTask.class);
80 | editor.addTaskClass("dog", WhineTask.class);
81 |
82 | return editor;
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/BulletLocation.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2014 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 | import com.badlogic.gdx.ai.utils.Location;
20 | import com.badlogic.gdx.math.Vector3;
21 |
22 | public class BulletLocation implements Location {
23 |
24 | Vector3 position;
25 | float orientation;
26 |
27 | public BulletLocation() {
28 | this.position = new Vector3();
29 | this.orientation = 0;
30 | }
31 |
32 | @Override
33 | public Vector3 getPosition() {
34 | return position;
35 | }
36 |
37 | @Override
38 | public float getOrientation() {
39 | return orientation;
40 | }
41 |
42 | @Override
43 | public void setOrientation(float orientation) {
44 | this.orientation = orientation;
45 | }
46 |
47 | @Override
48 | public Location newLocation() {
49 | return new BulletLocation();
50 | }
51 |
52 | @Override
53 | public float vectorToAngle(Vector3 vector) {
54 | return BulletSteeringUtils.vectorToAngle(vector);
55 | }
56 |
57 | @Override
58 | public Vector3 angleToVector(Vector3 outVector, float angle) {
59 | return BulletSteeringUtils.angleToVector(outVector, angle);
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/BulletSteeringUtils.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2014 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 | import com.badlogic.gdx.math.Vector3;
20 |
21 | public final class BulletSteeringUtils {
22 |
23 | private BulletSteeringUtils() {
24 | }
25 |
26 | public static float vectorToAngle(Vector3 vector) {
27 | // return (float)Math.atan2(vector.z, vector.x);
28 | return (float) Math.atan2(-vector.z, vector.x);
29 | }
30 |
31 | public static Vector3 angleToVector(Vector3 outVector, float angle) {
32 | // outVector.set(MathUtils.cos(angle), 0f, MathUtils.sin(angle));
33 | outVector.z = -(float) Math.sin(angle);
34 | outVector.y = 0;
35 | outVector.x = (float) Math.cos(angle);
36 | return outVector;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/Constants.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2014 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 | import com.badlogic.gdx.math.MathUtils;
20 | import com.badlogic.gdx.math.Vector3;
21 |
22 | /**
23 | * @author davebaol
24 | */
25 | public final class Constants {
26 |
27 | private Constants () {
28 | }
29 |
30 | //
31 | // Vector constants
32 | //
33 | public static final Vector3 V3_UP = Vector3.Y;
34 | public static final Vector3 V3_DOWN = new Vector3(V3_UP).scl(-1);
35 |
36 | //
37 | // Math constants
38 | //
39 | public static final float PI = MathUtils.PI;
40 | public static final float PI2 = 2f * MathUtils.PI;
41 | public static final float PI0_5 = 0.5f * PI;
42 | public static final float PI0_25 = 0.25f * PI;
43 | public static final float PI0_75 = 0.75f * PI;
44 |
45 | //
46 | // Message codes
47 | //
48 | public static final int MSG_DOG_LETS_PLAY = 1;
49 | public static final int MSG_DOG_LETS_STOP_PLAYING = 2;
50 | public static final int MSG_DOG_STICK_THROWN = 3;
51 | public static final int MSG_DOG_HUMAN_IS_DEAD = 4;
52 | public static final int MSG_DOG_HUMAN_IS_RESURRECTED = 5;
53 |
54 | public static final int MSG_GUI_CLEAR_DOG_BUTTON = 10;
55 | public static final int MSG_GUI_SET_DOG_BUTTON_TO_WHISTLE = 11;
56 | public static final int MSG_GUI_SET_DOG_BUTTON_TO_THROW = 12;
57 | public static final int MSG_GUI_UPDATE_DOG_BUTTON = 13;
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/Engine.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 | import com.badlogic.gdx.utils.Array;
20 | import com.badlogic.gdx.utils.LongMap;
21 |
22 | public class Engine {
23 |
24 | private Array entities;
25 | private LongMap entitiesById;
26 |
27 | private long nextEntityId = 1;
28 |
29 | public Engine(){
30 | entities = new Array(false, 16);
31 | entitiesById = new LongMap();
32 | }
33 |
34 | private long obtainEntityId() {
35 | return nextEntityId++;
36 | }
37 |
38 | /**
39 | * Adds an entity to this Engine.
40 | * This will throw an IllegalArgumentException if the given entity
41 | * was already registered with an engine.
42 | */
43 | public void addEntity(Entity entity){
44 | if (entity.uuid != 0L) {
45 | throw new IllegalArgumentException("Entity is already registered with an Engine id = " + entity.uuid);
46 | }
47 |
48 | entity.uuid = obtainEntityId();
49 |
50 | entities.add(entity);
51 | entitiesById.put(entity.getId(), entity);
52 | }
53 |
54 | /**
55 | * Removes an entity from this Engine.
56 | */
57 | public void removeEntity(Entity entity){
58 | boolean removed = false;
59 |
60 | entities.removeValue(entity, true);
61 |
62 | if (entitiesById.remove(entity.getId()) == entity) {
63 | removed = true;
64 | }
65 |
66 | if (removed) {
67 | entity.uuid = 0L;
68 | }
69 | }
70 |
71 | public Entity getEntity(long id) {
72 | return entitiesById.get(id);
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/Entity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 |
20 | public class Entity {
21 |
22 | long uuid;
23 |
24 | /** Creates an empty Entity. */
25 | public Entity () {
26 | }
27 |
28 | /** @return The Entity's unique id. */
29 | public long getId () {
30 | return uuid;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/GhostCamera.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 | import com.badlogic.gdx.graphics.PerspectiveCamera;
20 | import com.badlogic.gdx.math.MathUtils;
21 | import com.badlogic.gdx.math.Quaternion;
22 | import com.badlogic.gdx.math.Vector3;
23 |
24 | /**
25 | * @author jsjolund
26 | */
27 | public class GhostCamera extends PerspectiveCamera {
28 |
29 | public final Vector3 targetPosition = new Vector3();
30 | public final Vector3 targetDirection = new Vector3();
31 | public final Vector3 targetUp = new Vector3();
32 |
33 | private final Vector3 tmp = new Vector3();
34 |
35 |
36 | public GhostCamera(float fieldOfViewY, float viewportWidth, float viewportHeight) {
37 | super(fieldOfViewY, viewportWidth, viewportHeight);
38 | targetPosition.set(super.position);
39 | targetDirection.set(super.direction);
40 | targetUp.set(super.up);
41 | }
42 |
43 | public void update(float alpha) {
44 | alpha = MathUtils.clamp(alpha, 0.1f, 0.9f);
45 | position.lerp(targetPosition, alpha);
46 | direction.lerp(targetDirection, alpha);
47 | up.lerp(targetUp, alpha);
48 | super.update();
49 | }
50 |
51 | public void snapToTarget() {
52 | position.set(targetPosition);
53 | direction.set(targetDirection);
54 | up.set(targetUp);
55 | }
56 |
57 | public void rotateAround(Vector3 point, Quaternion quat) {
58 | tmp.set(point).sub(targetPosition);
59 | targetPosition.add(tmp);
60 | quat.transform(targetDirection);
61 | quat.transform(targetUp);
62 | quat.transform(tmp);
63 | targetPosition.add(-tmp.x, -tmp.y, -tmp.z);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/Observable.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 | import com.badlogic.gdx.utils.Bits;
20 | import com.mygdx.game.objects.GameCharacter;
21 |
22 | /**
23 | * @author jsjolund
24 | */
25 | public interface Observable {
26 |
27 | void addObserver(Observer observer);
28 |
29 | void removeObserver(Observer observer);
30 |
31 | void notifyObserversEntitySelected(GameCharacter entity);
32 |
33 | void notifyObserversLayerChanged(Bits layer);
34 |
35 | void notifyCursorWorldPosition(float x, float y, float z);
36 | }
37 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/Observer.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 | import com.badlogic.gdx.utils.Bits;
20 | import com.mygdx.game.objects.GameCharacter;
21 |
22 | /**
23 | * @author jsjolund
24 | */
25 | public interface Observer {
26 |
27 | void notifyEntitySelected(GameCharacter entity);
28 |
29 | void notifyLayerChanged(Bits layer);
30 |
31 | void notifyCursorWorldPosition(float x, float y, float z);
32 | }
33 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/Sounds.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 | import com.badlogic.gdx.Gdx;
20 | import com.badlogic.gdx.audio.Sound;
21 | import com.badlogic.gdx.utils.Disposable;
22 |
23 | public class Sounds implements Disposable {
24 |
25 | public final Sound bark;
26 | public final Sound whine;
27 | public final Sound whistle;
28 |
29 | public Sounds () {
30 | bark = load("sounds/bark.mp3");
31 | whine = load("sounds/whine.mp3");
32 | whistle = load("sounds/whistle.mp3");
33 | }
34 |
35 | public void dispose() {
36 | bark.dispose();
37 | whine.dispose();
38 | whistle.dispose();
39 | }
40 |
41 | private static Sound load(String file) {
42 | Sound sound = Gdx.audio.newSound(Gdx.files.internal(file));
43 | sound.play(0); // this should force loading on Android, so avoiding the wait on first play in game
44 | return sound;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/Steerer.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2015 See AUTHORS file.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.mygdx.game.utilities;
18 |
19 | import com.badlogic.gdx.ai.steer.SteeringAcceleration;
20 | import com.badlogic.gdx.ai.steer.SteeringBehavior;
21 | import com.badlogic.gdx.math.Vector3;
22 | import com.mygdx.game.GameRenderer;
23 | import com.mygdx.game.objects.SteerableBody;
24 |
25 | /**
26 | * The base class for steerers. Typically, a steerer gathers some steering behaviors and makes them cooperate somehow
27 | * in order to create more complex behaviors.
28 | *
29 | * @author davebaol
30 | */
31 | public abstract class Steerer {
32 |
33 | protected final SteerableBody steerableBody;
34 |
35 | /**
36 | * Create a {@code Steerer} for the given steerable body.
37 | * @param steerableBody the steerable body
38 | */
39 | public Steerer(SteerableBody steerableBody) {
40 | this.steerableBody = steerableBody;
41 | }
42 |
43 | /**
44 | * Calculate the steering acceleration produced by this steerer.
45 | * @param steering the output steering acceleration
46 | * @return {@code false} if steering has completed (for instance the end of the path has been reached); {@code true} otherwise
47 | */
48 | public boolean calculateSteering (SteeringAcceleration steering) {
49 | return processSteering(getSteeringBehavior().calculateSteering(steering));
50 | }
51 |
52 | /**
53 | * Returns the steering behavior of this steerer, usually a priority or a blended steering grouping other steering behaviors.
54 | */
55 | public abstract SteeringBehavior getSteeringBehavior();
56 |
57 | /**
58 | * Called by {@link Steerer#calculateSteering(SteeringAcceleration)} to give this steerer the chance to:
59 | *
60 | * - decide whether this steerer has completed, for instance the end of the path has been reached
61 | * - manipulate the acceleration produced by the steering behavior of this steerer
62 | *
63 | * @param steering the input/output steering acceleration
64 | * @return {@code false} if steering has completed; {@code true} otherwise
65 | */
66 | public abstract boolean processSteering(SteeringAcceleration steering);
67 |
68 | /**
69 | * Called by {@link SteerableBody#startSteering()} to give this steerer the chance to prepare resources, for instance.
70 | */
71 | public abstract void startSteering();
72 |
73 | /**
74 | * Called by {@link SteerableBody#stopSteering()} to give this steerer the chance to release resources, for instance.
75 | * @return {@code true} if the linear velocity must be cleared; {@code false} otherwise
76 | */
77 | public abstract boolean stopSteering();
78 |
79 | /**
80 | * Draws the debug info of this steerer.
81 | * @param gameRenderer the renderer
82 | */
83 | public abstract void draw(GameRenderer gameRenderer);
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/core/src/com/mygdx/game/utilities/VertexColorTextureBlend.java:
--------------------------------------------------------------------------------
1 | package com.mygdx.game.utilities;
2 |
3 |
4 | import com.badlogic.gdx.graphics.Texture;
5 | import com.badlogic.gdx.graphics.g3d.attributes.TextureAttribute;
6 |
7 | public class VertexColorTextureBlend extends TextureAttribute {
8 |
9 | public final static String RedAlias = "redVertexColorBlendTexture";
10 | public final static long Red = register(RedAlias);
11 | public final static String GreenAlias = "greenVertexColorBlendTexture";
12 | public final static long Green = register(GreenAlias);
13 | public final static String BlueAlias = "blueVertexColorBlendTexture";
14 | public final static long Blue = register(BlueAlias);
15 |
16 | static {
17 | Mask = Mask | Red | Green | Blue;
18 | }
19 |
20 | public VertexColorTextureBlend(long type, Texture texture) {
21 | super(type, texture);
22 | textureDescription.uWrap = Texture.TextureWrap.Repeat;
23 | textureDescription.vWrap = Texture.TextureWrap.Repeat;
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/desktop/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "java"
2 |
3 | sourceCompatibility = 1.6
4 | sourceSets.main.java.srcDirs = [ "src/" ]
5 |
6 | project.ext.mainClassName = "com.mygdx.game.desktop.DesktopLauncher"
7 | project.ext.assetsDir = new File("../android/assets");
8 |
9 | task run(dependsOn: classes, type: JavaExec) {
10 | main = project.mainClassName
11 | classpath = sourceSets.main.runtimeClasspath
12 | standardInput = System.in
13 | workingDir = project.assetsDir
14 | ignoreExitValue = true
15 | }
16 |
17 | task dist(type: Jar) {
18 | from files(sourceSets.main.output.classesDir)
19 | from files(sourceSets.main.output.resourcesDir)
20 | from {configurations.compile.collect {zipTree(it)}}
21 | from files(project.assetsDir);
22 |
23 | manifest {
24 | attributes 'Main-Class': project.mainClassName
25 | }
26 | }
27 |
28 | dist.dependsOn classes
29 |
30 | eclipse {
31 | project {
32 | name = appName + "-desktop"
33 | linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/android/assets'
34 | }
35 | }
36 |
37 | task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
38 | doLast {
39 | def classpath = new XmlParser().parse(file(".classpath"))
40 | new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]);
41 | def writer = new FileWriter(file(".classpath"))
42 | def printer = new XmlNodePrinter(new PrintWriter(writer))
43 | printer.setPreserveWhitespace(true)
44 | printer.print(classpath)
45 | }
46 | }
--------------------------------------------------------------------------------
/desktop/src/com/mygdx/game/desktop/DesktopLauncher.java:
--------------------------------------------------------------------------------
1 | package com.mygdx.game.desktop;
2 |
3 | import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
4 | import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
5 | import com.mygdx.game.GdxDemo3D;
6 |
7 | public class DesktopLauncher {
8 |
9 | public static void main(String[] arg) {
10 | LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
11 | new LwjglApplication(new GdxDemo3D(), config);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx512m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Sep 21 13:08:26 CEST 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=http\://services.gradle.org/distributions/gradle-2.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/ios/Info.plist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${app.name}
9 | CFBundleExecutable
10 | ${app.executable}
11 | CFBundleIdentifier
12 | ${app.id}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${app.name}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | ${app.version}
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | ${app.build}
25 | LSRequiresIPhoneOS
26 |
27 | UIViewControllerBasedStatusBarAppearance
28 |
29 | UIStatusBarHidden
30 |
31 | UIDeviceFamily
32 |
33 | 1
34 | 2
35 |
36 | UIRequiredDeviceCapabilities
37 |
38 | armv7
39 | opengles-2
40 |
41 | UISupportedInterfaceOrientations
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationLandscapeLeft
45 | UIInterfaceOrientationLandscapeRight
46 |
47 | CFBundleIcons
48 |
49 | CFBundlePrimaryIcon
50 |
51 | CFBundleIconFiles
52 |
53 | Icon
54 | Icon-72
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/ios/build.gradle:
--------------------------------------------------------------------------------
1 | sourceSets.main.java.srcDirs = [ "src/" ]
2 |
3 | sourceCompatibility = '1.7'
4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
5 |
6 | ext {
7 | mainClassName = "com.mygdx.game.IOSLauncher"
8 | }
9 |
10 | launchIPhoneSimulator.dependsOn build
11 | launchIPadSimulator.dependsOn build
12 | launchIOSDevice.dependsOn build
13 | createIPA.dependsOn build
14 |
15 |
16 | eclipse.project {
17 | name = appName + "-ios"
18 | natures 'org.robovm.eclipse.RoboVMNature'
19 | }
--------------------------------------------------------------------------------
/ios/data/Default-375w-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Default-375w-667h@2x.png
--------------------------------------------------------------------------------
/ios/data/Default-414w-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Default-414w-736h@3x.png
--------------------------------------------------------------------------------
/ios/data/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Default-568h@2x.png
--------------------------------------------------------------------------------
/ios/data/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Default.png
--------------------------------------------------------------------------------
/ios/data/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Default@2x.png
--------------------------------------------------------------------------------
/ios/data/Default@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Default@2x~ipad.png
--------------------------------------------------------------------------------
/ios/data/Default~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Default~ipad.png
--------------------------------------------------------------------------------
/ios/data/Icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Icon-72.png
--------------------------------------------------------------------------------
/ios/data/Icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Icon-72@2x.png
--------------------------------------------------------------------------------
/ios/data/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Icon.png
--------------------------------------------------------------------------------
/ios/data/Icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsjolund/GdxDemo3D/868b384375390a4e6c4559693adff2015989df2c/ios/data/Icon@2x.png
--------------------------------------------------------------------------------
/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.mygdx.game.IOSLauncher
3 | app.mainclass=com.mygdx.game.IOSLauncher
4 | app.executable=IOSLauncher
5 | app.build=1
6 | app.name=my-gdx-game
7 |
--------------------------------------------------------------------------------
/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | thumbv7
6 | ios
7 | Info.plist.xml
8 |
9 |
10 | ../android/assets
11 |
12 | **
13 |
14 | true
15 |
16 |
17 | data
18 |
19 |
20 |
21 | com.badlogic.gdx.scenes.scene2d.ui.*
22 | com.badlogic.gdx.graphics.g3d.particles.**
23 | com.android.okhttp.HttpHandler
24 | com.android.okhttp.HttpsHandler
25 | com.android.org.conscrypt.**
26 | com.android.org.bouncycastle.jce.provider.BouncyCastleProvider
27 | com.android.org.bouncycastle.jcajce.provider.keystore.BC$Mappings
28 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi
29 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$Std
30 | com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi
31 | com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryOpenSSL
32 | org.apache.harmony.security.provider.cert.DRLCertFactory
33 | org.apache.harmony.security.provider.crypto.CryptoProvider
34 |
35 |
36 | z
37 |
38 |
39 | UIKit
40 | OpenGLES
41 | QuartzCore
42 | CoreGraphics
43 | OpenAL
44 | AudioToolbox
45 | AVFoundation
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ios/src/com/mygdx/game/IOSLauncher.java:
--------------------------------------------------------------------------------
1 | package com.mygdx.game;
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool;
4 | import org.robovm.apple.uikit.UIApplication;
5 |
6 | import com.badlogic.gdx.backends.iosrobovm.IOSApplication;
7 | import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
8 | import com.mygdx.game.GdxDemo3D;
9 |
10 | public class IOSLauncher extends IOSApplication.Delegate {
11 | @Override
12 | protected IOSApplication createApplication() {
13 | IOSApplicationConfiguration config = new IOSApplicationConfiguration();
14 | return new IOSApplication(new GdxDemo3D(), config);
15 | }
16 |
17 | public static void main(String[] argv) {
18 | NSAutoreleasePool pool = new NSAutoreleasePool();
19 | UIApplication.main(argv, null, IOSLauncher.class);
20 | pool.close();
21 | }
22 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include 'desktop', 'android', 'ios', 'core'
--------------------------------------------------------------------------------