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));
}
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));
}
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));
}
Aggregations