vtm-themes: move GDX models (#577)

This commit is contained in:
Gustl22
2018-08-30 13:39:44 +02:00
committed by Emux
parent de259c27d7
commit 272ce1d9b6
5 changed files with 68 additions and 2 deletions

View File

@@ -0,0 +1,52 @@
/*
* Copyright 2018 Gustl22
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.theme;
import org.oscim.backend.AssetAdapter;
import java.io.InputStream;
/**
* Enumeration of all internal VTM models.
* <p>
* Generate own models:
* If using Blender for new models, start fresh project delete camera and light source, keep blender render engine.
* Export as .obj/fbx
* Use Fbx converter [https://github.com/libgdx/fbx-conv] and Java GUI [https://github.com/ASneakyFox/libgdx-fbxconv-gui]
* to convert to g3d.
* .obj is supported, too, but has troubles with textures and materials.
* More: [https://github.com/libgdx/libgdx/wiki/Importing-Blender-models-in-LibGDX]
*/
public enum VtmModels {
TREE("models/natural/treeA.g3dj");
private final String mPath;
VtmModels(String path) {
mPath = path;
}
/**
* Get relative path to models. Assets path isn't included!
*/
public String getPath() {
return mPath;
}
public InputStream getModelAsStream() {
return AssetAdapter.readFileAsStream(mPath);
}
}