use ffi::config::*;
use math::Matrix4x4;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ComponentType {
Normals,
TangentsAndBitangents,
Colors,
TexCoords,
BoneWeights,
Animations,
Textures,
Lights,
Cameras,
Meshes,
Materials
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum UVTransformFlag {
Scaling,
Rotation,
Translation,
All
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum PrimitiveType {
Point,
Line,
Triangle,
Polygon
}
macro_rules! struct_with_defaults {
($(#[$struct_attr:meta])* struct $i:ident {
$($(#[$field_attr:meta])* pub $n:ident: $t:ty = $v:expr),*
}) => (
$(#[$struct_attr])*
pub struct $i {
/// Whether to enable the step. Default: false
pub enable: bool,
$($(#[$field_attr])* pub $n: $t),*
}
impl Default for $i {
fn default() -> $i {
$i {
enable: false,
$($n: $v),*
}
}
}
)
}
struct_with_defaults! {
struct CalcTangentSpace {
pub max_smoothing_angle: f32 = 45.0,
pub texture_channel: i32 = 0
}
}
struct_with_defaults! {
struct RemoveComponent {
pub components: Vec<ComponentType> = Vec::new()
}
}
struct_with_defaults! {
struct GenerateNormals {
pub smooth: bool = false,
pub max_smoothing_angle: f32 = 175.0
}
}
struct_with_defaults! {
struct SplitLargeMeshes {
pub vertex_limit: i32 = AI_SLM_DEFAULT_MAX_VERTICES,
pub triangle_limit: i32 = AI_SLM_DEFAULT_MAX_TRIANGLES
}
}
struct_with_defaults! {
struct PreTransformVertices {
pub keep_hierarchy: bool = false,
pub normalize: bool = false,
pub add_root_transformation: bool = false,
pub root_transformation: Matrix4x4 = Matrix4x4::new(1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0)
}
}
struct_with_defaults! {
struct LimitBoneWeights {
pub max_weights: i32 = AI_LMW_MAX_WEIGHTS
}
}
struct_with_defaults! {
struct ImproveCacheLocality {
pub cache_size: i32 = PP_ICL_DEFAULT_PTCACHE_SIZE
}
}
struct_with_defaults! {
struct RemoveRedundantMaterials {
pub exclude_list: String = String::new()
}
}
struct_with_defaults! {
struct SortByPrimitiveType {
pub remove: Vec<PrimitiveType> = Vec::new()
}
}
struct_with_defaults! {
struct FindDegenerates {
pub remove: bool = false
}
}
struct_with_defaults! {
struct FindInvalidData {
pub accuracy: f32 = 0.0
}
}
struct_with_defaults! {
struct TransformUVCoords {
pub flags: Vec<UVTransformFlag> = vec![UVTransformFlag::All]
}
}
struct_with_defaults! {
struct OptimizeGraph {
pub exclude_list: String = String::new()
}
}
struct_with_defaults! {
struct SplitByBoneCount {
pub max_bones: i32 = AI_SBBC_DEFAULT_MAX_BONES
}
}
struct_with_defaults! {
struct Debone {
pub threshold: f32 = AI_DEBONE_THRESHOLD,
pub all_or_none: bool = false
}
}