Skip to content

Commit

Permalink
Merge pull request #2396 from BibliothecaDAO/revert-wonder-model
Browse files Browse the repository at this point in the history
Revert "feat: wonder model"
  • Loading branch information
ponderingdemocritus authored Dec 10, 2024
2 parents 314eb97 + 76936a7 commit f33de42
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 20 deletions.
Binary file removed client/public/models/buildings-opt/wonder.glb
Binary file not shown.
Binary file removed client/public/models/buildings-opt/wonder2.glb
Binary file not shown.
6 changes: 0 additions & 6 deletions client/src/dojo/modelManager/TileManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ export class TileManager {
return (realm?.level || RealmLevels.Settlement) as RealmLevels;
};

getWonder = () => {
const realmEntityId = useUIStore.getState().structureEntityId;
const realm = getComponentValue(this.setup.components.Realm, getEntityIdFromKeys([BigInt(realmEntityId)]));
return realm?.has_wonder || false;
};

existingBuildings = () => {
const builtBuildings = Array.from(
runQuery([
Expand Down
5 changes: 1 addition & 4 deletions client/src/three/components/StructureManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const neutralColor = new THREE.Color(0xffffff);
const myColor = new THREE.Color("lime");

const MAX_INSTANCES = 1000;
const WONDER_MODEL_INDEX = 4;

export class StructureManager {
private scene: THREE.Scene;
private structureModels: Map<StructureType, InstancedModel[]> = new Map();
Expand Down Expand Up @@ -165,9 +165,6 @@ export class StructureManager {
let modelType = models[structure.stage];
if (structureType === StructureType.Realm) {
modelType = models[structure.level];
if (structure.hasWonder) {
modelType = models[WONDER_MODEL_INDEX];
}
}
const currentCount = modelType.getCount();
modelType.setMatrixAt(currentCount, this.dummy.matrix);
Expand Down
6 changes: 1 addition & 5 deletions client/src/three/scenes/Hexception.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
HEX_SIZE,
MinesMaterialsParams,
StructureProgress,
WONDER_REALM,
buildingModelPaths,
castleLevelToRealmCastle,
hyperstructureStageToModel,
Expand Down Expand Up @@ -98,7 +97,7 @@ interface Building {
export default class HexceptionScene extends HexagonScene {
private hexceptionRadius = 4;
private buildingModels: Map<
BuildingType | ResourceMiningTypes | typeof WONDER_REALM,
BuildingType | ResourceMiningTypes,
{ model: THREE.Group; animations: THREE.AnimationClip[] }
> = new Map();
private buildingInstances: Map<string, THREE.Group> = new Map();
Expand Down Expand Up @@ -470,9 +469,6 @@ export default class HexceptionScene extends HexagonScene {

if (parseInt(buildingType) === BuildingType.Castle) {
buildingType = castleLevelToRealmCastle[this.structureStage];
if (this.tileManager.getWonder()) {
buildingType = WONDER_REALM;
}
}
if (building.structureType === StructureType.Hyperstructure) {
buildingType = hyperstructureStageToModel[this.structureStage as StructureProgress];
Expand Down
6 changes: 1 addition & 5 deletions client/src/three/scenes/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ export const hyperstructureStageToModel: Record<StructureProgress, string> = {
[StructureProgress.STAGE_3]: HyperstructureTypesNames.STAGE_3,
};

export const WONDER_REALM = "Wonder";

export const buildingModelPaths: Record<
BuildingType | ResourceMiningTypes | RealmLevelNames | HyperstructureTypesNames | typeof WONDER_REALM,
BuildingType | ResourceMiningTypes | RealmLevelNames | HyperstructureTypesNames,
string
> = {
// placeholder for now
Expand Down Expand Up @@ -72,7 +70,6 @@ export const buildingModelPaths: Record<
[HyperstructureTypesNames.STAGE_1]: "/models/buildings-opt/hyperstructure_init.glb",
[HyperstructureTypesNames.STAGE_2]: "/models/buildings-opt/hyperstructure_half.glb",
[HyperstructureTypesNames.STAGE_3]: "/models/buildings-opt/hyperstructure.glb",
[WONDER_REALM]: "/models/buildings-opt/wonder.glb",
};

const BASE_PATH = "/models/biomes-opt/";
Expand Down Expand Up @@ -105,7 +102,6 @@ export const StructureModelPaths: Record<StructureType, string[]> = {
"models/buildings-opt/castle1.glb",
"models/buildings-opt/castle2.glb",
"models/buildings-opt/castle3.glb",
"models/buildings-opt/wonder2.glb",
],
// Order follows StructureProgress
[StructureType.Hyperstructure]: [
Expand Down

0 comments on commit f33de42

Please sign in to comment.