Cargo Features

[dependencies]
tmf = { version = "0.2.0", default-features = false, features = ["triangulation", "fast_trig", "double_precision", "long_indices", "short_indices", "byte_rw", "model_importer", "obj_import", "tokio_runtime"] }
default = obj_import

The obj_import feature is set by default whenever tmf is added without default-features = false somewhere in the dependency tree.

triangulation

Experimental triangulation in .obj loader. Supports only convex polygons ATM, and has bugs, triangulating your mesh in 3D modelling software before importing highly advised. Please note that if you see any triangles missing this is likely the result of the triangulation algorithm not working properly.

fast_trig

Changes the sin and cos function used in reading the tmf files for a potentially faster, but less accurate functions.

double_precision

Changes the precision of read data from single to double point precision.

Affects tmf::FloatType

long_indices

Changes the index format to long(u64) in order to support reading models with over 2^32 - 1 points, at cost of increased memory footprint.

Affects tmf::IndexType

short_indices

Changes the index format to short(u16), decreasng memory footprint, but limiting max model vertex count to 2^16 - 1(65535).

Affects tmf::IndexType

byte_rw

Changes the internal setting of the unaligned reader to use different data size. Can be beneficial for small models on some systems.

model_importer obj_import
obj_import default = model_importer

Adds the ability to import/export .obj files.

tokio_runtime = lazy_static, tokio

Use the tokio runtime, significantly increasing performance of synchronous loads, at the cost of minor compile time increase.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

! Test

lazy_static tokio_runtime?
tokio tokio_runtime?