-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # vitrivr-engine-plugin-features/src/main/kotlin/org/vitrivr/engine/base/features/external/implementations/clip/CLIP.kt # vitrivr-engine-plugin-features/src/main/kotlin/org/vitrivr/engine/base/features/external/implementations/dino/DINO.kt # vitrivr-engine-server/src/main/kotlin/org/vitrivr/engine/server/api/rest/handlers/Query.kt
- Loading branch information
Showing
73 changed files
with
9,905 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
version_caffeine=3.1.8 | ||
version_clikt=4.2.0 | ||
version_commonsmath3=3.6.1 | ||
version_cottontaildb=0.16.1 | ||
version_jackson_kotlin=2.15.2 | ||
version_javacv=1.5.9 | ||
version_javalin=5.6.3 | ||
version_jline=3.23.0 | ||
version_junit=5.10.1 | ||
version_junit_platform=1.10.1 | ||
version_grpc=1.60.0 | ||
version_kotlin=1.9.21 | ||
version_kotlinx_coroutines=1.7.3 | ||
version_kotlinx_serialization=1.6.2 | ||
version_kotlinlogging = 5.1.0 | ||
version_log4j2=2.20.0 | ||
version_picnic=0.7.0 | ||
version_protobuf=3.25.1 | ||
version_scrimage=4.1.1 | ||
version_slf4j=2.0.9 | ||
version_slf4j=2.0.9 | ||
version_jogl=2.3.2 | ||
version_joml=1.9.25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...gine-core/src/main/kotlin/org/vitrivr/engine/core/model/content/element/Model3DContent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.vitrivr.engine.core.model.content.element | ||
|
||
import org.vitrivr.engine.core.model.mesh.Model3D | ||
|
||
/** | ||
* A 3D [ContentElement]. | ||
* | ||
* @author Rahel Arnold | ||
* @version 1.0.0 | ||
*/ | ||
interface Model3DContent: ContentElement<Model3D> |
174 changes: 174 additions & 0 deletions
174
vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/mesh/Entity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
package org.vitrivr.engine.core.model.mesh | ||
|
||
import org.apache.logging.log4j.LogManager | ||
import org.joml.Matrix4f | ||
import org.joml.Quaternionf | ||
import org.joml.Vector3f | ||
|
||
/** | ||
* An Entity in the context of a [Model3D] describes a position and scale of a model in the scene. | ||
* The Entity is composed of a model matrix that is used to transform the model in the scene. | ||
* The model matrix is calculated from the position, rotation and scale of the entity. | ||
* The Entity influences how the model is rendered in the scene. | ||
* It does not change the mesh of the model. | ||
* Neither does it change the viewpoint of the camera. | ||
*/ | ||
class Entity( | ||
/** | ||
* ID of entity. | ||
*/ | ||
private val id: String, | ||
/** | ||
* ID of associated model. | ||
*/ | ||
private val modelId: String | ||
) { | ||
private val LOGGER = LogManager.getLogger() | ||
|
||
/** | ||
* Model matrix of entity. | ||
* Used to transform the model in the scene. | ||
* Calculated from position, rotation and scale. | ||
*/ | ||
private val modelMatrix: Matrix4f = Matrix4f() | ||
|
||
/** | ||
* Position of entity. | ||
*/ | ||
private val position: Vector3f = Vector3f() | ||
|
||
/** | ||
* Rotation of entity. | ||
*/ | ||
private val rotation: Quaternionf = Quaternionf() | ||
|
||
/** | ||
* Scale of entity. | ||
*/ | ||
private var scale: Float = 1f | ||
|
||
/** | ||
* Constructs a new Entity. | ||
* Defines an associated model and an id. | ||
* With associated model one is able to add new transformations to the Scene [GLScene.addEntity]. | ||
* | ||
* @param id ID of entity. | ||
* @param modelId ID of associated model. | ||
*/ | ||
init { | ||
this.updateModelMatrix() | ||
} | ||
|
||
/** | ||
* @return Unique ID of entity. | ||
*/ | ||
fun getId(): String { | ||
return this.id | ||
} | ||
|
||
/** | ||
* @return ID of the associated model. | ||
*/ | ||
fun getModelId(): String { | ||
return this.modelId | ||
} | ||
|
||
/** | ||
* @return Model matrix of entity, describes a rigid transformation of the Model. | ||
*/ | ||
fun getModelMatrix(): Matrix4f { | ||
return this.modelMatrix | ||
} | ||
|
||
/** | ||
* Translation values, contained in the ModelMatrix | ||
* @return Translate position of entity in x, y, z. | ||
*/ | ||
fun getPosition(): Vector3f { | ||
return this.position | ||
} | ||
|
||
/** | ||
* Rotation values, contained in the ModelMatrix | ||
* @return Rotation around x,y,z axes as a quaternion. | ||
*/ | ||
fun getRotation(): Quaternionf { | ||
return this.rotation | ||
} | ||
|
||
/** | ||
* Scale value, contained in the ModelMatrix | ||
* Scales the associated model. 1.0f is no scaling. | ||
* @return Scale value. | ||
*/ | ||
fun getScale(): Float { | ||
return this.scale | ||
} | ||
|
||
/** | ||
* Sets the as a translation vector from the origin. | ||
* @param x X coordinate of position. | ||
* @param y Y coordinate of position. | ||
* @param z Z coordinate of position. | ||
*/ | ||
fun setPosition(x: Float, y: Float, z: Float) { | ||
this.position.set(x, y, z) | ||
} | ||
|
||
/** | ||
* Sets translation vector from the origin. | ||
* @param position Position of entity. | ||
*/ | ||
fun setPosition(position: Vector3f) { | ||
this.position.set(position) | ||
} | ||
|
||
/** | ||
* Sets the rotation of the entity. | ||
* @param x X coordinate of axis. | ||
* @param y Y coordinate of axis. | ||
* @param z Z coordinate of axis. | ||
* @param angle Angle of rotation. | ||
*/ | ||
fun setRotation(x: Float, y: Float, z: Float, angle: Float) { | ||
this.rotation.setAngleAxis(angle, x, y, z) | ||
} | ||
|
||
/** | ||
* Sets the rotation of the entity. | ||
* @param axis Axis of rotation. | ||
* @param angle Angle of rotation. | ||
*/ | ||
fun setRotation(axis: Vector3f, angle: Float) { | ||
rotation.fromAxisAngleRad(axis, angle) | ||
} | ||
|
||
/** | ||
* Sets the scale of the entity. | ||
* set to 1 for no scaling. | ||
* @param scale Scale of entity. | ||
*/ | ||
fun setScale(scale: Float) { | ||
this.scale = scale | ||
} | ||
|
||
/** | ||
* Updates the model matrix of the entity. | ||
* @implSpec This has to be called after any transformation. | ||
*/ | ||
private fun updateModelMatrix() { | ||
this.modelMatrix.translationRotateScale(this.position, this.rotation, this.scale) | ||
} | ||
|
||
/** | ||
* Closes the entity. | ||
* Sets the position, rotation to zero and scale to 1. | ||
*/ | ||
fun close() { | ||
this.position.zero() | ||
this.rotation.identity() | ||
this.scale = 1f | ||
this.updateModelMatrix() | ||
LOGGER.trace("Entity {} closed", this.id) | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/mesh/IModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.vitrivr.engine.core.model.mesh | ||
|
||
import org.joml.Vector3f | ||
|
||
/** | ||
* | ||
*/ | ||
interface IModel { | ||
/** The identifier of this [IModel] within the scene. */ | ||
val id: String | ||
|
||
/** | ||
* Adds an entity to the model. | ||
* @param entity Entity to be added. | ||
*/ | ||
fun addEntity(entity: Entity) | ||
|
||
/** | ||
* Returns a list of all entities that are associated with this model. | ||
* | ||
* @return List of [Entity] objects. | ||
*/ | ||
fun getEntities(): List<Entity> | ||
|
||
/** | ||
* Returns a list of all materials that are associated with this model. | ||
* | ||
* @return List of [Material] objects. | ||
*/ | ||
fun getMaterials(): List<Material> | ||
|
||
/** | ||
* Returns a list of all vertex normals that are associated with this model. | ||
* | ||
* @return List of [Vector3f]. | ||
*/ | ||
fun getAllNormals(): List<Vector3f> | ||
} |
Oops, something went wrong.