Search in sources :

Example 1 with Transformation

use of net.modificationstation.stationapi.api.client.render.model.json.Transformation in project StationAPI by ModificationStation.

the class ModelHelper method makeTransform.

/**
 * The vanilla model transformation logic is closely coupled with model deserialization.
 * That does little good for modded model loaders and procedurally generated models.
 * This convenient construction method applies the same scaling factors used for vanilla models.
 * This means you can use values from a vanilla JSON file as inputs to this method.
 */
private static Transformation makeTransform(float rotationX, float rotationY, @SuppressWarnings("SameParameterValue") float rotationZ, @SuppressWarnings("SameParameterValue") float translationX, float translationY, @SuppressWarnings("SameParameterValue") float translationZ, float scaleX, float scaleY, float scaleZ) {
    Vector3f translation = new Vector3f(translationX, translationY, translationZ);
    translation.scale(0.0625f);
    translation.clamp(-5.0F, 5.0F);
    return new Transformation(new Vector3f(rotationX, rotationY, rotationZ), translation, new Vector3f(scaleX, scaleY, scaleZ));
}
Also used : Transformation(net.modificationstation.stationapi.api.client.render.model.json.Transformation) ModelTransformation(net.modificationstation.stationapi.api.client.render.model.json.ModelTransformation) Vector3f(net.modificationstation.stationapi.api.util.math.Vector3f)

Aggregations

ModelTransformation (net.modificationstation.stationapi.api.client.render.model.json.ModelTransformation)1 Transformation (net.modificationstation.stationapi.api.client.render.model.json.Transformation)1 Vector3f (net.modificationstation.stationapi.api.util.math.Vector3f)1