Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.shade.decima.ui.data.viewer.model.dmf;

import com.shade.decima.ui.data.viewer.model.dmf.nodes.DMFNode;

public record DMFInstanceSource(String uuid, DMFNode rootNode) {
Comment thread
REDxEYE marked this conversation as resolved.
Outdated
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.shade.decima.ui.data.viewer.model.dmf;

import com.shade.decima.ui.data.viewer.model.dmf.nodes.DMFNode;
import com.shade.util.NotNull;
import com.shade.util.Nullable;

Expand All @@ -17,7 +18,7 @@ public class DMFSceneFile {
public final List<DMFBuffer> buffers;
public final List<DMFMaterial> materials;
public final List<DMFTexture> textures;
public final List<DMFNode> instances;
public final List<DMFInstanceSource> instances;

public DMFSceneFile(int version) {
metadata = new DMFSceneMetaData("%s (%s, %s)".formatted(APP_TITLE, APP_VERSION, BUILD_COMMIT), version);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.shade.decima.ui.data.viewer.model.dmf.nodes;

import com.shade.decima.ui.data.viewer.model.dmf.DMFTransform;
import com.shade.util.NotNull;

public class DMFAttachment extends DMFNode {
public final String boneName;

public DMFAttachment(@NotNull String name, @NotNull String boneName, @NotNull DMFTransform transform) {
super(name, DMFNodeType.ATTACHMENT);
this.boneName = boneName;
this.transform = transform;
}

@Override
public boolean isEmpty() {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shade.decima.ui.data.viewer.model.dmf;
package com.shade.decima.ui.data.viewer.model.dmf.nodes;

import com.shade.util.NotNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shade.decima.ui.data.viewer.model.dmf;
package com.shade.decima.ui.data.viewer.model.dmf.nodes;


import com.shade.util.NotNull;
Expand All @@ -10,4 +10,9 @@ public DMFInstance(@NotNull String name, int instanceId) {
super(name, DMFNodeType.INSTANCE);
this.instanceId = instanceId;
}

@Override
public boolean isEmpty() {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shade.decima.ui.data.viewer.model.dmf;
package com.shade.decima.ui.data.viewer.model.dmf.nodes;

import com.shade.util.NotNull;

Expand All @@ -17,4 +17,9 @@ public void addLod(@NotNull DMFNode model, float distance) {
}

public record Lod(@NotNull DMFNode model, int id, float distance) {}

@Override
public boolean isEmpty() {
return super.isEmpty() && lods.isEmpty();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.shade.decima.ui.data.viewer.model.dmf.nodes;

import com.shade.util.NotNull;

import java.util.HashMap;
import java.util.Map;

public class DMFMapTile extends DMFNode {
public int[] gridCoordinate;
public float[] bboxMin;
public float[] bboxMax;
public Map<String, DMFMapTile.TileTextureInfo> textures = new HashMap<>();

public DMFMapTile(@NotNull String name) {
super(name, DMFNodeType.MAP_TILE);
}

public static final class TileTextureInfo {
Comment thread
REDxEYE marked this conversation as resolved.
Outdated
public final Map<String, TileTextureChannelInfo> channels = new HashMap<>();
public Integer textureId = null;

public static class TileTextureChannelInfo {
public String usage;
public float minRange;
public float maxRange;

public TileTextureChannelInfo(String usage, float minRange, float maxRange) {
this.usage = usage;
this.minRange = minRange;
this.maxRange = maxRange;
}
}
}
Comment thread
REDxEYE marked this conversation as resolved.
Outdated
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.shade.decima.ui.data.viewer.model.dmf;
package com.shade.decima.ui.data.viewer.model.dmf.nodes;


import com.shade.decima.ui.data.viewer.model.dmf.DMFMesh;
import com.shade.decima.ui.data.viewer.model.dmf.DMFSceneFile;
import com.shade.decima.ui.data.viewer.model.dmf.DMFSkeleton;
import com.shade.util.NotNull;

public class DMFModel extends DMFNode {
Expand All @@ -17,4 +20,9 @@ public void setSkeleton(@NotNull DMFSkeleton skeleton, @NotNull DMFSceneFile sce
scene.skeletons.add(skeleton);
skeletonId = scene.skeletons.indexOf(skeleton);
}

@Override
public boolean isEmpty() {
return super.isEmpty() && (mesh == null || mesh.primitives.isEmpty());
}
Comment thread
REDxEYE marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shade.decima.ui.data.viewer.model.dmf;
package com.shade.decima.ui.data.viewer.model.dmf.nodes;

import com.shade.util.NotNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.shade.decima.ui.data.viewer.model.dmf;
package com.shade.decima.ui.data.viewer.model.dmf.nodes;

import com.shade.decima.ui.data.viewer.model.dmf.DMFCollection;
import com.shade.decima.ui.data.viewer.model.dmf.DMFSceneFile;
import com.shade.decima.ui.data.viewer.model.dmf.DMFTransform;
import com.shade.util.NotNull;

import java.util.ArrayList;
Expand All @@ -25,4 +28,8 @@ protected DMFNode(@NotNull String name, @NotNull DMFNodeType type) {
public void addToCollection(@NotNull DMFCollection collection, @NotNull DMFSceneFile scene) {
collectionIds.add(scene.collections.indexOf(collection));
}

public boolean isEmpty() {
return children.isEmpty();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shade.decima.ui.data.viewer.model.dmf;
package com.shade.decima.ui.data.viewer.model.dmf.nodes;


public enum DMFNodeType {
Expand All @@ -9,4 +9,5 @@ public enum DMFNodeType {
MODEL,
SKINNED_MODEL,
ATTACHMENT,
MAP_TILE,
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ public Quaternion(@NotNull double[] xyzw) {
this(xyzw[0], xyzw[1], xyzw[2], xyzw[3]);
}

@NotNull
public static Quaternion identity() {
return new Quaternion(0, 0, 0, 1);
}

@NotNull
public Quaternion add(@NotNull Quaternion other) {
return new Quaternion(x() + other.x(), y() + other.y(), z() + other.y(), w() + other.w());
Expand Down