Search in sources :

Example 6 with ModelTexture

use of com.chrisali.javaflightsim.lwjgl.textures.ModelTexture in project j6dof-flight-sim by chris-ali.

the class EntityCollections method createStaticEntity.

/**
 * Creates a single static entity based on the position vector specified
 *
 * @param entityName
 * @param position
 * @param xRot
 * @param yRot
 * @param zRot
 * @param scale
 */
public void createStaticEntity(String entityName, Vector3f position, float xRot, float yRot, float zRot, float scale) {
    logger.debug("Generating a(n)" + entityName + " at: (" + position.x + ", " + position.y + ", " + position.z + ")...");
    TexturedModel staticEntity = new TexturedModel(OBJLoader.loadObjModel(entityName, OTWDirectories.ENTITIES.toString(), loader), new ModelTexture(loader.loadTexture(entityName, OTWDirectories.ENTITIES.toString())));
    miscStaticEntities.add(new Entity(staticEntity, position, xRot, yRot, zRot, scale));
}
Also used : TexturedModel(com.chrisali.javaflightsim.lwjgl.models.TexturedModel) ModelTexture(com.chrisali.javaflightsim.lwjgl.textures.ModelTexture)

Example 7 with ModelTexture

use of com.chrisali.javaflightsim.lwjgl.textures.ModelTexture in project j6dof-flight-sim by chris-ali.

the class EntityCollections method createStaticEntity.

/**
 * Creates a single static entity based on the X and Z coordinates specified; the Y coordinate is the height of the terrain
 * at the given X and Z coordinates
 *
 * @param entityName
 * @param xPos
 * @param zPos
 * @param yRot
 * @param scale
 */
public void createStaticEntity(String entityName, float xPos, float zPos, float yRot, float scale) {
    TexturedModel staticEntity = new TexturedModel(OBJLoader.loadObjModel(entityName, OTWDirectories.ENTITIES.toString(), loader), new ModelTexture(loader.loadTexture(entityName, OTWDirectories.ENTITIES.toString())));
    float yPos = Terrain.getCurrentTerrain(terrainTree, xPos, zPos).getTerrainHeight(xPos, zPos);
    logger.debug("Generating a(n)" + entityName + " at: (" + xPos + ", " + yPos + ", " + zPos + ")...");
    Vector3f position = new Vector3f(xPos, yPos, zPos);
    miscStaticEntities.add(new Entity(staticEntity, position, 0, yRot, 0, scale));
}
Also used : TexturedModel(com.chrisali.javaflightsim.lwjgl.models.TexturedModel) Vector3f(org.lwjgl.util.vector.Vector3f) ModelTexture(com.chrisali.javaflightsim.lwjgl.textures.ModelTexture)

Example 8 with ModelTexture

use of com.chrisali.javaflightsim.lwjgl.textures.ModelTexture in project j6dof-flight-sim by chris-ali.

the class EntityCollections method createStaticEntity.

/**
 * Creates a single static entity based on the player's position
 *
 * @param entityName
 * @param player
 * @param scale
 */
public void createStaticEntity(String entityName, Player player, float scale) {
    logger.debug("Generating a(n)" + entityName + " at the ownship's postion: (" + player.getPosition().x + ", " + player.getPosition().y + ", " + player.getPosition().z + ")...");
    TexturedModel staticEntity = new TexturedModel(OBJLoader.loadObjModel(entityName, OTWDirectories.ENTITIES.toString(), loader), new ModelTexture(loader.loadTexture(entityName, OTWDirectories.ENTITIES.toString())));
    miscStaticEntities.add(new Entity(staticEntity, player.getPosition(), player.getRotX(), player.getRotY(), player.getRotZ(), scale));
}
Also used : TexturedModel(com.chrisali.javaflightsim.lwjgl.models.TexturedModel) ModelTexture(com.chrisali.javaflightsim.lwjgl.textures.ModelTexture)

Aggregations

ModelTexture (com.chrisali.javaflightsim.lwjgl.textures.ModelTexture)8 TexturedModel (com.chrisali.javaflightsim.lwjgl.models.TexturedModel)7 Vector3f (org.lwjgl.util.vector.Vector3f)4 SoundCollection (com.chrisali.javaflightsim.lwjgl.audio.SoundCollection)1 Camera (com.chrisali.javaflightsim.lwjgl.entities.Camera)1 EntityCollections (com.chrisali.javaflightsim.lwjgl.entities.EntityCollections)1 Light (com.chrisali.javaflightsim.lwjgl.entities.Light)1 Ownship (com.chrisali.javaflightsim.lwjgl.entities.Ownship)1 FontType (com.chrisali.javaflightsim.lwjgl.interfaces.text.FontType)1 SimulationTexts (com.chrisali.javaflightsim.lwjgl.interfaces.text.SimulationTexts)1 RawModel (com.chrisali.javaflightsim.lwjgl.models.RawModel)1 Cloud (com.chrisali.javaflightsim.lwjgl.particles.Cloud)1 ParticleTexture (com.chrisali.javaflightsim.lwjgl.particles.ParticleTexture)1 TerrainCollection (com.chrisali.javaflightsim.lwjgl.terrain.TerrainCollection)1 Random (java.util.Random)1