From 3b21674369d99a99c029acf2489aae7607f23d96 Mon Sep 17 00:00:00 2001 From: badlogic Date: Thu, 21 Mar 2013 16:55:20 +0100 Subject: [PATCH] [fixed] moved xoppa's package to top-level g3d package, moved old stuff to g3d.old for reference, removed TextureDict and TextureRef.java --- gdx/src/com/badlogic/gdx/graphics/TextureDict.java | 82 --- gdx/src/com/badlogic/gdx/graphics/TextureRef.java | 69 -- .../graphics/g3d/{xoppa => }/DefaultShader.java | 6 +- .../gdx/graphics/g3d/{xoppa => }/RenderBatch.java | 14 +- .../g3d/{xoppa => }/RenderBatchAdapter.java | 12 +- .../g3d/{xoppa => }/RenderBatchListener.java | 2 +- .../graphics/g3d/{xoppa => }/RenderContext.java | 4 +- .../graphics/g3d/{xoppa => }/RenderInstance.java | 8 +- .../gdx/graphics/g3d/{xoppa => }/Renderable.java | 4 +- .../gdx/graphics/g3d/{xoppa => }/Shader.java | 10 +- .../gdx/graphics/g3d/loader/JsonAnimation.java | 5 + .../g3d/{loaders/json => loader}/JsonMaterial.java | 48 +- .../g3d/{loaders/json => loader}/JsonMesh.java | 20 +- .../g3d/{loaders/json => loader}/JsonMeshPart.java | 14 +- .../json => loader}/JsonMeshPartMaterial.java | 12 +- .../g3d/{loaders/json => loader}/JsonModel.java | 38 +- .../{loaders/json => loader}/JsonModelLoader.java | 816 ++++++++++----------- .../g3d/{loaders/json => loader}/JsonNode.java | 30 +- .../g3d/{loaders/json => loader}/JsonTexture.java | 2 +- .../graphics/g3d/loaders/json/JsonAnimation.java | 5 - .../graphics/g3d/materials/BlendingAttribute.java | 104 +-- .../gdx/graphics/g3d/materials/ColorAttribute.java | 125 ++-- .../g3d/{xoppa => }/materials/NewMaterial.java | 2 +- .../graphics/g3d/materials/TextureAttribute.java | 157 +--- .../g3d/{ => old}/AnimatedModelInstance.java | 2 +- .../graphics/g3d/{ => old}/AnimatedModelNode.java | 4 +- .../graphics/g3d/{ => old}/ModelLoaderHints.java | 4 +- .../gdx/graphics/g3d/{ => old}/ModelRenderer.java | 6 +- .../graphics/g3d/{ => old}/StillModelInstance.java | 4 +- .../gdx/graphics/g3d/{ => old}/StillModelNode.java | 4 +- .../{ => old}/loaders/KeyframedModelLoader.java | 6 +- .../g3d/{ => old}/loaders/ModelLoader.java | 6 +- .../g3d/{ => old}/loaders/ModelLoaderRegistry.java | 28 +- .../g3d/{ => old}/loaders/SkeletonModelLoader.java | 6 +- .../g3d/{ => old}/loaders/StillModelLoader.java | 6 +- .../chunks => old/loaders/g3d}/ChunkReader.java | 4 +- .../chunks => old/loaders/g3d}/ChunkWriter.java | 4 +- .../loaders/g3d}/CountingDataInputStream.java | 2 +- .../g3d/{ => old}/loaders/g3d/G3dConstants.java | 2 +- .../chunks => old/loaders/g3d}/G3dExporter.java | 25 +- .../g3d/{ => old}/loaders/g3d/G3dLoader.java | 39 +- .../g3d/{ => old}/loaders/g3d/G3dtLoader.java | 20 +- .../g3d/{ => old}/loaders/md2/MD2Frame.java | 2 +- .../g3d/{ => old}/loaders/md2/MD2Header.java | 2 +- .../g3d/{ => old}/loaders/md2/MD2Loader.java | 14 +- .../g3d/{ => old}/loaders/md2/MD2Normals.java | 2 +- .../g3d/{ => old}/loaders/md2/MD2Triangle.java | 2 +- .../g3d/{ => old}/loaders/wavefront/ObjLoader.java | 16 +- .../g3d/old/materials/BlendingAttribute.java | 88 +++ .../graphics/g3d/old/materials/ColorAttribute.java | 96 +++ .../graphics/g3d/{ => old}/materials/Material.java | 2 +- .../g3d/{ => old}/materials/MaterialAttribute.java | 2 +- .../g3d/old/materials/TextureAttribute.java | 128 ++++ .../g3d/{ => old}/model/AnimatedModel.java | 2 +- .../graphics/g3d/{ => old}/model/Animation.java | 2 +- .../gdx/graphics/g3d/{ => old}/model/Model.java | 4 +- .../gdx/graphics/g3d/{ => old}/model/SubMesh.java | 4 +- .../g3d/{ => old}/model/keyframe/Keyframe.java | 2 +- .../model/keyframe/KeyframedAnimation.java | 4 +- .../{ => old}/model/keyframe/KeyframedModel.java | 10 +- .../{ => old}/model/keyframe/KeyframedSubMesh.java | 4 +- .../g3d/{ => old}/model/skeleton/Skeleton.java | 2 +- .../model/skeleton/SkeletonAnimation.java | 4 +- .../{ => old}/model/skeleton/SkeletonJoint.java | 2 +- .../{ => old}/model/skeleton/SkeletonKeyframe.java | 2 +- .../{ => old}/model/skeleton/SkeletonModel.java | 10 +- .../model/skeleton/SkeletonModelGpuSkinned.java | 8 +- .../{ => old}/model/skeleton/SkeletonSubMesh.java | 4 +- .../g3d/{ => old}/model/still/StillModel.java | 8 +- .../g3d/{ => old}/model/still/StillSubMesh.java | 6 +- .../g3d/{xoppa => }/test/InterimModel.java | 40 +- .../gdx/graphics/g3d/{xoppa => }/test/Light.java | 2 +- .../badlogic/gdx/graphics/g3d/test/NewModel.java | 8 + .../g3d/{xoppa => }/test/OldBatchRenderer.java | 4 +- .../{xoppa => }/test/OldBatchRendererGLES11.java | 10 +- .../{xoppa => }/test/OldBatchRendererGLES20.java | 12 +- .../graphics/g3d/{xoppa => }/test/TestShader.java | 20 +- .../g3d/{xoppa => }/test/test.fragment.glsl | 0 .../graphics/g3d/{xoppa => }/test/test.vertex.glsl | 0 .../gdx/graphics/g3d/{xoppa => }/utils/Binder.java | 2 +- .../g3d/{xoppa => }/utils/ExclusiveTextures.java | 2 +- .../g3d/{xoppa => }/utils/TextureDescription.java | 2 +- .../g3d/xoppa/materials/BlendingAttribute.java | 40 - .../g3d/xoppa/materials/ColorAttribute.java | 55 -- .../g3d/xoppa/materials/TextureAttribute.java | 47 -- .../gdx/graphics/g3d/xoppa/test/NewModel.java | 8 - .../gdx/tests/lwjgl/LwjglDebugStarter.java | 4 +- .../src/com/badlogic/gdx/tests/CullTest.java | 4 +- .../com/badlogic/gdx/tests/EdgeDetectionTest.java | 4 +- .../gdx/tests/FramebufferToTextureTest.java | 4 +- .../src/com/badlogic/gdx/tests/FrustumTest.java | 4 +- .../src/com/badlogic/gdx/tests/MaterialTest.java | 12 +- .../src/com/badlogic/gdx/tests/ObjTest.java | 4 +- .../src/com/badlogic/gdx/tests/PickingTest.java | 4 +- .../src/com/badlogic/gdx/tests/ProjectTest.java | 4 +- .../badlogic/gdx/tests/ProjectiveTextureTest.java | 4 +- .../com/badlogic/gdx/tests/ShadowMappingTest.java | 4 +- .../badlogic/gdx/tests/bullet/BaseBulletTest.java | 6 +- .../com/badlogic/gdx/tests/bullet/BaseEntity.java | 2 +- .../com/badlogic/gdx/tests/bullet/BaseWorld.java | 2 +- .../gdx/tests/bullet/BulletConstructor.java | 2 +- .../badlogic/gdx/tests/bullet/BulletEntity.java | 2 +- .../gdx/tests/bullet/CollisionWorldTest.java | 2 +- .../badlogic/gdx/tests/bullet/ConstraintsTest.java | 6 +- .../badlogic/gdx/tests/bullet/ConvexHullTest.java | 8 +- .../gdx/tests/bullet/FrustumCullingTest.java | 8 +- .../badlogic/gdx/tests/bullet/MeshShapeTest.java | 4 +- .../gdx/tests/bullet/RayPickRagdollTest.java | 8 +- .../badlogic/gdx/tests/bullet/SoftMeshTest.java | 6 +- .../badlogic/gdx/tests/g3d/BatchRenderTest.java | 44 +- .../gdx/tests/g3d/JsonModelLoaderTest.java | 6 +- 111 files changed, 1226 insertions(+), 1377 deletions(-) delete mode 100644 gdx/src/com/badlogic/gdx/graphics/TextureDict.java delete mode 100644 gdx/src/com/badlogic/gdx/graphics/TextureRef.java rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/DefaultShader.java (76%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/RenderBatch.java (92%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/RenderBatchAdapter.java (76%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/RenderBatchListener.java (89%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/RenderContext.java (92%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/RenderInstance.java (81%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/Renderable.java (63%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/Shader.java (64%) create mode 100644 gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonAnimation.java rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/json => loader}/JsonMaterial.java (83%) mode change 100755 => 100644 rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/json => loader}/JsonMesh.java (75%) mode change 100755 => 100644 rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/json => loader}/JsonMeshPart.java (63%) mode change 100755 => 100644 rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/json => loader}/JsonMeshPartMaterial.java (61%) mode change 100755 => 100644 rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/json => loader}/JsonModel.java (85%) mode change 100755 => 100644 rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/json => loader}/JsonModelLoader.java (92%) mode change 100755 => 100644 rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/json => loader}/JsonNode.java (83%) mode change 100755 => 100644 rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/json => loader}/JsonTexture.java (76%) delete mode 100644 gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonAnimation.java rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/materials/NewMaterial.java (99%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/AnimatedModelInstance.java (95%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/AnimatedModelNode.java (94%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/ModelLoaderHints.java (90%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/ModelRenderer.java (85%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/StillModelInstance.java (90%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/StillModelNode.java (95%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/KeyframedModelLoader.java (84%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/ModelLoader.java (86%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/ModelLoaderRegistry.java (94%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/SkeletonModelLoader.java (84%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/StillModelLoader.java (85%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/g3d/chunks => old/loaders/g3d}/ChunkReader.java (98%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/g3d/chunks => old/loaders/g3d}/ChunkWriter.java (97%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/g3d/chunks => old/loaders/g3d}/CountingDataInputStream.java (98%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/g3d/G3dConstants.java (97%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{loaders/g3d/chunks => old/loaders/g3d}/G3dExporter.java (92%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/g3d/G3dLoader.java (93%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/g3d/G3dtLoader.java (94%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/md2/MD2Frame.java (93%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/md2/MD2Header.java (95%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/md2/MD2Loader.java (96%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/md2/MD2Normals.java (99%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/md2/MD2Triangle.java (94%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/loaders/wavefront/ObjLoader.java (96%) create mode 100644 gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/BlendingAttribute.java create mode 100644 gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/ColorAttribute.java rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/materials/Material.java (99%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/materials/MaterialAttribute.java (96%) create mode 100644 gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/TextureAttribute.java rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/AnimatedModel.java (97%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/Animation.java (95%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/Model.java (97%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/SubMesh.java (93%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/keyframe/Keyframe.java (94%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/keyframe/KeyframedAnimation.java (90%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/keyframe/KeyframedModel.java (95%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/keyframe/KeyframedSubMesh.java (93%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/skeleton/Skeleton.java (99%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/skeleton/SkeletonAnimation.java (90%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/skeleton/SkeletonJoint.java (95%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/skeleton/SkeletonKeyframe.java (95%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/skeleton/SkeletonModel.java (95%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/skeleton/SkeletonModelGpuSkinned.java (94%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/skeleton/SkeletonSubMesh.java (92%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/still/StillModel.java (93%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{ => old}/model/still/StillSubMesh.java (87%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/test/InterimModel.java (53%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/test/Light.java (95%) create mode 100644 gdx/src/com/badlogic/gdx/graphics/g3d/test/NewModel.java rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/test/OldBatchRenderer.java (77%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/test/OldBatchRendererGLES11.java (93%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/test/OldBatchRendererGLES20.java (94%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/test/TestShader.java (93%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/test/test.fragment.glsl (100%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/test/test.vertex.glsl (100%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/utils/Binder.java (75%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/utils/ExclusiveTextures.java (99%) rename gdx/src/com/badlogic/gdx/graphics/g3d/{xoppa => }/utils/TextureDescription.java (97%) delete mode 100644 gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/BlendingAttribute.java delete mode 100644 gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/ColorAttribute.java delete mode 100644 gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/TextureAttribute.java delete mode 100644 gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/NewModel.java diff --git a/gdx/src/com/badlogic/gdx/graphics/TextureDict.java b/gdx/src/com/badlogic/gdx/graphics/TextureDict.java deleted file mode 100644 index bedea2072..000000000 --- a/gdx/src/com/badlogic/gdx/graphics/TextureDict.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright 2011 See AUTHORS file. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ - -package com.badlogic.gdx.graphics; - -import com.badlogic.gdx.Files.FileType; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.Texture.TextureFilter; -import com.badlogic.gdx.graphics.Texture.TextureWrap; -import com.badlogic.gdx.utils.ObjectMap; - -/**

- * A texture dictionary is used to track the usage of your textures and supply a single point of access for texture resources. It - * stores {@link TextureRef}s by their path. If you need to load the same texture in different parts of your application it will - * only be loaded into memory once by the dictionary. - *

- * @deprecated - * @author Dave Clayton */ -public class TextureDict { - - private static ObjectMap sDictionary = new ObjectMap(); - - /** Loads a new texture into the dictionary as a reference counted {@link TextureRef}. - * @param path the path to the texture image. - * @return the {@TextureRef} representing the texture. */ - public static TextureRef loadTexture (String path) { - return loadTexture(path, TextureFilter.MipMap, TextureFilter.Linear, TextureWrap.ClampToEdge, TextureWrap.ClampToEdge); - } - - /** Loads a new texture into the dictionary as a reference counted {@link TextureRef}. - * @param path the path to the texture image. - * @param minFilter minFilter {@link TextureFilter}. - * @param magFilter magFilter {@link TextureFilter}. - * @param uwrap u-wrapping. - * @param vwrap v-wrapping. - * @return the {@TextureRef} representing the texture. */ - public static TextureRef loadTexture (String path, TextureFilter minFilter, TextureFilter magFilter, TextureWrap uwrap, - TextureWrap vwrap) { - if (sDictionary.containsKey(path)) { - TextureRef ref = sDictionary.get(path); - ref.addRef(); - return ref; - } - // load new texture - FileHandle texFile = Gdx.app.getFiles().getFileHandle(path, FileType.Internal); - Texture newTex = new Texture(texFile, minFilter.isMipMap() || magFilter.isMipMap() ? true : false); - newTex.setFilter(minFilter, magFilter); - newTex.setWrap(uwrap, vwrap); - TextureRef ref = new TextureRef(path, newTex); - sDictionary.put(path, ref); - return ref; - } - - /** Removes a texture from the dictionary. In general you should probably not use this - use {@link TextureRef#unload()} - * instead. - * @param path to the texture. */ - public static void removeTexture (String path) { - sDictionary.remove(path); - } - - /** Unloads all of the currently managed textures. */ - public static void unloadAll () { - for (TextureRef tex : sDictionary.values()) { - tex.dispose(); - } - sDictionary.clear(); - } -} diff --git a/gdx/src/com/badlogic/gdx/graphics/TextureRef.java b/gdx/src/com/badlogic/gdx/graphics/TextureRef.java deleted file mode 100644 index 7bbbe75de..000000000 --- a/gdx/src/com/badlogic/gdx/graphics/TextureRef.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright 2011 See AUTHORS file. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ - -package com.badlogic.gdx.graphics; - -/**

- * A reference counted wrapper for a {@link Texture}. TextureRefs are managed by the {@link TextureDict}. - *

- * @deprecated - * @author Dave Clayton */ -public class TextureRef { - public String Name; - private int mRefCount; - private Texture mTexture; - - /** Create a new TextureRef with the given name and texture. - * @param name The texture's name, typically its filesystem path. - * @param texture The texture it reference counts. */ - public TextureRef (String name, Texture texture) { - Name = name; - mTexture = texture; - mRefCount = 1; - } - - /** Adds a reference to the texture. */ - public void addRef () { - mRefCount++; - } - - /** Removes a reference to the texture. If the internal reference count reaches 0, the texture is disposed. - * @return the new reference count. */ - public int unload () { - if (--mRefCount == 0) { - mTexture.dispose(); - mTexture = null; - // Note: This doesn't seem the best way to do this, but it works. Re-factoring welcome :) - TextureDict.removeTexture(Name); - } - return mRefCount; - } - - public void dispose () { - mTexture.dispose(); - } - - /** Binds the texture in OpenGL. */ - public void bind () { - mTexture.bind(); - } - - /** Gets the wrapped texture. - * @return the texture. */ - public Texture get () { - return mTexture; - } -} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/DefaultShader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/DefaultShader.java similarity index 76% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/DefaultShader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/DefaultShader.java index 59fee0a75..4647fc142 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/DefaultShader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/DefaultShader.java @@ -1,7 +1,7 @@ -package com.badlogic.gdx.graphics.g3d.xoppa; +package com.badlogic.gdx.graphics.g3d; -import com.badlogic.gdx.graphics.g3d.xoppa.test.TestShader; -import com.badlogic.gdx.graphics.g3d.xoppa.utils.ExclusiveTextures; +import com.badlogic.gdx.graphics.g3d.test.TestShader; +import com.badlogic.gdx.graphics.g3d.utils.ExclusiveTextures; import com.badlogic.gdx.graphics.glutils.ShaderProgram; public class DefaultShader extends TestShader { diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderBatch.java b/gdx/src/com/badlogic/gdx/graphics/g3d/RenderBatch.java similarity index 92% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderBatch.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/RenderBatch.java index 9868555f8..2a1cf94b8 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderBatch.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/RenderBatch.java @@ -1,12 +1,12 @@ -package com.badlogic.gdx.graphics.g3d.xoppa; +package com.badlogic.gdx.graphics.g3d; import com.badlogic.gdx.graphics.Camera; -import com.badlogic.gdx.graphics.g3d.model.Model; -import com.badlogic.gdx.graphics.g3d.model.SubMesh; -import com.badlogic.gdx.graphics.g3d.xoppa.test.Light; -import com.badlogic.gdx.graphics.g3d.xoppa.test.NewModel; -import com.badlogic.gdx.graphics.g3d.xoppa.test.InterimModel; -import com.badlogic.gdx.graphics.g3d.xoppa.utils.ExclusiveTextures; +import com.badlogic.gdx.graphics.g3d.old.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.SubMesh; +import com.badlogic.gdx.graphics.g3d.test.InterimModel; +import com.badlogic.gdx.graphics.g3d.test.Light; +import com.badlogic.gdx.graphics.g3d.test.NewModel; +import com.badlogic.gdx.graphics.g3d.utils.ExclusiveTextures; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderBatchAdapter.java b/gdx/src/com/badlogic/gdx/graphics/g3d/RenderBatchAdapter.java similarity index 76% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderBatchAdapter.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/RenderBatchAdapter.java index 337764f2d..250c554a7 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderBatchAdapter.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/RenderBatchAdapter.java @@ -1,11 +1,11 @@ -package com.badlogic.gdx.graphics.g3d.xoppa; +package com.badlogic.gdx.graphics.g3d; import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.BlendingAttribute; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.NewMaterial; -import com.badlogic.gdx.graphics.g3d.xoppa.test.TestShader; -import com.badlogic.gdx.graphics.g3d.xoppa.utils.ExclusiveTextures; +import com.badlogic.gdx.graphics.g3d.materials.BlendingAttribute; +import com.badlogic.gdx.graphics.g3d.materials.NewMaterial; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.test.TestShader; +import com.badlogic.gdx.graphics.g3d.utils.ExclusiveTextures; import com.badlogic.gdx.utils.Array; public class RenderBatchAdapter implements RenderBatchListener { diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderBatchListener.java b/gdx/src/com/badlogic/gdx/graphics/g3d/RenderBatchListener.java similarity index 89% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderBatchListener.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/RenderBatchListener.java index 2534bb65c..6e4986b91 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderBatchListener.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/RenderBatchListener.java @@ -1,4 +1,4 @@ -package com.badlogic.gdx.graphics.g3d.xoppa; +package com.badlogic.gdx.graphics.g3d; import java.util.Comparator; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderContext.java b/gdx/src/com/badlogic/gdx/graphics/g3d/RenderContext.java similarity index 92% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderContext.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/RenderContext.java index efaef3761..bd50a1488 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderContext.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/RenderContext.java @@ -1,8 +1,8 @@ -package com.badlogic.gdx.graphics.g3d.xoppa; +package com.badlogic.gdx.graphics.g3d; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL10; -import com.badlogic.gdx.graphics.g3d.xoppa.utils.ExclusiveTextures; +import com.badlogic.gdx.graphics.g3d.utils.ExclusiveTextures; public class RenderContext { public final ExclusiveTextures textures; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderInstance.java b/gdx/src/com/badlogic/gdx/graphics/g3d/RenderInstance.java similarity index 81% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderInstance.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/RenderInstance.java index 90f9628d5..857a09e3f 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/RenderInstance.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/RenderInstance.java @@ -1,9 +1,9 @@ -package com.badlogic.gdx.graphics.g3d.xoppa; +package com.badlogic.gdx.graphics.g3d; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.NewMaterial; -import com.badlogic.gdx.graphics.g3d.xoppa.test.Light; +import com.badlogic.gdx.graphics.g3d.materials.NewMaterial; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.test.Light; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.utils.Pool; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/Renderable.java b/gdx/src/com/badlogic/gdx/graphics/g3d/Renderable.java similarity index 63% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/Renderable.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/Renderable.java index bbb091301..7620b986b 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/Renderable.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/Renderable.java @@ -1,7 +1,7 @@ -package com.badlogic.gdx.graphics.g3d.xoppa; +package com.badlogic.gdx.graphics.g3d; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.NewMaterial; +import com.badlogic.gdx.graphics.g3d.materials.NewMaterial; public class Renderable { public Mesh mesh; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/Shader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/Shader.java similarity index 64% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/Shader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/Shader.java index 923e34a8c..19398da75 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/Shader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/Shader.java @@ -1,12 +1,12 @@ -package com.badlogic.gdx.graphics.g3d.xoppa; +package com.badlogic.gdx.graphics.g3d; import java.util.Comparator; import com.badlogic.gdx.graphics.Camera; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.NewMaterial; -import com.badlogic.gdx.graphics.g3d.xoppa.test.Light; -import com.badlogic.gdx.graphics.g3d.xoppa.test.NewModel; +import com.badlogic.gdx.graphics.g3d.materials.NewMaterial; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.test.Light; +import com.badlogic.gdx.graphics.g3d.test.NewModel; import com.badlogic.gdx.math.Matrix4; public interface Shader extends Comparator { diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonAnimation.java b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonAnimation.java new file mode 100644 index 000000000..75d2d23c2 --- /dev/null +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonAnimation.java @@ -0,0 +1,5 @@ +package com.badlogic.gdx.graphics.g3d.loader; + +public class JsonAnimation { + +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMaterial.java b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMaterial.java old mode 100755 new mode 100644 similarity index 83% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMaterial.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMaterial.java index 7c6e92bdb..474ff870c --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMaterial.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMaterial.java @@ -1,24 +1,24 @@ -package com.badlogic.gdx.graphics.g3d.loaders.json; - -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.Array; - -public class JsonMaterial { - public enum MaterialType { - Lambert, - Phong - } - - public String id; - - public MaterialType type; - - public Color ambient; - public Color diffuse; - public Color specular; - public Color emissive; - - public float shininess; - - public Array diffuseTextures; -} +package com.badlogic.gdx.graphics.g3d.loader; + +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.utils.Array; + +public class JsonMaterial { + public enum MaterialType { + Lambert, + Phong + } + + public String id; + + public MaterialType type; + + public Color ambient; + public Color diffuse; + public Color specular; + public Color emissive; + + public float shininess; + + public Array diffuseTextures; +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMesh.java b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMesh.java old mode 100755 new mode 100644 similarity index 75% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMesh.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMesh.java index bfd396bad..8bc14b08f --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMesh.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMesh.java @@ -1,10 +1,10 @@ -package com.badlogic.gdx.graphics.g3d.loaders.json; - -import com.badlogic.gdx.graphics.VertexAttribute; - -public class JsonMesh { - public String id; - public VertexAttribute[] attributes; - public float[] vertices; - public JsonMeshPart[] parts; -} +package com.badlogic.gdx.graphics.g3d.loader; + +import com.badlogic.gdx.graphics.VertexAttribute; + +public class JsonMesh { + public String id; + public VertexAttribute[] attributes; + public float[] vertices; + public JsonMeshPart[] parts; +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMeshPart.java b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMeshPart.java old mode 100755 new mode 100644 similarity index 63% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMeshPart.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMeshPart.java index a2fb02aaf..36380785d --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMeshPart.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMeshPart.java @@ -1,7 +1,7 @@ -package com.badlogic.gdx.graphics.g3d.loaders.json; - -public class JsonMeshPart { - public String id; - public short[] indices; - public int primitiveType; -} +package com.badlogic.gdx.graphics.g3d.loader; + +public class JsonMeshPart { + public String id; + public short[] indices; + public int primitiveType; +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMeshPartMaterial.java b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMeshPartMaterial.java old mode 100755 new mode 100644 similarity index 61% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMeshPartMaterial.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMeshPartMaterial.java index 008225534..2d9092abb --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonMeshPartMaterial.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonMeshPartMaterial.java @@ -1,6 +1,6 @@ -package com.badlogic.gdx.graphics.g3d.loaders.json; - -public class JsonMeshPartMaterial { - public String materialId; - public String meshPartId; -} +package com.badlogic.gdx.graphics.g3d.loader; + +public class JsonMeshPartMaterial { + public String materialId; + public String meshPartId; +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonModel.java b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonModel.java old mode 100755 new mode 100644 similarity index 85% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonModel.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonModel.java index 4e282e3de..4341953a4 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonModel.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonModel.java @@ -1,19 +1,19 @@ -package com.badlogic.gdx.graphics.g3d.loaders.json; - -import com.badlogic.gdx.utils.GdxRuntimeException; - -public class JsonModel { - public String version; - public JsonMesh[] meshes; - public JsonMaterial[] materials; - public JsonNode[] nodes; - public JsonAnimation[] animations; - - public void addMesh(JsonMesh mesh) { - for(JsonMesh other: meshes) { - if(other.id.equals(mesh.id)) { - throw new GdxRuntimeException("Mesh with id '" + other.id + "' already in model"); - } - } - } -} +package com.badlogic.gdx.graphics.g3d.loader; + +import com.badlogic.gdx.utils.GdxRuntimeException; + +public class JsonModel { + public String version; + public JsonMesh[] meshes; + public JsonMaterial[] materials; + public JsonNode[] nodes; + public JsonAnimation[] animations; + + public void addMesh(JsonMesh mesh) { + for(JsonMesh other: meshes) { + if(other.id.equals(mesh.id)) { + throw new GdxRuntimeException("Mesh with id '" + other.id + "' already in model"); + } + } + } +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonModelLoader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonModelLoader.java old mode 100755 new mode 100644 similarity index 92% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonModelLoader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonModelLoader.java index 344461d45..678cb9f62 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonModelLoader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonModelLoader.java @@ -1,408 +1,408 @@ -package com.badlogic.gdx.graphics.g3d.loaders.json; - -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.GL10; -import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.Texture.TextureFilter; -import com.badlogic.gdx.graphics.VertexAttribute; -import com.badlogic.gdx.graphics.g3d.ModelLoaderHints; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoader; -import com.badlogic.gdx.graphics.g3d.loaders.json.JsonMaterial.MaterialType; -import com.badlogic.gdx.graphics.g3d.materials.ColorAttribute; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.materials.TextureAttribute; -import com.badlogic.gdx.graphics.g3d.model.Model; -import com.badlogic.gdx.graphics.g3d.model.SubMesh; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.GdxRuntimeException; -import com.badlogic.gdx.utils.JsonReader; -import com.badlogic.gdx.utils.ObjectMap; -import com.badlogic.gdx.utils.OrderedMap; - -/** - * {@link ModelLoader} for the JSON format written by the - * fbx-conv tool. - * - * @author mzechner - * - */ -public class JsonModelLoader implements ModelLoader { - public static String VERSION = "1.0"; - - @Override - public Model load (FileHandle handle, ModelLoaderHints hints) { - JsonModel jsonModel = parseModel(handle, hints); - Model model = null; - - if(jsonModel.animations == null) - model = createStillModel(jsonModel); - else // add hints for sampling to keyframed model - model = createSkeletonModel(jsonModel); - - return model; - } - - private SkeletonModel createSkeletonModel (JsonModel jsonModel) { - // TODO Auto-generated method stub - return null; - } - - private StillModel createStillModel (JsonModel model) { - StillModel stillModel = new StillModel(new SubMesh[model.meshes.length]); - - // We create the materials first - ObjectMap materials = new ObjectMap(); - for(int i=0; i json = (OrderedMap)reader.parse(handle); - - String version = (String)json.get("version"); - if(version == null || !version.equals(VERSION)) { - throw new GdxRuntimeException("No or wrong JSON format version given, should be " + VERSION + ", is " + version); - } - - JsonModel model = new JsonModel(); - parseMeshes(model, json, hints); - parseMaterials(model, json, hints, handle.parent().path()); - parseNodes(model, json, hints); - return model; - } - - private void parseMeshes (JsonModel model, OrderedMap json, ModelLoaderHints hints) { - Array> meshes = (Array>)json.get("meshes"); - if(meshes == null) { - throw new GdxRuntimeException("No meshes found in file"); - } - - model.meshes = new JsonMesh[meshes.size]; - int i = 0; - for(OrderedMap mesh: meshes) { - JsonMesh jsonMesh = new JsonMesh(); - String id = (String)mesh.get("id"); - if(id == null) { - throw new GdxRuntimeException("No id given for mesh"); - } - jsonMesh.id = id; - - Array attributes = (Array)mesh.get("attributes"); - if(attributes == null) { - throw new GdxRuntimeException("No vertex attributes given for mesh '" + id + "'"); - } - jsonMesh.attributes = parseAttributes(attributes); - - Array vertices = (Array)mesh.get("vertices"); - if(vertices == null) { - throw new GdxRuntimeException("No vertices given for mesh '" + id + "'"); - } - float[] verts = new float[vertices.size]; - int idx = 0; - for(Object v: vertices) { - verts[idx++] = (Float)v; - } - jsonMesh.vertices = verts; - - Array> meshParts = (Array>)mesh.get("parts"); - if(meshParts == null) { - throw new GdxRuntimeException("No mesh parts given for mesh '" + id + "'"); - } - Array parts = new Array(); - for(OrderedMap meshPart: meshParts) { - JsonMeshPart jsonPart = new JsonMeshPart(); - String partId = (String)meshPart.get("id"); - if(id == null) { - throw new GdxRuntimeException("Not id given for mesh part"); - } - for(JsonMeshPart other: parts) { - if(other.id.equals(partId)) { - throw new GdxRuntimeException("Mesh part with id '" + partId + "' already in defined"); - } - } - jsonPart.id = partId; - - String type = (String)meshPart.get("type"); - if(type == null) { - throw new GdxRuntimeException("No primitive type given for mesh part '" + partId + "'"); - } - jsonPart.primitiveType = parseType(type); - - Array indices = (Array)meshPart.get("indices"); - if(indices == null) { - throw new GdxRuntimeException("No indices given for mesh part '" + partId + "'"); - } - short[] partIndices = new short[indices.size]; - idx = 0; - for(Object index: indices) { - partIndices[idx++] = (short)(float)(Float)index; - } - jsonPart.indices = partIndices; - parts.add(jsonPart); - } - jsonMesh.parts = parts.toArray(JsonMeshPart.class); - model.meshes[i++] = jsonMesh; - } - } - - private int parseType (String type) { - if(type.equals("TRIANGLES")) { - return GL10.GL_TRIANGLES; - } else if(type.equals("LINES")) { - return GL10.GL_LINES; - } else if(type.equals("POINTS")) { - return GL10.GL_POINTS; - } else if(type.equals("TRIANGLE_STRIP")) { - return GL10.GL_TRIANGLE_STRIP; - } else if(type.equals("LINE_STRIP")) { - return GL10.GL_LINE_STRIP; - } /* Gameplay encoder doesn't read out line loop - else if(type.equals("lineloop")) { - return GL10.GL_LINE_LOOP; - } */ - else { - throw new GdxRuntimeException("Unknown primitive type '" + type + "', should be one of triangle, trianglestrip, line, linestrip, lineloop or point"); - } - } - - private VertexAttribute[] parseAttributes (Array attributes) { - Array vertexAttributes = new Array(); - int unit = 0; - for(Object attribute: attributes) { - String attr = (String)attribute; - if(attr.equals("POSITION")) { - vertexAttributes.add(VertexAttribute.Position()); - } else if(attr.equals("NORMAL")) { - vertexAttributes.add(VertexAttribute.Normal()); - } else if(attr.startsWith("TEXCOORD")) { - vertexAttributes.add(VertexAttribute.TexCoords(unit++)); - } else if(attr.equals("TANGENT")) { - vertexAttributes.add(VertexAttribute.Tangent()); - } else if(attr.equals("BINORMAL")) { - vertexAttributes.add(VertexAttribute.Binormal()); - } else if(attr.equals("BLENDINDICES")) { - vertexAttributes.add(VertexAttribute.BoneIds(4)); - } else if(attr.equals("BLENDWEIGHTS")) { - vertexAttributes.add(VertexAttribute.BoneWeights(4)); - } else if(attr.equals("COLOR")) { - vertexAttributes.add(VertexAttribute.Color()); - } else { - throw new GdxRuntimeException("Unknown vertex attribuet '" + attr + "', should be one of position, normal, uv, tangent or binormal"); - } - } - return vertexAttributes.toArray(VertexAttribute.class); - } - - private void parseMaterials (JsonModel model, OrderedMap json, ModelLoaderHints hints, String materialDir) { - Array> materials = (Array>)json.get("materials"); - if(materials == null) { - // we should probably create some default material in this case - } - else { - model.materials = new JsonMaterial[materials.size]; - - int i = 0; - for(OrderedMap material: materials) { - JsonMaterial jsonMaterial = new JsonMaterial(); - - String id = (String)material.get("id"); - if(id == null) - throw new GdxRuntimeException("Material needs an id."); - - jsonMaterial.id = id; - - // Read type - String type = (String)material.get("type"); - if(type == null) - throw new GdxRuntimeException("Material needs a type. Lambert|Phong"); - - jsonMaterial.type = type.equals("PHONG") ? MaterialType.Phong : MaterialType.Lambert; - - // Read material colors - jsonMaterial.diffuse = parseColor((Array)material.get("diffuse"), Color.WHITE); - jsonMaterial.ambient = parseColor((Array)material.get("ambient"), Color.BLACK); - jsonMaterial.emissive = parseColor((Array)material.get("emissive"), Color.WHITE); - - if(jsonMaterial.type == MaterialType.Phong){ - // Read specular - jsonMaterial.specular = parseColor((Array)material.get("specular"), Color.WHITE); - - // Read shininess - float shininess = (Float)material.get("shininess", 1.0f); - } - - // Read textures - Array> textures = (Array>)material.get("textures"); - if(textures != null){ - for(OrderedMap texture : textures) { - JsonTexture jsonTexture = new JsonTexture(); - - String textureId = (String)texture.get("id"); - if(textureId == null) - throw new GdxRuntimeException("Texture has no id."); - jsonTexture.id = textureId; - - String fileName = (String)texture.get("filename"); - if(fileName == null) - throw new GdxRuntimeException("Texture needs filename."); - jsonTexture.fileName = materialDir + "/" + fileName; - - jsonTexture.uvTranslation = readVector2((Array)texture.get("uvTranslation"), 0f, 0f); - jsonTexture.uvScaling = readVector2((Array)texture.get("uvScaling"), 1f, 1f); - - String textureType = (String)texture.get("type"); - if(type == null) - throw new GdxRuntimeException("Texture needs type."); - - /* Only diffuse textures for now. Most programs don't export texture usage properly .. - So we probably need to find a workaround. */ - if(textureType.equals("STANDARD")){ - if(jsonMaterial.diffuseTextures == null) - jsonMaterial.diffuseTextures = new Array(); - jsonMaterial.diffuseTextures.add(jsonTexture); - } - } - } - - model.materials[i++] = jsonMaterial; - } - } - } - - private Color parseColor (Array colorArray, Color defaultColor) { - if(colorArray == null) { - return defaultColor; - } - else if(colorArray.size == 3) - return new Color((Float)colorArray.get(0), (Float)colorArray.get(1), (Float)colorArray.get(2), 1.0f); - else - throw new GdxRuntimeException("Expected Color values <> than three."); - } - - private Vector2 readVector2 (Array vectorArray, float x, float y) { - if(vectorArray == null) - return new Vector2(x, y); - else if(vectorArray.size == 2) - return new Vector2((Float)vectorArray.get(0), (Float)vectorArray.get(1)); - else - throw new GdxRuntimeException("Expected Vector2 values <> than two."); - } - - private JsonNode[] parseNodes (JsonModel model, OrderedMap json, ModelLoaderHints hints) { - Array> nodes = (Array>)json.get("nodes"); - if(nodes == null) { - throw new GdxRuntimeException("At least one node is required."); - } - - model.nodes = new JsonNode[nodes.size]; - - int i = 0; - for(OrderedMap node : nodes) { - model.nodes[i++] = parseNodesRecursively(node, hints); - } - return model.nodes; - } - - private JsonNode parseNodesRecursively(OrderedMap json, ModelLoaderHints hints){ - JsonNode jsonNode = new JsonNode(); - - String id = (String)json.get("id"); - if(id == null) - throw new GdxRuntimeException("Node id missing."); - jsonNode.id = id; - - Array translation = (Array)json.get("translation"); - if(translation == null || translation.size != 3) - throw new GdxRuntimeException("Node translation missing or incomplete"); - jsonNode.translation = new Vector3((Float)translation.get(0), (Float)translation.get(1), (Float)translation.get(2)); - - Array rotation = (Array)json.get("rotation"); - if(rotation == null || rotation.size != 3) - throw new GdxRuntimeException("Node rotation missing or incomplete"); - jsonNode.rotation = new Vector3((Float)rotation.get(0), (Float)rotation.get(1), (Float)rotation.get(2)); - - Array scale = (Array)json.get("scale"); - if(scale == null || scale.size != 3) - throw new GdxRuntimeException("Node scale missing or incomplete"); - jsonNode.scale = new Vector3((Float)scale.get(0), (Float)scale.get(1), (Float)scale.get(2)); - - String meshId = (String)json.get("mesh"); - if(meshId != null) - jsonNode.meshId = meshId; - - Array> materials = (Array>)json.get("materials"); - if(materials != null){ - jsonNode.meshPartMaterials = new JsonMeshPartMaterial[materials.size]; - - int i = 0; - for(OrderedMap material : materials) { - JsonMeshPartMaterial meshPartMaterial = new JsonMeshPartMaterial(); - - String meshPartId = (String)material.get("meshpartid"); - String materialId = (String)material.get("materialid"); - if(meshPartId == null || materialId == null){ - throw new GdxRuntimeException("Node material is missing meshPartId or materialId"); - } - meshPartMaterial.materialId = materialId; - meshPartMaterial.meshPartId = meshPartId; - - jsonNode.meshPartMaterials[i++] = meshPartMaterial; - } - } - - Array> children = (Array>)json.get("children"); - if(children != null){ - jsonNode.children = new JsonNode[children.size]; - - int i = 0; - for(OrderedMap child : children) { - jsonNode.children[i++] = parseNodesRecursively(child, hints); - } - } - - return jsonNode; - } -} +package com.badlogic.gdx.graphics.g3d.loader; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.files.FileHandle; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.GL10; +import com.badlogic.gdx.graphics.Mesh; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.Texture.TextureFilter; +import com.badlogic.gdx.graphics.VertexAttribute; +import com.badlogic.gdx.graphics.g3d.loader.JsonMaterial.MaterialType; +import com.badlogic.gdx.graphics.g3d.old.ModelLoaderHints; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoader; +import com.badlogic.gdx.graphics.g3d.old.materials.ColorAttribute; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.TextureAttribute; +import com.badlogic.gdx.graphics.g3d.old.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.SubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.math.Vector3; +import com.badlogic.gdx.utils.Array; +import com.badlogic.gdx.utils.GdxRuntimeException; +import com.badlogic.gdx.utils.JsonReader; +import com.badlogic.gdx.utils.ObjectMap; +import com.badlogic.gdx.utils.OrderedMap; + +/** + * {@link ModelLoader} for the JSON format written by the + * fbx-conv tool. + * + * @author mzechner + * + */ +public class JsonModelLoader implements ModelLoader { + public static String VERSION = "1.0"; + + @Override + public Model load (FileHandle handle, ModelLoaderHints hints) { + JsonModel jsonModel = parseModel(handle, hints); + Model model = null; + + if(jsonModel.animations == null) + model = createStillModel(jsonModel); + else // add hints for sampling to keyframed model + model = createSkeletonModel(jsonModel); + + return model; + } + + private SkeletonModel createSkeletonModel (JsonModel jsonModel) { + // TODO Auto-generated method stub + return null; + } + + private StillModel createStillModel (JsonModel model) { + StillModel stillModel = new StillModel(new SubMesh[model.meshes.length]); + + // We create the materials first + ObjectMap materials = new ObjectMap(); + for(int i=0; i json = (OrderedMap)reader.parse(handle); + + String version = (String)json.get("version"); + if(version == null || !version.equals(VERSION)) { + throw new GdxRuntimeException("No or wrong JSON format version given, should be " + VERSION + ", is " + version); + } + + JsonModel model = new JsonModel(); + parseMeshes(model, json, hints); + parseMaterials(model, json, hints, handle.parent().path()); + parseNodes(model, json, hints); + return model; + } + + private void parseMeshes (JsonModel model, OrderedMap json, ModelLoaderHints hints) { + Array> meshes = (Array>)json.get("meshes"); + if(meshes == null) { + throw new GdxRuntimeException("No meshes found in file"); + } + + model.meshes = new JsonMesh[meshes.size]; + int i = 0; + for(OrderedMap mesh: meshes) { + JsonMesh jsonMesh = new JsonMesh(); + String id = (String)mesh.get("id"); + if(id == null) { + throw new GdxRuntimeException("No id given for mesh"); + } + jsonMesh.id = id; + + Array attributes = (Array)mesh.get("attributes"); + if(attributes == null) { + throw new GdxRuntimeException("No vertex attributes given for mesh '" + id + "'"); + } + jsonMesh.attributes = parseAttributes(attributes); + + Array vertices = (Array)mesh.get("vertices"); + if(vertices == null) { + throw new GdxRuntimeException("No vertices given for mesh '" + id + "'"); + } + float[] verts = new float[vertices.size]; + int idx = 0; + for(Object v: vertices) { + verts[idx++] = (Float)v; + } + jsonMesh.vertices = verts; + + Array> meshParts = (Array>)mesh.get("parts"); + if(meshParts == null) { + throw new GdxRuntimeException("No mesh parts given for mesh '" + id + "'"); + } + Array parts = new Array(); + for(OrderedMap meshPart: meshParts) { + JsonMeshPart jsonPart = new JsonMeshPart(); + String partId = (String)meshPart.get("id"); + if(id == null) { + throw new GdxRuntimeException("Not id given for mesh part"); + } + for(JsonMeshPart other: parts) { + if(other.id.equals(partId)) { + throw new GdxRuntimeException("Mesh part with id '" + partId + "' already in defined"); + } + } + jsonPart.id = partId; + + String type = (String)meshPart.get("type"); + if(type == null) { + throw new GdxRuntimeException("No primitive type given for mesh part '" + partId + "'"); + } + jsonPart.primitiveType = parseType(type); + + Array indices = (Array)meshPart.get("indices"); + if(indices == null) { + throw new GdxRuntimeException("No indices given for mesh part '" + partId + "'"); + } + short[] partIndices = new short[indices.size]; + idx = 0; + for(Object index: indices) { + partIndices[idx++] = (short)(float)(Float)index; + } + jsonPart.indices = partIndices; + parts.add(jsonPart); + } + jsonMesh.parts = parts.toArray(JsonMeshPart.class); + model.meshes[i++] = jsonMesh; + } + } + + private int parseType (String type) { + if(type.equals("TRIANGLES")) { + return GL10.GL_TRIANGLES; + } else if(type.equals("LINES")) { + return GL10.GL_LINES; + } else if(type.equals("POINTS")) { + return GL10.GL_POINTS; + } else if(type.equals("TRIANGLE_STRIP")) { + return GL10.GL_TRIANGLE_STRIP; + } else if(type.equals("LINE_STRIP")) { + return GL10.GL_LINE_STRIP; + } /* Gameplay encoder doesn't read out line loop + else if(type.equals("lineloop")) { + return GL10.GL_LINE_LOOP; + } */ + else { + throw new GdxRuntimeException("Unknown primitive type '" + type + "', should be one of triangle, trianglestrip, line, linestrip, lineloop or point"); + } + } + + private VertexAttribute[] parseAttributes (Array attributes) { + Array vertexAttributes = new Array(); + int unit = 0; + for(Object attribute: attributes) { + String attr = (String)attribute; + if(attr.equals("POSITION")) { + vertexAttributes.add(VertexAttribute.Position()); + } else if(attr.equals("NORMAL")) { + vertexAttributes.add(VertexAttribute.Normal()); + } else if(attr.startsWith("TEXCOORD")) { + vertexAttributes.add(VertexAttribute.TexCoords(unit++)); + } else if(attr.equals("TANGENT")) { + vertexAttributes.add(VertexAttribute.Tangent()); + } else if(attr.equals("BINORMAL")) { + vertexAttributes.add(VertexAttribute.Binormal()); + } else if(attr.equals("BLENDINDICES")) { + vertexAttributes.add(VertexAttribute.BoneIds(4)); + } else if(attr.equals("BLENDWEIGHTS")) { + vertexAttributes.add(VertexAttribute.BoneWeights(4)); + } else if(attr.equals("COLOR")) { + vertexAttributes.add(VertexAttribute.Color()); + } else { + throw new GdxRuntimeException("Unknown vertex attribuet '" + attr + "', should be one of position, normal, uv, tangent or binormal"); + } + } + return vertexAttributes.toArray(VertexAttribute.class); + } + + private void parseMaterials (JsonModel model, OrderedMap json, ModelLoaderHints hints, String materialDir) { + Array> materials = (Array>)json.get("materials"); + if(materials == null) { + // we should probably create some default material in this case + } + else { + model.materials = new JsonMaterial[materials.size]; + + int i = 0; + for(OrderedMap material: materials) { + JsonMaterial jsonMaterial = new JsonMaterial(); + + String id = (String)material.get("id"); + if(id == null) + throw new GdxRuntimeException("Material needs an id."); + + jsonMaterial.id = id; + + // Read type + String type = (String)material.get("type"); + if(type == null) + throw new GdxRuntimeException("Material needs a type. Lambert|Phong"); + + jsonMaterial.type = type.equals("PHONG") ? MaterialType.Phong : MaterialType.Lambert; + + // Read material colors + jsonMaterial.diffuse = parseColor((Array)material.get("diffuse"), Color.WHITE); + jsonMaterial.ambient = parseColor((Array)material.get("ambient"), Color.BLACK); + jsonMaterial.emissive = parseColor((Array)material.get("emissive"), Color.WHITE); + + if(jsonMaterial.type == MaterialType.Phong){ + // Read specular + jsonMaterial.specular = parseColor((Array)material.get("specular"), Color.WHITE); + + // Read shininess + float shininess = (Float)material.get("shininess", 1.0f); + } + + // Read textures + Array> textures = (Array>)material.get("textures"); + if(textures != null){ + for(OrderedMap texture : textures) { + JsonTexture jsonTexture = new JsonTexture(); + + String textureId = (String)texture.get("id"); + if(textureId == null) + throw new GdxRuntimeException("Texture has no id."); + jsonTexture.id = textureId; + + String fileName = (String)texture.get("filename"); + if(fileName == null) + throw new GdxRuntimeException("Texture needs filename."); + jsonTexture.fileName = materialDir + "/" + fileName; + + jsonTexture.uvTranslation = readVector2((Array)texture.get("uvTranslation"), 0f, 0f); + jsonTexture.uvScaling = readVector2((Array)texture.get("uvScaling"), 1f, 1f); + + String textureType = (String)texture.get("type"); + if(type == null) + throw new GdxRuntimeException("Texture needs type."); + + /* Only diffuse textures for now. Most programs don't export texture usage properly .. + So we probably need to find a workaround. */ + if(textureType.equals("STANDARD")){ + if(jsonMaterial.diffuseTextures == null) + jsonMaterial.diffuseTextures = new Array(); + jsonMaterial.diffuseTextures.add(jsonTexture); + } + } + } + + model.materials[i++] = jsonMaterial; + } + } + } + + private Color parseColor (Array colorArray, Color defaultColor) { + if(colorArray == null) { + return defaultColor; + } + else if(colorArray.size == 3) + return new Color((Float)colorArray.get(0), (Float)colorArray.get(1), (Float)colorArray.get(2), 1.0f); + else + throw new GdxRuntimeException("Expected Color values <> than three."); + } + + private Vector2 readVector2 (Array vectorArray, float x, float y) { + if(vectorArray == null) + return new Vector2(x, y); + else if(vectorArray.size == 2) + return new Vector2((Float)vectorArray.get(0), (Float)vectorArray.get(1)); + else + throw new GdxRuntimeException("Expected Vector2 values <> than two."); + } + + private JsonNode[] parseNodes (JsonModel model, OrderedMap json, ModelLoaderHints hints) { + Array> nodes = (Array>)json.get("nodes"); + if(nodes == null) { + throw new GdxRuntimeException("At least one node is required."); + } + + model.nodes = new JsonNode[nodes.size]; + + int i = 0; + for(OrderedMap node : nodes) { + model.nodes[i++] = parseNodesRecursively(node, hints); + } + return model.nodes; + } + + private JsonNode parseNodesRecursively(OrderedMap json, ModelLoaderHints hints){ + JsonNode jsonNode = new JsonNode(); + + String id = (String)json.get("id"); + if(id == null) + throw new GdxRuntimeException("Node id missing."); + jsonNode.id = id; + + Array translation = (Array)json.get("translation"); + if(translation == null || translation.size != 3) + throw new GdxRuntimeException("Node translation missing or incomplete"); + jsonNode.translation = new Vector3((Float)translation.get(0), (Float)translation.get(1), (Float)translation.get(2)); + + Array rotation = (Array)json.get("rotation"); + if(rotation == null || rotation.size != 3) + throw new GdxRuntimeException("Node rotation missing or incomplete"); + jsonNode.rotation = new Vector3((Float)rotation.get(0), (Float)rotation.get(1), (Float)rotation.get(2)); + + Array scale = (Array)json.get("scale"); + if(scale == null || scale.size != 3) + throw new GdxRuntimeException("Node scale missing or incomplete"); + jsonNode.scale = new Vector3((Float)scale.get(0), (Float)scale.get(1), (Float)scale.get(2)); + + String meshId = (String)json.get("mesh"); + if(meshId != null) + jsonNode.meshId = meshId; + + Array> materials = (Array>)json.get("materials"); + if(materials != null){ + jsonNode.meshPartMaterials = new JsonMeshPartMaterial[materials.size]; + + int i = 0; + for(OrderedMap material : materials) { + JsonMeshPartMaterial meshPartMaterial = new JsonMeshPartMaterial(); + + String meshPartId = (String)material.get("meshpartid"); + String materialId = (String)material.get("materialid"); + if(meshPartId == null || materialId == null){ + throw new GdxRuntimeException("Node material is missing meshPartId or materialId"); + } + meshPartMaterial.materialId = materialId; + meshPartMaterial.meshPartId = meshPartId; + + jsonNode.meshPartMaterials[i++] = meshPartMaterial; + } + } + + Array> children = (Array>)json.get("children"); + if(children != null){ + jsonNode.children = new JsonNode[children.size]; + + int i = 0; + for(OrderedMap child : children) { + jsonNode.children[i++] = parseNodesRecursively(child, hints); + } + } + + return jsonNode; + } +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonNode.java b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonNode.java old mode 100755 new mode 100644 similarity index 83% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonNode.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonNode.java index 4983ccedf..a3e31f1e4 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonNode.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonNode.java @@ -1,15 +1,15 @@ -package com.badlogic.gdx.graphics.g3d.loaders.json; - -import com.badlogic.gdx.math.Quaternion; -import com.badlogic.gdx.math.Vector3; - -public class JsonNode { - public String id; - public int boneId = -1; - public Vector3 translation; - public Vector3 rotation; - public Vector3 scale; - public String meshId; - public JsonMeshPartMaterial[] meshPartMaterials; - public JsonNode[] children; -} +package com.badlogic.gdx.graphics.g3d.loader; + +import com.badlogic.gdx.math.Quaternion; +import com.badlogic.gdx.math.Vector3; + +public class JsonNode { + public String id; + public int boneId = -1; + public Vector3 translation; + public Vector3 rotation; + public Vector3 scale; + public String meshId; + public JsonMeshPartMaterial[] meshPartMaterials; + public JsonNode[] children; +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonTexture.java b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonTexture.java similarity index 76% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonTexture.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonTexture.java index 566146a35..e8c24d698 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonTexture.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/loader/JsonTexture.java @@ -1,4 +1,4 @@ -package com.badlogic.gdx.graphics.g3d.loaders.json; +package com.badlogic.gdx.graphics.g3d.loader; import com.badlogic.gdx.math.Vector2; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonAnimation.java b/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonAnimation.java deleted file mode 100644 index 141d984ae..000000000 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/json/JsonAnimation.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.badlogic.gdx.graphics.g3d.loaders.json; - -public class JsonAnimation { - -} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/materials/BlendingAttribute.java b/gdx/src/com/badlogic/gdx/graphics/g3d/materials/BlendingAttribute.java index 67fe84cfe..96b5374f0 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/materials/BlendingAttribute.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/materials/BlendingAttribute.java @@ -1,88 +1,40 @@ -/******************************************************************************* - * Copyright 2011 See AUTHORS file. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ - package com.badlogic.gdx.graphics.g3d.materials; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.GL10; -import com.badlogic.gdx.graphics.glutils.ShaderProgram; -import com.badlogic.gdx.utils.Pool; - -public class BlendingAttribute extends MaterialAttribute { - - /** if BlendingAttribute name is translucent then default tranparency mechanism is used in shader */ - public static final String translucent = "translucent"; +import com.badlogic.gdx.graphics.g3d.materials.NewMaterial.Attribute; - public int blendSrcFunc; - public int blendDstFunc; - - protected BlendingAttribute () { +public class BlendingAttribute extends NewMaterial.Attribute { + public final static String Alias = "blended"; + public final static long Type = register(Alias); + + public final static boolean is(final long mask) { + return (mask & Type) == mask; } + + public int sourceFunction; + public int destFunction; - /** Utility constuctor for basic transparency blendSrcFunc = GL10.GL_SRC_ALPHA blendDstFunc = GL10.GL_ONE_MINUS_SRC_ALPHA - * @param name */ - public BlendingAttribute (String name) { - this(name, GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); + public BlendingAttribute() { + super(Type); } - - public BlendingAttribute (String name, int srcFunc, int dstFunc) { - super(name); - blendSrcFunc = srcFunc; - blendDstFunc = dstFunc; + + public BlendingAttribute(final int sourceFunc, final int destFunc) { + this(); + sourceFunction = sourceFunc; + destFunction = destFunc; } - - @Override - public void bind () { - Gdx.gl.glBlendFunc(blendSrcFunc, blendDstFunc); + + public BlendingAttribute(final BlendingAttribute copyFrom) { + this(copyFrom == null ? 0 : copyFrom.sourceFunction, copyFrom == null ? 0 : copyFrom.destFunction); } - + @Override - public void bind (ShaderProgram program) { - Gdx.gl.glBlendFunc(blendSrcFunc, blendDstFunc); + public BlendingAttribute copy () { + return new BlendingAttribute(this); } - - @Override - public MaterialAttribute copy () { - return new BlendingAttribute(this.name, this.blendSrcFunc, this.blendDstFunc); - } - - @Override - public void set (MaterialAttribute attr) { - BlendingAttribute blendAttr = (BlendingAttribute)attr; - name = blendAttr.name; - blendDstFunc = blendAttr.blendDstFunc; - blendSrcFunc = blendAttr.blendSrcFunc; - } - - private final static Pool pool = new Pool() { - @Override - protected BlendingAttribute newObject () { - return new BlendingAttribute(); - } - }; - - @Override - public MaterialAttribute pooledCopy () { - BlendingAttribute attr = pool.obtain(); - attr.set(this); - return attr; - } - + @Override - public void free () { - if (isPooled) pool.free(this); + protected boolean equals (final Attribute other) { + return ((BlendingAttribute)other).sourceFunction == sourceFunction && + ((BlendingAttribute)other).destFunction == destFunction; } -} +} \ No newline at end of file diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/materials/ColorAttribute.java b/gdx/src/com/badlogic/gdx/graphics/g3d/materials/ColorAttribute.java index 10153f8d3..e0cc8284e 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/materials/ColorAttribute.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/materials/ColorAttribute.java @@ -1,96 +1,55 @@ -/******************************************************************************* - * Copyright 2011 See AUTHORS file. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ - package com.badlogic.gdx.graphics.g3d.materials; -import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.GL10; -import com.badlogic.gdx.graphics.glutils.ShaderProgram; -import com.badlogic.gdx.utils.Pool; - -public class ColorAttribute extends MaterialAttribute { - - static final public String diffuse = "diffuseColor"; - static final public String specular = "specularColor"; - static final public String emissive = "emissiveColor"; - static final public String rim = "rimColor"; - static final public String fog = "fogColor"; - +import com.badlogic.gdx.graphics.g3d.materials.NewMaterial.Attribute; +import com.badlogic.gdx.utils.GdxRuntimeException; + +public class ColorAttribute extends NewMaterial.Attribute { + public final static String DiffuseAlias = "diffuseColor"; + public final static long Diffuse = register(DiffuseAlias); + public final static String SpecularAlias = "specularColor"; + public final static long Specular = register(SpecularAlias); + + // Might be useful:... + protected static long Mask = Diffuse | Specular; + + public final static boolean is(final long mask) { + return (mask & Mask) != 0; + } + + public final static ColorAttribute createDiffuse(final Color color) { + return new ColorAttribute(Diffuse, color); + } + + public final static ColorAttribute createSpecular(final Color color) { + return new ColorAttribute(Specular, color); + } + public final Color color = new Color(); - - protected ColorAttribute () { + + public ColorAttribute(final long type) { + this(type, null); } - - /** Creates a {@link MaterialAttribute} that is a pure {@link Color}. - * - * @param color The {@link Color} that you wish the attribute to represent. - * @param name The name of the uniform in the {@link ShaderProgram} that will have its value set to this color. (A 'name' does - * not matter for a game that uses {@link GL10}). */ - public ColorAttribute (Color color, String name) { - super(name); - this.color.set(color); + + public ColorAttribute(final long type, final Color color) { + super(type); + if (!is(type)) + throw new GdxRuntimeException("Invalid type specified"); + if (color != null) + this.color.set(color); } - - @Override - public void bind () { - if (Gdx.gl10 == null) throw new RuntimeException("Can't call ColorAttribute.bind() in a GL20 context"); - - // todo how about emissive or specular? - // TODO replace string equals with something more performant - if (diffuse.equals(diffuse)) Gdx.gl10.glColor4f(color.r, color.g, color.b, color.a); + + public ColorAttribute(final ColorAttribute copyFrom) { + this(copyFrom.type, copyFrom.color); } @Override - public void bind (ShaderProgram program) { - program.setUniformf(name, color.r, color.g, color.b, color.a); - } - - @Override - public MaterialAttribute copy () { - return new ColorAttribute(color, name); - } - - @Override - public void set (MaterialAttribute attr) { - ColorAttribute colAttr = (ColorAttribute)attr; - name = colAttr.name; - final Color c = colAttr.color; - color.r = c.r; - color.g = c.g; - color.b = c.b; - color.a = c.a; - } - - private final static Pool pool = new Pool() { - @Override - protected ColorAttribute newObject () { - return new ColorAttribute(); - } - }; - - @Override - public MaterialAttribute pooledCopy () { - ColorAttribute attr = pool.obtain(); - attr.set(this); - return attr; + public Attribute copy () { + return new ColorAttribute(this); } @Override - public void free () { - if (isPooled) pool.free(this); + protected boolean equals (Attribute other) { + return ((ColorAttribute)other).color.equals(color); } -} +} \ No newline at end of file diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/NewMaterial.java b/gdx/src/com/badlogic/gdx/graphics/g3d/materials/NewMaterial.java similarity index 99% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/NewMaterial.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/materials/NewMaterial.java index a11fb255d..ded76e86d 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/NewMaterial.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/materials/NewMaterial.java @@ -1,4 +1,4 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.materials; +package com.badlogic.gdx.graphics.g3d.materials; import java.util.Comparator; import java.util.Iterator; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/materials/TextureAttribute.java b/gdx/src/com/badlogic/gdx/graphics/g3d/materials/TextureAttribute.java index 056a6e719..724bbe318 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/materials/TextureAttribute.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/materials/TextureAttribute.java @@ -1,128 +1,47 @@ -/******************************************************************************* - * Copyright 2011 See AUTHORS file. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ - package com.badlogic.gdx.graphics.g3d.materials; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.Texture.TextureFilter; -import com.badlogic.gdx.graphics.Texture.TextureWrap; -import com.badlogic.gdx.graphics.glutils.ShaderProgram; -import com.badlogic.gdx.utils.Pool; - -public class TextureAttribute extends MaterialAttribute { - - public final static int MAX_TEXTURE_UNITS = 16; - static final public String diffuseTexture = "diffuseTexture"; - static final public String lightmapTexture = "lightmapTexture"; - static final public String specularTexture = "specularTexture"; - - public Texture texture; - public int unit; - public int minFilter; - public int magFilter; - public int uWrap; - public int vWrap; - - protected TextureAttribute () { - } - - public TextureAttribute (Texture texture, int unit, String name, TextureFilter minFilter, TextureFilter magFilter, - TextureWrap uWrap, TextureWrap vWrap) { - this(texture, unit, name, minFilter.getGLEnum(), magFilter.getGLEnum(), uWrap.getGLEnum(), vWrap.getGLEnum()); - } - - public TextureAttribute (Texture texture, int unit, String name, int minFilter, int magFilter, int uWrap, int vWrap) { - super(name); - this.texture = texture; - if (unit > MAX_TEXTURE_UNITS) throw new RuntimeException(MAX_TEXTURE_UNITS + " is max texture units supported"); - this.unit = unit; - this.uWrap = uWrap; - this.vWrap = vWrap; - this.minFilter = minFilter; - this.magFilter = magFilter; - } - - public TextureAttribute (Texture texture, int unit, String name) { - this(texture, unit, name, texture.getMinFilter(), texture.getMagFilter(), texture.getUWrap(), texture.getVWrap()); - } - - @Override - public void bind () { - texture.bind(unit); - Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, minFilter); - Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, magFilter); - Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, uWrap); - Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, vWrap); - } - - @Override - public void bind (ShaderProgram program) { - texture.bind(unit); - Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, minFilter); - Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, magFilter); - Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, uWrap); - Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, vWrap); - program.setUniformi(name, unit); - } - - @Override - public MaterialAttribute copy () { - return new TextureAttribute(texture, unit, name, minFilter, magFilter, uWrap, vWrap); - } - - @Override - public void set (MaterialAttribute attr) { - TextureAttribute texAttr = (TextureAttribute)attr; - name = texAttr.name; - texture = texAttr.texture; - unit = texAttr.unit; - magFilter = texAttr.magFilter; - minFilter = texAttr.minFilter; - uWrap = texAttr.uWrap; - vWrap = texAttr.vWrap; - } - - /** this method check if the texture portion of texture attribute is equal, name isn't used */ - public boolean texturePortionEquals (TextureAttribute other) { - if (other == null) return false; - if (this == other) return true; - - return (texture == other.texture) && (unit == other.unit) && (minFilter == other.minFilter) - && (magFilter == other.magFilter) && (uWrap == other.uWrap) && (vWrap == other.vWrap); - - } - - private final static Pool pool = new Pool() { - @Override - protected TextureAttribute newObject () { - return new TextureAttribute(); - } - }; - +import com.badlogic.gdx.graphics.g3d.materials.NewMaterial.Attribute; +import com.badlogic.gdx.graphics.g3d.utils.TextureDescription; +import com.badlogic.gdx.utils.GdxRuntimeException; + +public class TextureAttribute extends NewMaterial.Attribute { + public final static String DiffuseAlias = "diffuseTexture"; + public final static long Diffuse = register(DiffuseAlias); + public final static String SpecularAlias = "specularTexture"; + public final static long Specular = register(SpecularAlias); + + // Might be useful:... + protected static long Mask = Diffuse | Specular; + + public final static boolean is(final long mask) { + return (mask & Mask) != 0; + } + + public final TextureDescription textureDescription; + + public TextureAttribute(final long type, final TextureDescription textureDescription) { + super(type); + if (!is(type)) + throw new GdxRuntimeException("Invalid type specified"); + this.textureDescription = textureDescription; + } + + public TextureAttribute(final long type) { + this(type, null); + } + + public TextureAttribute(final TextureAttribute copyFrom) { + this(copyFrom.getType(), copyFrom.textureDescription); + } + @Override - public MaterialAttribute pooledCopy () { - TextureAttribute attr = pool.obtain(); - attr.set(this); - return attr; + public Attribute copy () { + return new TextureAttribute(this); } @Override - public void free () { - if (isPooled) pool.free(this); + protected boolean equals (Attribute other) { + return ((TextureAttribute)other).textureDescription.equals(textureDescription); } } diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/AnimatedModelInstance.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/AnimatedModelInstance.java similarity index 95% rename from gdx/src/com/badlogic/gdx/graphics/g3d/AnimatedModelInstance.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/AnimatedModelInstance.java index ea207db63..c99b54683 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/AnimatedModelInstance.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/AnimatedModelInstance.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d; +package com.badlogic.gdx.graphics.g3d.old; public interface AnimatedModelInstance extends StillModelInstance { public String getAnimation (); diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/AnimatedModelNode.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/AnimatedModelNode.java similarity index 94% rename from gdx/src/com/badlogic/gdx/graphics/g3d/AnimatedModelNode.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/AnimatedModelNode.java index 63950aa8c..0b6f3f3e2 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/AnimatedModelNode.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/AnimatedModelNode.java @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d; +package com.badlogic.gdx.graphics.g3d.old; -import com.badlogic.gdx.graphics.g3d.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; public class AnimatedModelNode extends StillModelNode implements AnimatedModelInstance { public String animation; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/ModelLoaderHints.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/ModelLoaderHints.java similarity index 90% rename from gdx/src/com/badlogic/gdx/graphics/g3d/ModelLoaderHints.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/ModelLoaderHints.java index 580be8919..7d180430e 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/ModelLoaderHints.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/ModelLoaderHints.java @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d; +package com.badlogic.gdx.graphics.g3d.old; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; /** Hints passed to a loader which might ignore them. See {@link ModelLoaderRegistry}. * @author mzechner */ diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/ModelRenderer.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/ModelRenderer.java similarity index 85% rename from gdx/src/com/badlogic/gdx/graphics/g3d/ModelRenderer.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/ModelRenderer.java index 362b286aa..4c1fe223e 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/ModelRenderer.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/ModelRenderer.java @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d; +package com.badlogic.gdx.graphics.g3d.old; -import com.badlogic.gdx.graphics.g3d.model.AnimatedModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.AnimatedModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; public interface ModelRenderer { public void begin (); diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/StillModelInstance.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/StillModelInstance.java similarity index 90% rename from gdx/src/com/badlogic/gdx/graphics/g3d/StillModelInstance.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/StillModelInstance.java index 89014368a..a82105597 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/StillModelInstance.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/StillModelInstance.java @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d; +package com.badlogic.gdx.graphics.g3d.old; -import com.badlogic.gdx.graphics.g3d.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/StillModelNode.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/StillModelNode.java similarity index 95% rename from gdx/src/com/badlogic/gdx/graphics/g3d/StillModelNode.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/StillModelNode.java index 3ec9ac7c6..9b0f16e5f 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/StillModelNode.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/StillModelNode.java @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d; +package com.badlogic.gdx.graphics.g3d.old; -import com.badlogic.gdx.graphics.g3d.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/KeyframedModelLoader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/KeyframedModelLoader.java similarity index 84% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/KeyframedModelLoader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/KeyframedModelLoader.java index 7694d35ba..918c98e01 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/KeyframedModelLoader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/KeyframedModelLoader.java @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders; +package com.badlogic.gdx.graphics.g3d.old.loaders; import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.g3d.ModelLoaderHints; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedModel; +import com.badlogic.gdx.graphics.g3d.old.ModelLoaderHints; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedModel; /** Interface for classes loading {@link KeyframedModel} instances. * @author mzechner */ diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/ModelLoader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/ModelLoader.java similarity index 86% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/ModelLoader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/ModelLoader.java index cd9bdd0d8..283819172 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/ModelLoader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/ModelLoader.java @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders; +package com.badlogic.gdx.graphics.g3d.old.loaders; import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.g3d.ModelLoaderHints; -import com.badlogic.gdx.graphics.g3d.model.Model; +import com.badlogic.gdx.graphics.g3d.old.ModelLoaderHints; +import com.badlogic.gdx.graphics.g3d.old.model.Model; /** Interface for all loaders. Loaders that need more files need to derrive the other file names by the given file. A bit of a * hack, but most formats are self contained. diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/ModelLoaderRegistry.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/ModelLoaderRegistry.java similarity index 94% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/ModelLoaderRegistry.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/ModelLoaderRegistry.java index 594742d95..78c780c05 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/ModelLoaderRegistry.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/ModelLoaderRegistry.java @@ -14,25 +14,25 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders; +package com.badlogic.gdx.graphics.g3d.old.loaders; import java.util.HashMap; import java.util.Map; import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.g3d.ModelLoaderHints; -import com.badlogic.gdx.graphics.g3d.loaders.g3d.G3dLoader.G3dKeyframedModelLoader; -import com.badlogic.gdx.graphics.g3d.loaders.g3d.G3dLoader.G3dStillModelLoader; -import com.badlogic.gdx.graphics.g3d.loaders.g3d.G3dLoader.G3dSkeletonModelLoader; -import com.badlogic.gdx.graphics.g3d.loaders.g3d.G3dtLoader.G3dtKeyframedModelLoader; -import com.badlogic.gdx.graphics.g3d.loaders.g3d.G3dtLoader.G3dtStillModelLoader; -import com.badlogic.gdx.graphics.g3d.loaders.md2.MD2Loader; -import com.badlogic.gdx.graphics.g3d.loaders.md2.MD2Loader.MD2LoaderHints; -import com.badlogic.gdx.graphics.g3d.loaders.wavefront.ObjLoader; -import com.badlogic.gdx.graphics.g3d.model.Model; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedModel; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.ModelLoaderHints; +import com.badlogic.gdx.graphics.g3d.old.loaders.g3d.G3dLoader.G3dKeyframedModelLoader; +import com.badlogic.gdx.graphics.g3d.old.loaders.g3d.G3dLoader.G3dSkeletonModelLoader; +import com.badlogic.gdx.graphics.g3d.old.loaders.g3d.G3dLoader.G3dStillModelLoader; +import com.badlogic.gdx.graphics.g3d.old.loaders.g3d.G3dtLoader.G3dtKeyframedModelLoader; +import com.badlogic.gdx.graphics.g3d.old.loaders.g3d.G3dtLoader.G3dtStillModelLoader; +import com.badlogic.gdx.graphics.g3d.old.loaders.md2.MD2Loader; +import com.badlogic.gdx.graphics.g3d.old.loaders.md2.MD2Loader.MD2LoaderHints; +import com.badlogic.gdx.graphics.g3d.old.loaders.wavefront.ObjLoader; +import com.badlogic.gdx.graphics.g3d.old.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedModel; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.GdxRuntimeException; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/SkeletonModelLoader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/SkeletonModelLoader.java similarity index 84% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/SkeletonModelLoader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/SkeletonModelLoader.java index 802df58ec..6f783db8f 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/SkeletonModelLoader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/SkeletonModelLoader.java @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders; +package com.badlogic.gdx.graphics.g3d.old.loaders; import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.g3d.ModelLoaderHints; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonModel; +import com.badlogic.gdx.graphics.g3d.old.ModelLoaderHints; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonModel; /** Interface for classes loading {@link SkeletonModel} instances. * @author mzechner */ diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/StillModelLoader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/StillModelLoader.java similarity index 85% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/StillModelLoader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/StillModelLoader.java index 68452a0dd..62813396c 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/StillModelLoader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/StillModelLoader.java @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders; +package com.badlogic.gdx.graphics.g3d.old.loaders; import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.g3d.ModelLoaderHints; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.ModelLoaderHints; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; /** Interface for loaders loading {@link StillModel} instances. * @author mzechner */ diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/ChunkReader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/ChunkReader.java similarity index 98% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/ChunkReader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/ChunkReader.java index 1dc8f35ea..8a59cb3d4 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/ChunkReader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/ChunkReader.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.g3d.chunks; +package com.badlogic.gdx.graphics.g3d.old.loaders.g3d; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -26,7 +26,7 @@ import java.util.Arrays; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.GdxRuntimeException; -import static com.badlogic.gdx.graphics.g3d.loaders.g3d.G3dConstants.*; +import static com.badlogic.gdx.graphics.g3d.old.loaders.g3d.G3dConstants.*; public class ChunkReader { public static class Chunk { diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/ChunkWriter.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/ChunkWriter.java similarity index 97% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/ChunkWriter.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/ChunkWriter.java index 4cd1c9d19..62b160b6c 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/ChunkWriter.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/ChunkWriter.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.g3d.chunks; +package com.badlogic.gdx.graphics.g3d.old.loaders.g3d; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; @@ -23,7 +23,7 @@ import java.io.OutputStream; import com.badlogic.gdx.utils.Array; -import static com.badlogic.gdx.graphics.g3d.loaders.g3d.G3dConstants.*; +import static com.badlogic.gdx.graphics.g3d.old.loaders.g3d.G3dConstants.*; public class ChunkWriter { diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/CountingDataInputStream.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/CountingDataInputStream.java similarity index 98% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/CountingDataInputStream.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/CountingDataInputStream.java index eed79e330..218af137b 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/CountingDataInputStream.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/CountingDataInputStream.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.g3d.chunks; +package com.badlogic.gdx.graphics.g3d.old.loaders.g3d; import java.io.DataInput; import java.io.DataInputStream; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/G3dConstants.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dConstants.java similarity index 97% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/G3dConstants.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dConstants.java index 11c5f879c..064938ba4 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/G3dConstants.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dConstants.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.g3d; +package com.badlogic.gdx.graphics.g3d.old.loaders.g3d; public class G3dConstants { // Version info for file format diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/G3dExporter.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dExporter.java similarity index 92% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/G3dExporter.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dExporter.java index 6a626b8d0..ff82a47a5 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/chunks/G3dExporter.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dExporter.java @@ -14,25 +14,24 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.g3d.chunks; +package com.badlogic.gdx.graphics.g3d.old.loaders.g3d; import java.io.IOException; import java.io.OutputStream; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.VertexAttribute; -import com.badlogic.gdx.graphics.g3d.loaders.g3d.G3dConstants; -import com.badlogic.gdx.graphics.g3d.model.keyframe.Keyframe; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedAnimation; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedModel; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedSubMesh; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonAnimation; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonJoint; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonKeyframe; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonModel; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonSubMesh; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.Keyframe; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedAnimation; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedModel; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedSubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonAnimation; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonJoint; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonKeyframe; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonModel; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonSubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; import com.badlogic.gdx.utils.GdxRuntimeException; public class G3dExporter { diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/G3dLoader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dLoader.java similarity index 93% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/G3dLoader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dLoader.java index 7c66f1444..29a22e838 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/G3dLoader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dLoader.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.g3d; +package com.badlogic.gdx.graphics.g3d.old.loaders.g3d; import java.io.IOException; import java.io.InputStream; @@ -23,25 +23,24 @@ import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.Mesh.VertexDataType; import com.badlogic.gdx.graphics.VertexAttribute; -import com.badlogic.gdx.graphics.g3d.ModelLoaderHints; -import com.badlogic.gdx.graphics.g3d.loaders.KeyframedModelLoader; -import com.badlogic.gdx.graphics.g3d.loaders.SkeletonModelLoader; -import com.badlogic.gdx.graphics.g3d.loaders.StillModelLoader; -import com.badlogic.gdx.graphics.g3d.loaders.g3d.chunks.ChunkReader; -import com.badlogic.gdx.graphics.g3d.loaders.g3d.chunks.ChunkReader.Chunk; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.model.keyframe.Keyframe; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedAnimation; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedModel; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedSubMesh; -import com.badlogic.gdx.graphics.g3d.model.skeleton.Skeleton; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonAnimation; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonJoint; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonKeyframe; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonModel; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonSubMesh; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; +import com.badlogic.gdx.graphics.g3d.old.ModelLoaderHints; +import com.badlogic.gdx.graphics.g3d.old.loaders.KeyframedModelLoader; +import com.badlogic.gdx.graphics.g3d.old.loaders.SkeletonModelLoader; +import com.badlogic.gdx.graphics.g3d.old.loaders.StillModelLoader; +import com.badlogic.gdx.graphics.g3d.old.loaders.g3d.ChunkReader.Chunk; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.Keyframe; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedAnimation; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedModel; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedSubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.Skeleton; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonAnimation; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonJoint; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonKeyframe; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonModel; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonSubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.ObjectMap; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/G3dtLoader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dtLoader.java similarity index 94% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/G3dtLoader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dtLoader.java index 13be14d06..0a4bde52d 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/g3d/G3dtLoader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/g3d/G3dtLoader.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.g3d; +package com.badlogic.gdx.graphics.g3d.old.loaders.g3d; import java.io.BufferedReader; import java.io.IOException; @@ -28,15 +28,15 @@ import com.badlogic.gdx.graphics.Mesh.VertexDataType; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.ModelLoaderHints; -import com.badlogic.gdx.graphics.g3d.loaders.KeyframedModelLoader; -import com.badlogic.gdx.graphics.g3d.loaders.StillModelLoader; -import com.badlogic.gdx.graphics.g3d.model.keyframe.Keyframe; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedAnimation; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedModel; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedSubMesh; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; +import com.badlogic.gdx.graphics.g3d.old.ModelLoaderHints; +import com.badlogic.gdx.graphics.g3d.old.loaders.KeyframedModelLoader; +import com.badlogic.gdx.graphics.g3d.old.loaders.StillModelLoader; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.Keyframe; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedAnimation; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedModel; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedSubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.FloatArray; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Frame.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Frame.java similarity index 93% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Frame.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Frame.java index 962beb376..97430f5ae 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Frame.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Frame.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.md2; +package com.badlogic.gdx.graphics.g3d.old.loaders.md2; public class MD2Frame { public float[] vertices; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Header.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Header.java similarity index 95% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Header.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Header.java index 19a2b848b..a5caab947 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Header.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Header.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.md2; +package com.badlogic.gdx.graphics.g3d.old.loaders.md2; public class MD2Header { public int ident; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Loader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Loader.java similarity index 96% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Loader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Loader.java index e91ccb5f3..2d1ce1328 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Loader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Loader.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.md2; +package com.badlogic.gdx.graphics.g3d.old.loaders.md2; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -28,12 +28,12 @@ import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.Mesh.VertexDataType; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.ModelLoaderHints; -import com.badlogic.gdx.graphics.g3d.loaders.KeyframedModelLoader; -import com.badlogic.gdx.graphics.g3d.model.keyframe.Keyframe; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedAnimation; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedModel; -import com.badlogic.gdx.graphics.g3d.model.keyframe.KeyframedSubMesh; +import com.badlogic.gdx.graphics.g3d.old.ModelLoaderHints; +import com.badlogic.gdx.graphics.g3d.old.loaders.KeyframedModelLoader; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.Keyframe; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedAnimation; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedModel; +import com.badlogic.gdx.graphics.g3d.old.model.keyframe.KeyframedSubMesh; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.utils.LittleEndianInputStream; import com.badlogic.gdx.utils.ObjectMap; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Normals.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Normals.java similarity index 99% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Normals.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Normals.java index efc5d8140..83070412b 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Normals.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Normals.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.md2; +package com.badlogic.gdx.graphics.g3d.old.loaders.md2; public class MD2Normals { public static float[][] normals = { {-0.525731f, 0.000000f, 0.850651f}, {-0.442863f, 0.238856f, 0.864188f}, diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Triangle.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Triangle.java similarity index 94% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Triangle.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Triangle.java index 5cd60527d..8ed772c52 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/md2/MD2Triangle.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/md2/MD2Triangle.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.md2; +package com.badlogic.gdx.graphics.g3d.old.loaders.md2; public class MD2Triangle { public short[] vertices = new short[3]; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/wavefront/ObjLoader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/wavefront/ObjLoader.java similarity index 96% rename from gdx/src/com/badlogic/gdx/graphics/g3d/loaders/wavefront/ObjLoader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/wavefront/ObjLoader.java index 1255c75e6..a8637d32b 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/loaders/wavefront/ObjLoader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/loaders/wavefront/ObjLoader.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.loaders.wavefront; +package com.badlogic.gdx.graphics.g3d.old.loaders.wavefront; import java.io.BufferedReader; import java.io.IOException; @@ -33,13 +33,13 @@ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.ModelLoaderHints; -import com.badlogic.gdx.graphics.g3d.loaders.StillModelLoader; -import com.badlogic.gdx.graphics.g3d.materials.ColorAttribute; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.materials.TextureAttribute; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; +import com.badlogic.gdx.graphics.g3d.old.ModelLoaderHints; +import com.badlogic.gdx.graphics.g3d.old.loaders.StillModelLoader; +import com.badlogic.gdx.graphics.g3d.old.materials.ColorAttribute; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.TextureAttribute; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.utils.FloatArray; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/BlendingAttribute.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/BlendingAttribute.java new file mode 100644 index 000000000..360cc9a34 --- /dev/null +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/BlendingAttribute.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright 2011 See AUTHORS file. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +package com.badlogic.gdx.graphics.g3d.old.materials; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.GL10; +import com.badlogic.gdx.graphics.glutils.ShaderProgram; +import com.badlogic.gdx.utils.Pool; + +public class BlendingAttribute extends MaterialAttribute { + + /** if BlendingAttribute name is translucent then default tranparency mechanism is used in shader */ + public static final String translucent = "translucent"; + + public int blendSrcFunc; + public int blendDstFunc; + + protected BlendingAttribute () { + } + + /** Utility constuctor for basic transparency blendSrcFunc = GL10.GL_SRC_ALPHA blendDstFunc = GL10.GL_ONE_MINUS_SRC_ALPHA + * @param name */ + public BlendingAttribute (String name) { + this(name, GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); + } + + public BlendingAttribute (String name, int srcFunc, int dstFunc) { + super(name); + blendSrcFunc = srcFunc; + blendDstFunc = dstFunc; + } + + @Override + public void bind () { + Gdx.gl.glBlendFunc(blendSrcFunc, blendDstFunc); + } + + @Override + public void bind (ShaderProgram program) { + Gdx.gl.glBlendFunc(blendSrcFunc, blendDstFunc); + } + + @Override + public MaterialAttribute copy () { + return new BlendingAttribute(this.name, this.blendSrcFunc, this.blendDstFunc); + } + + @Override + public void set (MaterialAttribute attr) { + BlendingAttribute blendAttr = (BlendingAttribute)attr; + name = blendAttr.name; + blendDstFunc = blendAttr.blendDstFunc; + blendSrcFunc = blendAttr.blendSrcFunc; + } + + private final static Pool pool = new Pool() { + @Override + protected BlendingAttribute newObject () { + return new BlendingAttribute(); + } + }; + + @Override + public MaterialAttribute pooledCopy () { + BlendingAttribute attr = pool.obtain(); + attr.set(this); + return attr; + } + + @Override + public void free () { + if (isPooled) pool.free(this); + } +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/ColorAttribute.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/ColorAttribute.java new file mode 100644 index 000000000..feaa9857d --- /dev/null +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/ColorAttribute.java @@ -0,0 +1,96 @@ +/******************************************************************************* + * Copyright 2011 See AUTHORS file. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +package com.badlogic.gdx.graphics.g3d.old.materials; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.GL10; +import com.badlogic.gdx.graphics.glutils.ShaderProgram; +import com.badlogic.gdx.utils.Pool; + +public class ColorAttribute extends MaterialAttribute { + + static final public String diffuse = "diffuseColor"; + static final public String specular = "specularColor"; + static final public String emissive = "emissiveColor"; + static final public String rim = "rimColor"; + static final public String fog = "fogColor"; + + public final Color color = new Color(); + + protected ColorAttribute () { + } + + /** Creates a {@link MaterialAttribute} that is a pure {@link Color}. + * + * @param color The {@link Color} that you wish the attribute to represent. + * @param name The name of the uniform in the {@link ShaderProgram} that will have its value set to this color. (A 'name' does + * not matter for a game that uses {@link GL10}). */ + public ColorAttribute (Color color, String name) { + super(name); + this.color.set(color); + } + + @Override + public void bind () { + if (Gdx.gl10 == null) throw new RuntimeException("Can't call ColorAttribute.bind() in a GL20 context"); + + // todo how about emissive or specular? + // TODO replace string equals with something more performant + if (diffuse.equals(diffuse)) Gdx.gl10.glColor4f(color.r, color.g, color.b, color.a); + } + + @Override + public void bind (ShaderProgram program) { + program.setUniformf(name, color.r, color.g, color.b, color.a); + } + + @Override + public MaterialAttribute copy () { + return new ColorAttribute(color, name); + } + + @Override + public void set (MaterialAttribute attr) { + ColorAttribute colAttr = (ColorAttribute)attr; + name = colAttr.name; + final Color c = colAttr.color; + color.r = c.r; + color.g = c.g; + color.b = c.b; + color.a = c.a; + } + + private final static Pool pool = new Pool() { + @Override + protected ColorAttribute newObject () { + return new ColorAttribute(); + } + }; + + @Override + public MaterialAttribute pooledCopy () { + ColorAttribute attr = pool.obtain(); + attr.set(this); + return attr; + } + + @Override + public void free () { + if (isPooled) pool.free(this); + } +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/materials/Material.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/Material.java similarity index 99% rename from gdx/src/com/badlogic/gdx/graphics/g3d/materials/Material.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/Material.java index 1936b2495..210d250a0 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/materials/Material.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/Material.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.materials; +package com.badlogic.gdx.graphics.g3d.old.materials; import java.util.Iterator; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/materials/MaterialAttribute.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/MaterialAttribute.java similarity index 96% rename from gdx/src/com/badlogic/gdx/graphics/g3d/materials/MaterialAttribute.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/MaterialAttribute.java index e91e4ec92..8ee4cc627 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/materials/MaterialAttribute.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/MaterialAttribute.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.materials; +package com.badlogic.gdx.graphics.g3d.old.materials; import com.badlogic.gdx.graphics.glutils.ShaderProgram; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/TextureAttribute.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/TextureAttribute.java new file mode 100644 index 000000000..15d9568e6 --- /dev/null +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/materials/TextureAttribute.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright 2011 See AUTHORS file. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +package com.badlogic.gdx.graphics.g3d.old.materials; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.GL10; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.Texture.TextureFilter; +import com.badlogic.gdx.graphics.Texture.TextureWrap; +import com.badlogic.gdx.graphics.glutils.ShaderProgram; +import com.badlogic.gdx.utils.Pool; + +public class TextureAttribute extends MaterialAttribute { + + public final static int MAX_TEXTURE_UNITS = 16; + static final public String diffuseTexture = "diffuseTexture"; + static final public String lightmapTexture = "lightmapTexture"; + static final public String specularTexture = "specularTexture"; + + public Texture texture; + public int unit; + public int minFilter; + public int magFilter; + public int uWrap; + public int vWrap; + + protected TextureAttribute () { + } + + public TextureAttribute (Texture texture, int unit, String name, TextureFilter minFilter, TextureFilter magFilter, + TextureWrap uWrap, TextureWrap vWrap) { + this(texture, unit, name, minFilter.getGLEnum(), magFilter.getGLEnum(), uWrap.getGLEnum(), vWrap.getGLEnum()); + } + + public TextureAttribute (Texture texture, int unit, String name, int minFilter, int magFilter, int uWrap, int vWrap) { + super(name); + this.texture = texture; + if (unit > MAX_TEXTURE_UNITS) throw new RuntimeException(MAX_TEXTURE_UNITS + " is max texture units supported"); + this.unit = unit; + this.uWrap = uWrap; + this.vWrap = vWrap; + this.minFilter = minFilter; + this.magFilter = magFilter; + } + + public TextureAttribute (Texture texture, int unit, String name) { + this(texture, unit, name, texture.getMinFilter(), texture.getMagFilter(), texture.getUWrap(), texture.getVWrap()); + } + + @Override + public void bind () { + texture.bind(unit); + Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, minFilter); + Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, magFilter); + Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, uWrap); + Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, vWrap); + } + + @Override + public void bind (ShaderProgram program) { + texture.bind(unit); + Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, minFilter); + Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, magFilter); + Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, uWrap); + Gdx.gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, vWrap); + program.setUniformi(name, unit); + } + + @Override + public MaterialAttribute copy () { + return new TextureAttribute(texture, unit, name, minFilter, magFilter, uWrap, vWrap); + } + + @Override + public void set (MaterialAttribute attr) { + TextureAttribute texAttr = (TextureAttribute)attr; + name = texAttr.name; + texture = texAttr.texture; + unit = texAttr.unit; + magFilter = texAttr.magFilter; + minFilter = texAttr.minFilter; + uWrap = texAttr.uWrap; + vWrap = texAttr.vWrap; + } + + /** this method check if the texture portion of texture attribute is equal, name isn't used */ + public boolean texturePortionEquals (TextureAttribute other) { + if (other == null) return false; + if (this == other) return true; + + return (texture == other.texture) && (unit == other.unit) && (minFilter == other.minFilter) + && (magFilter == other.magFilter) && (uWrap == other.uWrap) && (vWrap == other.vWrap); + + } + + private final static Pool pool = new Pool() { + @Override + protected TextureAttribute newObject () { + return new TextureAttribute(); + } + }; + + @Override + public MaterialAttribute pooledCopy () { + TextureAttribute attr = pool.obtain(); + attr.set(this); + return attr; + } + + @Override + public void free () { + if (isPooled) pool.free(this); + } +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/AnimatedModel.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/AnimatedModel.java similarity index 97% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/AnimatedModel.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/AnimatedModel.java index 31609d651..6c26db347 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/AnimatedModel.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/AnimatedModel.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model; +package com.badlogic.gdx.graphics.g3d.old.model; public interface AnimatedModel extends Model { /** Start playing the given animation at the given time in the animation and specify wether or not the animation will loop. diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/Animation.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/Animation.java similarity index 95% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/Animation.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/Animation.java index d8709b650..309fd7a37 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/Animation.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/Animation.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model; +package com.badlogic.gdx.graphics.g3d.old.model; public class Animation { public final String name; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/Model.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/Model.java similarity index 97% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/Model.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/Model.java index cd48f8f54..87267cac6 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/Model.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/Model.java @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model; +package com.badlogic.gdx.graphics.g3d.old.model; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.g3d.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.collision.BoundingBox; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/SubMesh.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/SubMesh.java similarity index 93% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/SubMesh.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/SubMesh.java index 260f08fe3..39ab7558b 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/SubMesh.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/SubMesh.java @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model; +package com.badlogic.gdx.graphics.g3d.old.model; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; import com.badlogic.gdx.math.collision.BoundingBox; public abstract class SubMesh { diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/Keyframe.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/Keyframe.java similarity index 94% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/Keyframe.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/Keyframe.java index a6d3165ac..13b118ed7 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/Keyframe.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/Keyframe.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.keyframe; +package com.badlogic.gdx.graphics.g3d.old.model.keyframe; public class Keyframe { public final float timeStamp; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/KeyframedAnimation.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/KeyframedAnimation.java similarity index 90% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/KeyframedAnimation.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/KeyframedAnimation.java index 4301bcc74..9d35e23da 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/KeyframedAnimation.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/KeyframedAnimation.java @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.keyframe; +package com.badlogic.gdx.graphics.g3d.old.model.keyframe; -import com.badlogic.gdx.graphics.g3d.model.Animation; +import com.badlogic.gdx.graphics.g3d.old.model.Animation; public class KeyframedAnimation extends Animation { public final float frameDuration; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/KeyframedModel.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/KeyframedModel.java similarity index 95% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/KeyframedModel.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/KeyframedModel.java index d32e7772a..21083a5d8 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/KeyframedModel.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/KeyframedModel.java @@ -14,12 +14,12 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.keyframe; +package com.badlogic.gdx.graphics.g3d.old.model.keyframe; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.model.AnimatedModel; -import com.badlogic.gdx.graphics.g3d.model.Model; -import com.badlogic.gdx.graphics.g3d.model.SubMesh; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.model.AnimatedModel; +import com.badlogic.gdx.graphics.g3d.old.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.SubMesh; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.collision.BoundingBox; import com.badlogic.gdx.utils.Array; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/KeyframedSubMesh.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/KeyframedSubMesh.java similarity index 93% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/KeyframedSubMesh.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/KeyframedSubMesh.java index 2748a7f9e..d613ccd6f 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/keyframe/KeyframedSubMesh.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/keyframe/KeyframedSubMesh.java @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.keyframe; +package com.badlogic.gdx.graphics.g3d.old.model.keyframe; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.model.SubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.SubMesh; import com.badlogic.gdx.math.collision.BoundingBox; import com.badlogic.gdx.utils.ObjectMap; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/Skeleton.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/Skeleton.java similarity index 99% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/Skeleton.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/Skeleton.java index d4251e9f1..b1436d2b7 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/Skeleton.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/Skeleton.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.skeleton; +package com.badlogic.gdx.graphics.g3d.old.model.skeleton; import java.util.HashMap; import java.util.Map; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonAnimation.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonAnimation.java similarity index 90% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonAnimation.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonAnimation.java index 9d264fee9..128f073e2 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonAnimation.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonAnimation.java @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.skeleton; +package com.badlogic.gdx.graphics.g3d.old.model.skeleton; -import com.badlogic.gdx.graphics.g3d.model.Animation; +import com.badlogic.gdx.graphics.g3d.old.model.Animation; public class SkeletonAnimation extends Animation { public final SkeletonKeyframe[][] perJointkeyFrames; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonJoint.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonJoint.java similarity index 95% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonJoint.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonJoint.java index f8b0ac128..8d79717fb 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonJoint.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonJoint.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.skeleton; +package com.badlogic.gdx.graphics.g3d.old.model.skeleton; import com.badlogic.gdx.math.Quaternion; import com.badlogic.gdx.math.Vector3; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonKeyframe.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonKeyframe.java similarity index 95% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonKeyframe.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonKeyframe.java index 5bc16fb5f..fd086c3cf 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonKeyframe.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonKeyframe.java @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.skeleton; +package com.badlogic.gdx.graphics.g3d.old.model.skeleton; import com.badlogic.gdx.math.Quaternion; import com.badlogic.gdx.math.Vector3; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonModel.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonModel.java similarity index 95% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonModel.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonModel.java index 934e218be..eafd4b3f3 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonModel.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonModel.java @@ -14,13 +14,13 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.skeleton; +package com.badlogic.gdx.graphics.g3d.old.model.skeleton; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.model.AnimatedModel; -import com.badlogic.gdx.graphics.g3d.model.Model; -import com.badlogic.gdx.graphics.g3d.model.SubMesh; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.model.AnimatedModel; +import com.badlogic.gdx.graphics.g3d.old.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.SubMesh; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonModelGpuSkinned.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonModelGpuSkinned.java similarity index 94% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonModelGpuSkinned.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonModelGpuSkinned.java index 4f55268c6..bb69893aa 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonModelGpuSkinned.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonModelGpuSkinned.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.skeleton; +package com.badlogic.gdx.graphics.g3d.old.model.skeleton; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.model.skeleton.Skeleton; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonModel; -import com.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonSubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.Skeleton; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonModel; +import com.badlogic.gdx.graphics.g3d.old.model.skeleton.SkeletonSubMesh; public class SkeletonModelGpuSkinned extends SkeletonModel { public final static String BoneIndexAttribue = "a_boneIndex"; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonSubMesh.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonSubMesh.java similarity index 92% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonSubMesh.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonSubMesh.java index 375279417..4e1632826 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/skeleton/SkeletonSubMesh.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/skeleton/SkeletonSubMesh.java @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.skeleton; +package com.badlogic.gdx.graphics.g3d.old.model.skeleton; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.model.SubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.SubMesh; import com.badlogic.gdx.math.collision.BoundingBox; public class SkeletonSubMesh extends SubMesh { diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/still/StillModel.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/still/StillModel.java similarity index 93% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/still/StillModel.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/still/StillModel.java index 91c1eb25b..eecdb5a1b 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/still/StillModel.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/still/StillModel.java @@ -14,13 +14,13 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.still; +package com.badlogic.gdx.graphics.g3d.old.model.still; import java.util.ArrayList; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.model.Model; -import com.badlogic.gdx.graphics.g3d.model.SubMesh; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.SubMesh; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.collision.BoundingBox; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/model/still/StillSubMesh.java b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/still/StillSubMesh.java similarity index 87% rename from gdx/src/com/badlogic/gdx/graphics/g3d/model/still/StillSubMesh.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/old/model/still/StillSubMesh.java index 3150021c1..7bc25d191 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/model/still/StillSubMesh.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/old/model/still/StillSubMesh.java @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -package com.badlogic.gdx.graphics.g3d.model.still; +package com.badlogic.gdx.graphics.g3d.old.model.still; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.model.SubMesh; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.model.SubMesh; import com.badlogic.gdx.math.collision.BoundingBox; public class StillSubMesh extends SubMesh { diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/InterimModel.java b/gdx/src/com/badlogic/gdx/graphics/g3d/test/InterimModel.java similarity index 53% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/InterimModel.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/test/InterimModel.java index cd24c67a5..c57499ccd 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/InterimModel.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/test/InterimModel.java @@ -1,16 +1,16 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.test; +package com.badlogic.gdx.graphics.g3d.test; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.materials.MaterialAttribute; -import com.badlogic.gdx.graphics.g3d.model.Model; -import com.badlogic.gdx.graphics.g3d.model.SubMesh; -import com.badlogic.gdx.graphics.g3d.xoppa.RenderInstance; -import com.badlogic.gdx.graphics.g3d.xoppa.Renderable; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.BlendingAttribute; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.ColorAttribute; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.NewMaterial; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.TextureAttribute; -import com.badlogic.gdx.graphics.g3d.xoppa.utils.TextureDescription; +import com.badlogic.gdx.graphics.g3d.RenderInstance; +import com.badlogic.gdx.graphics.g3d.Renderable; +import com.badlogic.gdx.graphics.g3d.materials.BlendingAttribute; +import com.badlogic.gdx.graphics.g3d.materials.ColorAttribute; +import com.badlogic.gdx.graphics.g3d.materials.NewMaterial; +import com.badlogic.gdx.graphics.g3d.materials.TextureAttribute; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.MaterialAttribute; +import com.badlogic.gdx.graphics.g3d.old.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.SubMesh; +import com.badlogic.gdx.graphics.g3d.utils.TextureDescription; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.GdxRuntimeException; @@ -20,19 +20,19 @@ public class InterimModel implements NewModel { public final static NewMaterial convertMaterial(final Material mtl) { NewMaterial result = new NewMaterial(); for (MaterialAttribute attr : mtl) { - if (attr instanceof com.badlogic.gdx.graphics.g3d.materials.BlendingAttribute) { - com.badlogic.gdx.graphics.g3d.materials.BlendingAttribute a = (com.badlogic.gdx.graphics.g3d.materials.BlendingAttribute)attr; + if (attr instanceof com.badlogic.gdx.graphics.g3d.old.materials.BlendingAttribute) { + com.badlogic.gdx.graphics.g3d.old.materials.BlendingAttribute a = (com.badlogic.gdx.graphics.g3d.old.materials.BlendingAttribute)attr; result.add(new BlendingAttribute(a.blendSrcFunc, a.blendDstFunc)); - } else if (attr instanceof com.badlogic.gdx.graphics.g3d.materials.ColorAttribute) { - com.badlogic.gdx.graphics.g3d.materials.ColorAttribute a = (com.badlogic.gdx.graphics.g3d.materials.ColorAttribute)attr; - if (a.name.compareTo(com.badlogic.gdx.graphics.g3d.materials.ColorAttribute.specular)==0) + } else if (attr instanceof com.badlogic.gdx.graphics.g3d.old.materials.ColorAttribute) { + com.badlogic.gdx.graphics.g3d.old.materials.ColorAttribute a = (com.badlogic.gdx.graphics.g3d.old.materials.ColorAttribute)attr; + if (a.name.compareTo(com.badlogic.gdx.graphics.g3d.old.materials.ColorAttribute.specular)==0) result.add(ColorAttribute.createSpecular(a.color)); else result.add(ColorAttribute.createDiffuse(a.color)); - } else if (attr instanceof com.badlogic.gdx.graphics.g3d.materials.TextureAttribute) { - com.badlogic.gdx.graphics.g3d.materials.TextureAttribute a = (com.badlogic.gdx.graphics.g3d.materials.TextureAttribute)attr; + } else if (attr instanceof com.badlogic.gdx.graphics.g3d.old.materials.TextureAttribute) { + com.badlogic.gdx.graphics.g3d.old.materials.TextureAttribute a = (com.badlogic.gdx.graphics.g3d.old.materials.TextureAttribute)attr; final TextureDescription tex = new TextureDescription(a.texture, a.minFilter, a.magFilter, a.uWrap, a.vWrap); - if (a.name.compareTo(com.badlogic.gdx.graphics.g3d.materials.TextureAttribute.specularTexture)==0) + if (a.name.compareTo(com.badlogic.gdx.graphics.g3d.old.materials.TextureAttribute.specularTexture)==0) result.add(new TextureAttribute(TextureAttribute.Specular, tex)); else // if (a.name.compareTo(com.badlogic.gdx.graphics.g3d.materials.TextureAttribute.diffuseTexture)==0) result.add(new TextureAttribute(TextureAttribute.Diffuse, tex)); diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/Light.java b/gdx/src/com/badlogic/gdx/graphics/g3d/test/Light.java similarity index 95% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/Light.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/test/Light.java index e5cfab215..780386d2d 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/Light.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/test/Light.java @@ -1,4 +1,4 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.test; +package com.badlogic.gdx.graphics.g3d.test; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.math.Vector3; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/test/NewModel.java b/gdx/src/com/badlogic/gdx/graphics/g3d/test/NewModel.java new file mode 100644 index 000000000..b60f76816 --- /dev/null +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/test/NewModel.java @@ -0,0 +1,8 @@ +package com.badlogic.gdx.graphics.g3d.test; + +import com.badlogic.gdx.graphics.g3d.RenderInstance; +import com.badlogic.gdx.graphics.g3d.Renderable; + +public interface NewModel { + Iterable getParts(float distance); +} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/OldBatchRenderer.java b/gdx/src/com/badlogic/gdx/graphics/g3d/test/OldBatchRenderer.java similarity index 77% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/OldBatchRenderer.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/test/OldBatchRenderer.java index 037efad31..fc00bdef6 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/OldBatchRenderer.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/test/OldBatchRenderer.java @@ -1,9 +1,9 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.test; +package com.badlogic.gdx.graphics.g3d.test; import java.util.Comparator; import com.badlogic.gdx.graphics.Camera; -import com.badlogic.gdx.graphics.g3d.xoppa.RenderInstance; +import com.badlogic.gdx.graphics.g3d.RenderInstance; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.utils.Array; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/OldBatchRendererGLES11.java b/gdx/src/com/badlogic/gdx/graphics/g3d/test/OldBatchRendererGLES11.java similarity index 93% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/OldBatchRendererGLES11.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/test/OldBatchRendererGLES11.java index 160c13297..78534b3ba 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/OldBatchRendererGLES11.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/test/OldBatchRendererGLES11.java @@ -1,4 +1,4 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.test; +package com.badlogic.gdx.graphics.g3d.test; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Camera; @@ -8,10 +8,10 @@ import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.materials.MaterialAttribute; -import com.badlogic.gdx.graphics.g3d.materials.TextureAttribute; -import com.badlogic.gdx.graphics.g3d.xoppa.RenderInstance; +import com.badlogic.gdx.graphics.g3d.RenderInstance; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.MaterialAttribute; +import com.badlogic.gdx.graphics.g3d.old.materials.TextureAttribute; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.utils.Array; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/OldBatchRendererGLES20.java b/gdx/src/com/badlogic/gdx/graphics/g3d/test/OldBatchRendererGLES20.java similarity index 94% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/OldBatchRendererGLES20.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/test/OldBatchRendererGLES20.java index 28c8ce8e3..2dd5ff27d 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/OldBatchRendererGLES20.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/test/OldBatchRendererGLES20.java @@ -1,4 +1,4 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.test; +package com.badlogic.gdx.graphics.g3d.test; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Camera; @@ -7,11 +7,11 @@ import com.badlogic.gdx.graphics.GL11; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.materials.MaterialAttribute; -import com.badlogic.gdx.graphics.g3d.materials.TextureAttribute; -import com.badlogic.gdx.graphics.g3d.xoppa.RenderInstance; -import com.badlogic.gdx.graphics.g3d.xoppa.utils.ExclusiveTextures; +import com.badlogic.gdx.graphics.g3d.RenderInstance; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.MaterialAttribute; +import com.badlogic.gdx.graphics.g3d.old.materials.TextureAttribute; +import com.badlogic.gdx.graphics.g3d.utils.ExclusiveTextures; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.utils.Array; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/TestShader.java b/gdx/src/com/badlogic/gdx/graphics/g3d/test/TestShader.java similarity index 93% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/TestShader.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/test/TestShader.java index 64a199eb6..8db326846 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/TestShader.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/test/TestShader.java @@ -1,19 +1,19 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.test; +package com.badlogic.gdx.graphics.g3d.test; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Camera; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.xoppa.RenderContext; -import com.badlogic.gdx.graphics.g3d.xoppa.RenderInstance; -import com.badlogic.gdx.graphics.g3d.xoppa.Renderable; -import com.badlogic.gdx.graphics.g3d.xoppa.Shader; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.BlendingAttribute; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.ColorAttribute; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.NewMaterial; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.TextureAttribute; -import com.badlogic.gdx.graphics.g3d.xoppa.utils.ExclusiveTextures; +import com.badlogic.gdx.graphics.g3d.RenderContext; +import com.badlogic.gdx.graphics.g3d.RenderInstance; +import com.badlogic.gdx.graphics.g3d.Renderable; +import com.badlogic.gdx.graphics.g3d.Shader; +import com.badlogic.gdx.graphics.g3d.materials.BlendingAttribute; +import com.badlogic.gdx.graphics.g3d.materials.ColorAttribute; +import com.badlogic.gdx.graphics.g3d.materials.NewMaterial; +import com.badlogic.gdx.graphics.g3d.materials.TextureAttribute; +import com.badlogic.gdx.graphics.g3d.utils.ExclusiveTextures; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.Matrix3; import com.badlogic.gdx.math.Matrix4; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/test.fragment.glsl b/gdx/src/com/badlogic/gdx/graphics/g3d/test/test.fragment.glsl similarity index 100% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/test.fragment.glsl rename to gdx/src/com/badlogic/gdx/graphics/g3d/test/test.fragment.glsl diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/test.vertex.glsl b/gdx/src/com/badlogic/gdx/graphics/g3d/test/test.vertex.glsl similarity index 100% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/test.vertex.glsl rename to gdx/src/com/badlogic/gdx/graphics/g3d/test/test.vertex.glsl diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/utils/Binder.java b/gdx/src/com/badlogic/gdx/graphics/g3d/utils/Binder.java similarity index 75% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/utils/Binder.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/utils/Binder.java index 73fcaeddc..18cf3eb00 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/utils/Binder.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/utils/Binder.java @@ -1,4 +1,4 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.utils; +package com.badlogic.gdx.graphics.g3d.utils; public class Binder { diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/utils/ExclusiveTextures.java b/gdx/src/com/badlogic/gdx/graphics/g3d/utils/ExclusiveTextures.java similarity index 99% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/utils/ExclusiveTextures.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/utils/ExclusiveTextures.java index 779ea66a3..8b41ef136 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/utils/ExclusiveTextures.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/utils/ExclusiveTextures.java @@ -1,4 +1,4 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.utils; +package com.badlogic.gdx.graphics.g3d.utils; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL10; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/utils/TextureDescription.java b/gdx/src/com/badlogic/gdx/graphics/g3d/utils/TextureDescription.java similarity index 97% rename from gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/utils/TextureDescription.java rename to gdx/src/com/badlogic/gdx/graphics/g3d/utils/TextureDescription.java index 3dcc9db08..9986cc3eb 100644 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/utils/TextureDescription.java +++ b/gdx/src/com/badlogic/gdx/graphics/g3d/utils/TextureDescription.java @@ -1,4 +1,4 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.utils; +package com.badlogic.gdx.graphics.g3d.utils; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Texture; diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/BlendingAttribute.java b/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/BlendingAttribute.java deleted file mode 100644 index 30a4ee11b..000000000 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/BlendingAttribute.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.materials; - -import com.badlogic.gdx.graphics.g3d.xoppa.materials.NewMaterial.Attribute; - -public class BlendingAttribute extends NewMaterial.Attribute { - public final static String Alias = "blended"; - public final static long Type = register(Alias); - - public final static boolean is(final long mask) { - return (mask & Type) == mask; - } - - public int sourceFunction; - public int destFunction; - - public BlendingAttribute() { - super(Type); - } - - public BlendingAttribute(final int sourceFunc, final int destFunc) { - this(); - sourceFunction = sourceFunc; - destFunction = destFunc; - } - - public BlendingAttribute(final BlendingAttribute copyFrom) { - this(copyFrom == null ? 0 : copyFrom.sourceFunction, copyFrom == null ? 0 : copyFrom.destFunction); - } - - @Override - public BlendingAttribute copy () { - return new BlendingAttribute(this); - } - - @Override - protected boolean equals (final Attribute other) { - return ((BlendingAttribute)other).sourceFunction == sourceFunction && - ((BlendingAttribute)other).destFunction == destFunction; - } -} \ No newline at end of file diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/ColorAttribute.java b/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/ColorAttribute.java deleted file mode 100644 index 06e9eb5ae..000000000 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/ColorAttribute.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.materials; - -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.NewMaterial.Attribute; -import com.badlogic.gdx.utils.GdxRuntimeException; - -public class ColorAttribute extends NewMaterial.Attribute { - public final static String DiffuseAlias = "diffuseColor"; - public final static long Diffuse = register(DiffuseAlias); - public final static String SpecularAlias = "specularColor"; - public final static long Specular = register(SpecularAlias); - - // Might be useful:... - protected static long Mask = Diffuse | Specular; - - public final static boolean is(final long mask) { - return (mask & Mask) != 0; - } - - public final static ColorAttribute createDiffuse(final Color color) { - return new ColorAttribute(Diffuse, color); - } - - public final static ColorAttribute createSpecular(final Color color) { - return new ColorAttribute(Specular, color); - } - - public final Color color = new Color(); - - public ColorAttribute(final long type) { - this(type, null); - } - - public ColorAttribute(final long type, final Color color) { - super(type); - if (!is(type)) - throw new GdxRuntimeException("Invalid type specified"); - if (color != null) - this.color.set(color); - } - - public ColorAttribute(final ColorAttribute copyFrom) { - this(copyFrom.type, copyFrom.color); - } - - @Override - public Attribute copy () { - return new ColorAttribute(this); - } - - @Override - protected boolean equals (Attribute other) { - return ((ColorAttribute)other).color.equals(color); - } -} \ No newline at end of file diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/TextureAttribute.java b/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/TextureAttribute.java deleted file mode 100644 index ae5157bee..000000000 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/materials/TextureAttribute.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.materials; - -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.NewMaterial.Attribute; -import com.badlogic.gdx.graphics.g3d.xoppa.utils.TextureDescription; -import com.badlogic.gdx.utils.GdxRuntimeException; - -public class TextureAttribute extends NewMaterial.Attribute { - public final static String DiffuseAlias = "diffuseTexture"; - public final static long Diffuse = register(DiffuseAlias); - public final static String SpecularAlias = "specularTexture"; - public final static long Specular = register(SpecularAlias); - - // Might be useful:... - protected static long Mask = Diffuse | Specular; - - public final static boolean is(final long mask) { - return (mask & Mask) != 0; - } - - public final TextureDescription textureDescription; - - public TextureAttribute(final long type, final TextureDescription textureDescription) { - super(type); - if (!is(type)) - throw new GdxRuntimeException("Invalid type specified"); - this.textureDescription = textureDescription; - } - - public TextureAttribute(final long type) { - this(type, null); - } - - public TextureAttribute(final TextureAttribute copyFrom) { - this(copyFrom.getType(), copyFrom.textureDescription); - } - - @Override - public Attribute copy () { - return new TextureAttribute(this); - } - - @Override - protected boolean equals (Attribute other) { - return ((TextureAttribute)other).textureDescription.equals(textureDescription); - } -} diff --git a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/NewModel.java b/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/NewModel.java deleted file mode 100644 index 49e136942..000000000 --- a/gdx/src/com/badlogic/gdx/graphics/g3d/xoppa/test/NewModel.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.badlogic.gdx.graphics.g3d.xoppa.test; - -import com.badlogic.gdx.graphics.g3d.xoppa.RenderInstance; -import com.badlogic.gdx.graphics.g3d.xoppa.Renderable; - -public interface NewModel { - Iterable getParts(float distance); -} diff --git a/tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglDebugStarter.java b/tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglDebugStarter.java index f4e82eca5..c45b4d114 100644 --- a/tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglDebugStarter.java +++ b/tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglDebugStarter.java @@ -29,6 +29,8 @@ import com.badlogic.gdx.tests.TideMapDirectLoaderTest; import com.badlogic.gdx.tests.TiledMapAssetManagerTest; import com.badlogic.gdx.tests.TiledMapDirectLoaderTest; import com.badlogic.gdx.tests.bench.TiledMapBench; +import com.badlogic.gdx.tests.g3d.BatchRenderTest; +import com.badlogic.gdx.tests.g3d.JsonModelLoaderTest; import com.badlogic.gdx.tests.superkoalio.SuperKoalio; import com.badlogic.gdx.tests.utils.GdxTest; import com.badlogic.gdx.utils.SharedLibraryLoader; @@ -43,7 +45,7 @@ public class LwjglDebugStarter { new SharedLibraryLoader("../../gdx/libs/gdx-natives.jar").load("gdx"); - GdxTest test = new SuperKoalio(); + GdxTest test = new BatchRenderTest(); LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); config.useGL20 = test.needsGL20(); new LwjglApplication(test, config); diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/CullTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/CullTest.java index a330b512c..b31b9ed57 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/CullTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/CullTest.java @@ -27,8 +27,8 @@ import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.tests.utils.GdxTest; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/EdgeDetectionTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/EdgeDetectionTest.java index e22b57996..8c0757cb5 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/EdgeDetectionTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/EdgeDetectionTest.java @@ -26,8 +26,8 @@ import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.graphics.glutils.FrameBuffer; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.Matrix4; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/FramebufferToTextureTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/FramebufferToTextureTest.java index dd692ac3a..81b6c1e9a 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/FramebufferToTextureTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/FramebufferToTextureTest.java @@ -25,8 +25,8 @@ import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.tests.utils.GdxTest; import com.badlogic.gdx.utils.ScreenUtils; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/FrustumTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/FrustumTest.java index f7a30110a..9330b31f7 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/FrustumTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/FrustumTest.java @@ -23,8 +23,8 @@ import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer10; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.Frustum; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/MaterialTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/MaterialTest.java index 5cf5834e9..b10de6209 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/MaterialTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/MaterialTest.java @@ -22,12 +22,12 @@ import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.materials.BlendingAttribute; -import com.badlogic.gdx.graphics.g3d.materials.ColorAttribute; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.materials.TextureAttribute; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.materials.BlendingAttribute; +import com.badlogic.gdx.graphics.g3d.old.materials.ColorAttribute; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.TextureAttribute; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.tests.utils.GdxTest; public class MaterialTest extends GdxTest { diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/ObjTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/ObjTest.java index 70694c1a6..ec953f60d 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/ObjTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/ObjTest.java @@ -22,8 +22,8 @@ import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture.TextureFilter; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.math.collision.BoundingBox; import com.badlogic.gdx.tests.utils.GdxTest; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/PickingTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/PickingTest.java index ac8184434..b9c24d963 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/PickingTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/PickingTest.java @@ -25,8 +25,8 @@ import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer10; import com.badlogic.gdx.math.Intersector; import com.badlogic.gdx.math.Vector3; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/ProjectTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/ProjectTest.java index 0c33ef423..e762d5b14 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/ProjectTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/ProjectTest.java @@ -27,8 +27,8 @@ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.tests.utils.GdxTest; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/ProjectiveTextureTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/ProjectiveTextureTest.java index 9774d5c1c..df0575b79 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/ProjectiveTextureTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/ProjectiveTextureTest.java @@ -27,8 +27,8 @@ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer20; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.math.Matrix4; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/ShadowMappingTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/ShadowMappingTest.java index a91493d8e..5bd906118 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/ShadowMappingTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/ShadowMappingTest.java @@ -24,8 +24,8 @@ import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.graphics.glutils.FrameBuffer; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.scenes.scene2d.Actor; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseBulletTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseBulletTest.java index e3b25a91a..4ccfbda83 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseBulletTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseBulletTest.java @@ -24,9 +24,9 @@ import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; import com.badlogic.gdx.math.collision.Ray; import com.badlogic.gdx.physics.bullet.Bullet; import com.badlogic.gdx.physics.bullet.btIDebugDraw; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseEntity.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseEntity.java index 89549598d..4ae449926 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseEntity.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseEntity.java @@ -17,7 +17,7 @@ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.Model; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.utils.Disposable; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseWorld.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseWorld.java index c2cef8c53..c61159154 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseWorld.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BaseWorld.java @@ -19,7 +19,7 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.Model; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Disposable; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BulletConstructor.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BulletConstructor.java index 307d5182f..d81651e29 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BulletConstructor.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BulletConstructor.java @@ -16,7 +16,7 @@ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.Model; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.collision.BoundingBox; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BulletEntity.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BulletEntity.java index 491974328..36157ba8c 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BulletEntity.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/BulletEntity.java @@ -16,7 +16,7 @@ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.Model; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.physics.bullet.btCollisionObject; import com.badlogic.gdx.physics.bullet.btCollisionShape; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/CollisionWorldTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/CollisionWorldTest.java index a975697c5..9ebdc7ff9 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/CollisionWorldTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/CollisionWorldTest.java @@ -18,7 +18,7 @@ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g3d.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.Model; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.physics.bullet.ContactResultCallback; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/ConstraintsTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/ConstraintsTest.java index 944517531..66992c0bf 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/ConstraintsTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/ConstraintsTest.java @@ -21,9 +21,9 @@ import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.physics.bullet.btDiscreteDynamicsWorld; import com.badlogic.gdx.physics.bullet.btDynamicsWorld; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/ConvexHullTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/ConvexHullTest.java index dc3ddd5ef..35526fda1 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/ConvexHullTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/ConvexHullTest.java @@ -19,10 +19,10 @@ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.loaders.wavefront.ObjLoader; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.loaders.wavefront.ObjLoader; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; import com.badlogic.gdx.physics.bullet.btConvexHullShape; import com.badlogic.gdx.physics.bullet.btShapeHull; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/FrustumCullingTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/FrustumCullingTest.java index ff7b473e1..a63d05acf 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/FrustumCullingTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/FrustumCullingTest.java @@ -22,10 +22,10 @@ import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.model.Model; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Quaternion; import com.badlogic.gdx.math.Vector3; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/MeshShapeTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/MeshShapeTest.java index a76f29db1..2bffad82e 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/MeshShapeTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/MeshShapeTest.java @@ -17,8 +17,8 @@ package com.badlogic.gdx.tests.bullet; import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.collision.BoundingBox; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/RayPickRagdollTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/RayPickRagdollTest.java index a7fe760a3..399e93eb5 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/RayPickRagdollTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/RayPickRagdollTest.java @@ -20,10 +20,10 @@ import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.model.Model; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/SoftMeshTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/SoftMeshTest.java index 1ff82032e..ad15f4bcf 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/SoftMeshTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/bullet/SoftMeshTest.java @@ -21,9 +21,9 @@ import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.VertexAttributes.Usage; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.loaders.wavefront.ObjLoader; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.loaders.wavefront.ObjLoader; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.physics.bullet.Material; diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/BatchRenderTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/BatchRenderTest.java index 895542529..54ff8423e 100644 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/BatchRenderTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/BatchRenderTest.java @@ -8,26 +8,26 @@ import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Pixmap.Format; -import com.badlogic.gdx.graphics.g3d.loaders.ModelLoaderRegistry; -import com.badlogic.gdx.graphics.g3d.loaders.json.JsonModelLoader; -import com.badlogic.gdx.graphics.g3d.materials.Material; -import com.badlogic.gdx.graphics.g3d.materials.TextureAttribute; -import com.badlogic.gdx.graphics.g3d.model.Model; -import com.badlogic.gdx.graphics.g3d.model.SubMesh; -import com.badlogic.gdx.graphics.g3d.model.still.StillModel; -import com.badlogic.gdx.graphics.g3d.model.still.StillSubMesh; -import com.badlogic.gdx.graphics.g3d.xoppa.RenderBatch; -import com.badlogic.gdx.graphics.g3d.xoppa.RenderContext; -import com.badlogic.gdx.graphics.g3d.xoppa.RenderInstance; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.ColorAttribute; -import com.badlogic.gdx.graphics.g3d.xoppa.materials.NewMaterial; -import com.badlogic.gdx.graphics.g3d.xoppa.test.Light; -import com.badlogic.gdx.graphics.g3d.xoppa.test.NewModel; -import com.badlogic.gdx.graphics.g3d.xoppa.test.OldBatchRendererGLES11; -import com.badlogic.gdx.graphics.g3d.xoppa.test.OldBatchRendererGLES20; -import com.badlogic.gdx.graphics.g3d.xoppa.test.InterimModel; -import com.badlogic.gdx.graphics.g3d.xoppa.test.TestShader; -import com.badlogic.gdx.graphics.g3d.xoppa.utils.ExclusiveTextures; +import com.badlogic.gdx.graphics.g3d.RenderBatch; +import com.badlogic.gdx.graphics.g3d.RenderContext; +import com.badlogic.gdx.graphics.g3d.RenderInstance; +import com.badlogic.gdx.graphics.g3d.loader.JsonModelLoader; +import com.badlogic.gdx.graphics.g3d.materials.ColorAttribute; +import com.badlogic.gdx.graphics.g3d.materials.NewMaterial; +import com.badlogic.gdx.graphics.g3d.old.loaders.ModelLoaderRegistry; +import com.badlogic.gdx.graphics.g3d.old.materials.Material; +import com.badlogic.gdx.graphics.g3d.old.materials.TextureAttribute; +import com.badlogic.gdx.graphics.g3d.old.model.Model; +import com.badlogic.gdx.graphics.g3d.old.model.SubMesh; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillModel; +import com.badlogic.gdx.graphics.g3d.old.model.still.StillSubMesh; +import com.badlogic.gdx.graphics.g3d.test.InterimModel; +import com.badlogic.gdx.graphics.g3d.test.Light; +import com.badlogic.gdx.graphics.g3d.test.NewModel; +import com.badlogic.gdx.graphics.g3d.test.OldBatchRendererGLES11; +import com.badlogic.gdx.graphics.g3d.test.OldBatchRendererGLES20; +import com.badlogic.gdx.graphics.g3d.test.TestShader; +import com.badlogic.gdx.graphics.g3d.utils.ExclusiveTextures; import com.badlogic.gdx.graphics.glutils.FrameBuffer; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector3; @@ -91,7 +91,7 @@ public class BatchRenderTest extends GdxTest { for (int i = 0; i < textures.size; i++) cubes.add(new InterimModel(new StillModel(new StillSubMesh(mesh.name, mesh.mesh, mesh.primitiveType, new Material("mat", new TextureAttribute(textures.get(i), 0, TextureAttribute.diffuseTexture)))))); - createScene1(); + createScene2(); cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.near = 1f; @@ -121,7 +121,7 @@ public class BatchRenderTest extends GdxTest { instances.add(new ModelInstance(testModel, (new Matrix4()).setToTranslation(0, 5, 4))); instances.add(new ModelInstance(carModel, (new Matrix4()).setToTranslation(6, 0, -4))); - for (int i = 0; i < 10; i++) + for (int i = 0; i < 1000; i++) instances.add(new ModelInstance(sphereModel, (new Matrix4()).setToTranslation(MIN_X + (float)Math.random() * SIZE_X, MIN_Y + (float)Math.random() * SIZE_Y, MIN_Z + (float)Math.random() * SIZE_Z).scl(0.25f + (float)Math.random()))); } diff --git a/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/JsonModelLoaderTest.java b/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/JsonModelLoaderTest.java index 7d64aa483..fc1393e3e 100755 --- a/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/JsonModelLoaderTest.java +++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/JsonModelLoaderTest.java @@ -3,8 +3,8 @@ package com.badlogic.gdx.tests.g3d; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.PerspectiveCamera; -import com.badlogic.gdx.graphics.g3d.loaders.json.JsonModelLoader; -import com.badlogic.gdx.graphics.g3d.model.Model; +import com.badlogic.gdx.graphics.g3d.loader.JsonModelLoader; +import com.badlogic.gdx.graphics.g3d.old.model.Model; import com.badlogic.gdx.tests.utils.GdxTest; public class JsonModelLoaderTest extends GdxTest { @@ -21,7 +21,7 @@ public class JsonModelLoaderTest extends GdxTest { @Override public void create () { JsonModelLoader loader = new JsonModelLoader(); - model = loader.load(Gdx.files.internal("data/g3d/head_parented.g3dj"), null); + model = loader.load(Gdx.files.internal("data/g3d/head.g3dj"), null); cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.position.set(1f, 1.5f, 1f); -- 2.11.0