本文整理汇总了Java中com.badlogic.gdx.assets.loaders.ModelLoader类的典型用法代码示例。如果您正苦于以下问题:Java ModelLoader类的具体用法?Java ModelLoader怎么用?Java ModelLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelLoader类属于com.badlogic.gdx.assets.loaders包,在下文中一共展示了ModelLoader类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: create
import com.badlogic.gdx.assets.loaders.ModelLoader; //导入依赖的package包/类
@Override
public void create () {
super.create();
ModelLoader g3djLoader = new G3dModelLoader(new JsonReader());
model = g3djLoader.loadModel(Gdx.files.internal("data/g3d/btscene1.g3dj"));
disposables.add(model);
importer = new MyImporter((btDynamicsWorld)world.collisionWorld);
importer.loadFile(Gdx.files.internal("data/g3d/btscene1.bullet"));
camera.position.set(10f, 15f, 20f);
camera.up.set(0, 1, 0);
camera.lookAt(-10, 8, 0);
camera.update();
}
开发者ID:Matsemann,项目名称:eamaster,代码行数:17,代码来源:ImportTest.java
示例2: GameScene
import com.badlogic.gdx.assets.loaders.ModelLoader; //导入依赖的package包/类
public GameScene(ModelLoader.ModelParameters modelParameters,
TextureLoader.TextureParameter textureParameter,
ParticleEffectLoader.ParticleEffectLoadParameter pfxParameter,
String pfxPath, String modelPath, String modelExt, ObjectMap<String, GameObjectBlueprint> sharedBlueprints) {
this.sharedBlueprints = sharedBlueprints;
this.assets = new BlenderAssetManager(modelParameters, textureParameter, pfxParameter,
pfxPath, modelPath, modelExt);
}
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:9,代码来源:GameScene.java
示例3: GameSceneManager
import com.badlogic.gdx.assets.loaders.ModelLoader; //导入依赖的package包/类
public GameSceneManager(ModelLoader.ModelParameters modelParameters,
TextureLoader.TextureParameter textureParameter,
ParticleEffectLoader.ParticleEffectLoadParameter pfxParameter,
String pfxPath, String modelPath, String modelExt) {
this.modelPath = modelPath;
this.modelExt = modelExt;
this.pfxPath = pfxPath;
this.modelParameters = modelParameters;
this.textureParameter = textureParameter;
this.pfxParameter = pfxParameter;
}
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:13,代码来源:GameSceneManager.java
示例4: BlenderAssetManager
import com.badlogic.gdx.assets.loaders.ModelLoader; //导入依赖的package包/类
public BlenderAssetManager(
ModelLoader.ModelParameters modelParameters,
TextureLoader.TextureParameter textureParameter,
ParticleEffectLoader.ParticleEffectLoadParameter pfxParameter,
String pfxPath, String modelPath, String modelExt) {
this.modelExt = modelExt;
this.modelPath = modelPath;
this.pfxPath = pfxPath;
this.modelParameters = modelParameters;
this.textureParameter = textureParameter;
this.pfxParameter = pfxParameter;
}
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:14,代码来源:BlenderAssetManager.java
示例5: loadSphere
import com.badlogic.gdx.assets.loaders.ModelLoader; //导入依赖的package包/类
private void loadSphere(String planetId) {
ModelLoader loader = new ObjLoader();
sphereModel = loader.loadModel(Gdx.files.internal("models/sphere01.obj"),
new SphereTextureProvider(planetId));
environmentSphere = new ModelInstance(sphereModel);
Attribute attribute = environmentSphere.materials.get(0).get(
ColorAttribute.getAttributeType(ColorAttribute.DiffuseAlias));
((ColorAttribute) attribute).color.r = 1;
((ColorAttribute) attribute).color.g = 1;
((ColorAttribute) attribute).color.b = 1;
}
开发者ID:aphex-,项目名称:Alien-Ark,代码行数:14,代码来源:ControllerPlanet.java
示例6: onInitialize
import com.badlogic.gdx.assets.loaders.ModelLoader; //导入依赖的package包/类
@Override
protected void onInitialize() {
this.levelEnv = new LevelEnv();
this.camera = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.near = 0.1f;
camera.position.set(5, 5, 5);
camera.lookAt(0.1f, 0.1f, 0.1f);
environment = new Environment();
environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1.f));
environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -0.5f, -1.0f, -0.8f));
this.modelBatch = new ModelBatch();
//this.voxelBatch = new VoxelBatch(new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED)));
ModelLoader g3djLoader = new G3dModelLoader(new UBJsonReader());
model = g3djLoader.loadModel(ForgE.files.internal("raw/models/test.g3db"));
modelInstance = new ModelInstance(model);
modelInstance.calculateBoundingBox(bounds);
camera.position.set(1, 1, 1).nor().scl(bounds.getDimensions(tmpV1).len() * 1.75f + bounds.getCenter(tmpV2).len());
camera.up.set(0, 1, 0);
camera.lookAt(0, 0, 0);
camera.far = 50f + bounds.getDimensions(tmpV1).len() * 3.0f;
camera.update(true);
}
开发者ID:macbury,项目名称:ForgE,代码行数:28,代码来源:TestModelsScreen.java
示例7: loadModelData
import com.badlogic.gdx.assets.loaders.ModelLoader; //导入依赖的package包/类
@Override
public ModelData loadModelData(FileHandle fileHandle, ModelLoader.ModelParameters parameters) {
return parseModel(fileHandle);
}
开发者ID:mbrlabs,项目名称:Mundus,代码行数:5,代码来源:MG3dModelLoader.java
示例8: Rocket
import com.badlogic.gdx.assets.loaders.ModelLoader; //导入依赖的package包/类
public Rocket() {
// init graphic
ModelLoader loader = new ObjLoader();
model = loader.loadModel(Gdx.files.internal("models/rocket.obj"), new ObjLoader.ObjLoaderParameters(true));
rocketModelInstance = new ModelInstance(model);
ModelBuilder modelBuilder = new ModelBuilder();
final long attributes = VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal;
// damage shield
Material shieldMaterial = new Material();
shieldMaterial.set(ColorAttribute.createDiffuse(0, 0.3f, 1, 0.5f));
shieldMaterial.set(ColorAttribute.createSpecular(1, 1, 1, 1f));
shieldMaterial.set(new BlendingAttribute(1f));
Model shieldModel = modelBuilder.createSphere(4, 4, 4, 32, 32, shieldMaterial, attributes);
shieldModelInstance = new ModelInstance(shieldModel);
Material tractorBeamMaterial = new Material();
tractorBeamMaterial.set(ColorAttribute.createDiffuse(0, 0, 1, 1));
tractorBeamMaterial.set(ColorAttribute.createSpecular(1, 1, 1, 1f));
tractorBeamMaterial.set(new BlendingAttribute(0.1f));
Model tractorBeamModel = modelBuilder.createSphere(5, 5, 5, 32, 32, tractorBeamMaterial, attributes);
tractorBeamModelInstance = new ModelInstance(tractorBeamModel);
// init physic
//BoundingBox boundingBox = new BoundingBox();
//model.calculateBoundingBox(boundingBox);
//btCollisionShape shape = new btBoxShape(boundingBox.getDimensions(new Vector3()).scl(0.5f));
btCollisionShape shape = new btBoxShape(new Vector3(1, 1, 1));
rocketModelInstance.transform.setToRotation(0, 0, 1, 0);
rocketModelInstance.transform.trn(START_POSITION);
float mass = 1;
addRigidBody(shape, mass, SpaceShipProperties.properties.getLandslide(), CollisionTypes.ROCKET.mask,
new RocketMotionState(rocketModelInstance.transform));
rigidBodyList.get(0).setActivationState(4); // disable deactivation
rigidBodyList.get(0).setLinearVelocity(tmpMovement.set(getDirection()).nor().scl(
SpaceShipProperties.properties.getEnginePower()));
thrustSound = App.audioController.getSound("thrust.wav");
if (App.config.playAudio) {
thrustSound.loop();
thrustSound.play();
}
}
开发者ID:aphex-,项目名称:Alien-Ark,代码行数:48,代码来源:Rocket.java
示例9: loadModelData
import com.badlogic.gdx.assets.loaders.ModelLoader; //导入依赖的package包/类
@Override
public ModelData loadModelData (FileHandle fileHandle, ModelLoader.ModelParameters parameters) {
return parseModel(fileHandle);
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:5,代码来源:G3dModelLoader.java
注:本文中的com.badlogic.gdx.assets.loaders.ModelLoader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论