tirbofish/dropbear · commit
3b8f08e43b03ef03f676ec91ea33eef48220caa5
wip: animation
wip: animation scripting
feature: implemented puffin profiler into dropbear_engine
refactor: completely remade the asset server, with support for typesafe handles instead of using arbitrary values (fixes #87)
refactor: model importing to be able to export in a custom format during production
builds are still not available yet because the other crates are still fucked.
Signature present but could not be verified.
Unverified
@@ -0,0 +1,29 @@ +package com.dropbear.asset.model + +import com.dropbear.math.Vector3f +import com.dropbear.math.Quaternionf + +data class Animation( + val name: String, + val channels: List<AnimationChannel>, + val duration: Float +) + +data class AnimationChannel( + val targetNode: Int, + val times: DoubleArray, + val values: ChannelValues, + val interpolation: AnimationInterpolation +) + +enum class AnimationInterpolation { + LINEAR, + STEP, + CUBICSPLINE +} + +sealed class ChannelValues { + data class Translations(val values: List<Vector3f>) : ChannelValues() + data class Rotations(val values: List<Quaternionf>) : ChannelValues() + data class Scales(val values: List<Vector3f>) : ChannelValues() +} @@ -0,0 +1,24 @@ +package com.dropbear.asset.model + +import com.dropbear.asset.Texture +import com.dropbear.math.Vector2f +import com.dropbear.math.Vector3f +import com.dropbear.math.Vector4f + +data class Material( + val name: String, + val diffuseTexture: Texture, + val normalTexture: Texture, + val tint: Vector4f, + val emissiveFactor: Vector3f, + val metallicFactor: Float, + val roughnessFactor: Float, + val alphaCutoff: Float?, + val doubleSided: Boolean, + val occlusionStrength: Float, + val normalScale: Float, + val uvTiling: Vector2f, + val emissiveTexture: Texture?, + val metallicRoughnessTexture: Texture?, + val occlusionTexture: Texture? +) @@ -0,0 +1,16 @@ +package com.dropbear.asset.model + +import com.dropbear.math.Vector2f +import com.dropbear.math.Vector3f +import com.dropbear.math.Vector4f + +data class ModelVertex( + val position: Vector3f, + val normal: Vector3f, + val tangent: Vector4f, + val texCoords0: Vector2f, + val texCoords1: Vector2f, + val colour0: Vector4f, + val joints0: IntArray, + val weights0: Vector4f +) @@ -0,0 +1,17 @@ +package com.dropbear.asset.model + +import com.dropbear.math.Vector3f +import com.dropbear.math.Quaternionf + +data class NodeTransform( + val translation: Vector3f, + val rotation: Quaternionf, + val scale: Vector3f +) + +data class Node( + val name: String, + val parent: Int?, + val children: List<Int>, + val transform: NodeTransform +) @@ -0,0 +1,8 @@ +package com.dropbear.asset.model + +data class Skin( + val name: String, + val joints: List<Int>, + val inverseBindMatrices: List<DoubleArray>, + val skeletonRoot: Int? +)