Simplified some functions.
This commit is contained in:
@@ -141,7 +141,6 @@ public class BombGameEntityCreator extends EntityCreatorBase{
|
|||||||
// Add bombs.
|
// Add bombs.
|
||||||
// parameters.markerCode = 89;
|
// parameters.markerCode = 89;
|
||||||
// addBomb(parameters, bomb_type_t.COMBINATION);
|
// addBomb(parameters, bomb_type_t.COMBINATION);
|
||||||
|
|
||||||
parameters.markerCode = 90;
|
parameters.markerCode = 90;
|
||||||
addBomb(parameters, bomb_type_t.INCLINATION);
|
addBomb(parameters, bomb_type_t.INCLINATION);
|
||||||
parameters.markerCode = 91;
|
parameters.markerCode = 91;
|
||||||
@@ -229,55 +228,43 @@ public class BombGameEntityCreator extends EntityCreatorBase{
|
|||||||
private void addBombInclinationButton(EntityParameters parameters, BombComponent bomb){
|
private void addBombInclinationButton(EntityParameters parameters, BombComponent bomb){
|
||||||
Entity button;
|
Entity button;
|
||||||
|
|
||||||
button = world.createEntity();
|
button = addBombParaphernalia(inclinationBombButtonModel, inclinationBombButtonCollisionModel, bomb, parameters);
|
||||||
button.addComponent(new GeometryComponent(new Vector3(), new Matrix3(), new Vector3(1, 1, 1)));
|
|
||||||
button.addComponent(new EnvironmentComponent(parameters.environment));
|
// TODO: Add button parameters.
|
||||||
button.addComponent(new ShaderComponent(parameters.shader));
|
|
||||||
button.addComponent(new RenderModelComponent(inclinationBombButtonModel));
|
|
||||||
button.addComponent(new CollisionModelComponent(inclinationBombButtonCollisionModel));
|
|
||||||
button.addComponent(new BombComponent(bomb));
|
|
||||||
button.addComponent(new VisibilityComponent());
|
|
||||||
button.addComponent(new MarkerCodeComponent(parameters.markerCode));
|
|
||||||
button.addToWorld();
|
button.addToWorld();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addBombWires(EntityParameters parameters, BombComponent bomb){
|
private void addBombWires(EntityParameters parameters, BombComponent bomb){
|
||||||
Entity wire1, wire2, wire3;
|
Entity wire1, wire2, wire3;
|
||||||
|
|
||||||
wire1 = world.createEntity();
|
wire1 = addBombParaphernalia(wiresBombModelWire1, wiresBombCollisionModelWire1, bomb, parameters);
|
||||||
wire1.addComponent(new GeometryComponent(new Vector3(), new Matrix3(), new Vector3(1, 1, 1)));
|
wire2 = addBombParaphernalia(wiresBombModelWire2, wiresBombCollisionModelWire2, bomb, parameters);
|
||||||
wire1.addComponent(new EnvironmentComponent(parameters.environment));
|
wire3 = addBombParaphernalia(wiresBombModelWire3, wiresBombCollisionModelWire3, bomb, parameters);
|
||||||
wire1.addComponent(new ShaderComponent(parameters.shader));
|
|
||||||
wire1.addComponent(new RenderModelComponent(wiresBombModelWire1));
|
// TODO: Add Wire parameters.
|
||||||
wire1.addComponent(new CollisionModelComponent(wiresBombCollisionModelWire1));
|
|
||||||
wire1.addComponent(new BombComponent(bomb));
|
|
||||||
wire1.addComponent(new VisibilityComponent());
|
|
||||||
wire1.addComponent(new MarkerCodeComponent(parameters.markerCode));
|
|
||||||
wire1.addToWorld();
|
wire1.addToWorld();
|
||||||
|
|
||||||
wire2 = world.createEntity();
|
|
||||||
wire2.addComponent(new GeometryComponent(new Vector3(), new Matrix3(), new Vector3(1, 1, 1)));
|
|
||||||
wire2.addComponent(new EnvironmentComponent(parameters.environment));
|
|
||||||
wire2.addComponent(new ShaderComponent(parameters.shader));
|
|
||||||
wire2.addComponent(new RenderModelComponent(wiresBombModelWire2));
|
|
||||||
wire2.addComponent(new CollisionModelComponent(wiresBombCollisionModelWire2));
|
|
||||||
wire2.addComponent(new BombComponent(bomb));
|
|
||||||
wire2.addComponent(new VisibilityComponent());
|
|
||||||
wire2.addComponent(new MarkerCodeComponent(parameters.markerCode));
|
|
||||||
wire2.addToWorld();
|
wire2.addToWorld();
|
||||||
|
|
||||||
wire3 = world.createEntity();
|
|
||||||
wire3.addComponent(new GeometryComponent(new Vector3(), new Matrix3(), new Vector3(1, 1, 1)));
|
|
||||||
wire3.addComponent(new EnvironmentComponent(parameters.environment));
|
|
||||||
wire3.addComponent(new ShaderComponent(parameters.shader));
|
|
||||||
wire3.addComponent(new RenderModelComponent(wiresBombModelWire3));
|
|
||||||
wire3.addComponent(new CollisionModelComponent(wiresBombCollisionModelWire3));
|
|
||||||
wire3.addComponent(new BombComponent(bomb));
|
|
||||||
wire3.addComponent(new VisibilityComponent());
|
|
||||||
wire3.addComponent(new MarkerCodeComponent(parameters.markerCode));
|
|
||||||
wire3.addToWorld();
|
wire3.addToWorld();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Entity addBombParaphernalia(Model renderModel, Model collisionModel, BombComponent bomb, EntityParameters parameters){
|
||||||
|
Entity thing;
|
||||||
|
|
||||||
|
thing = world.createEntity();
|
||||||
|
thing.addComponent(new GeometryComponent(new Vector3(), new Matrix3(), new Vector3(1, 1, 1)));
|
||||||
|
thing.addComponent(new EnvironmentComponent(parameters.environment));
|
||||||
|
thing.addComponent(new ShaderComponent(parameters.shader));
|
||||||
|
thing.addComponent(new RenderModelComponent(renderModel));
|
||||||
|
thing.addComponent(new CollisionModelComponent(collisionModel));
|
||||||
|
thing.addComponent(new BombComponent(bomb));
|
||||||
|
thing.addComponent(new VisibilityComponent());
|
||||||
|
thing.addComponent(new MarkerCodeComponent(parameters.markerCode));
|
||||||
|
|
||||||
|
return thing;
|
||||||
|
}
|
||||||
|
|
||||||
private void addDoor(EntityParameters parameters){
|
private void addDoor(EntityParameters parameters){
|
||||||
ModelInstance doorInstance;
|
ModelInstance doorInstance;
|
||||||
Entity frame, door;
|
Entity frame, door;
|
||||||
|
Reference in New Issue
Block a user