1st installment of ModelInstance 3D rotation components

This commit is contained in:
Enrico Turri 2018-09-20 15:00:40 +02:00
parent f1e0dc2dd7
commit 07274589a3
20 changed files with 533 additions and 12 deletions

View file

@ -364,8 +364,13 @@ ModelMaterial::attributes()
Ref<ModelObject> object()
%code%{ RETVAL = THIS->get_object(); %};
#if ENABLE_MODELINSTANCE_3D_ROTATION
double rotation()
%code%{ RETVAL = THIS->get_rotation(Z); %};
#else
double rotation()
%code%{ RETVAL = THIS->rotation; %};
#endif // ENABLE_MODELINSTANCE_3D_ROTATION
double scaling_factor()
%code%{ RETVAL = THIS->scaling_factor; %};
#if ENABLE_MODELINSTANCE_3D_OFFSET
@ -376,8 +381,17 @@ ModelMaterial::attributes()
%code%{ RETVAL = &THIS->offset; %};
#endif // ENABLE_MODELINSTANCE_3D_OFFSET
#if ENABLE_MODELINSTANCE_3D_ROTATION
void set_rotation(double val)
%code%{ THIS->set_rotation(Z, val); THIS->get_object()->invalidate_bounding_box(); %};
void set_rotations(Vec3d *rotation)
%code%{ THIS->set_rotation(*rotation); THIS->get_object()->invalidate_bounding_box(); %};
#else
void set_rotation(double val)
%code%{ THIS->rotation = val; THIS->get_object()->invalidate_bounding_box(); %};
#endif // ENABLE_MODELINSTANCE_3D_ROTATION
void set_scaling_factor(double val)
%code%{ THIS->scaling_factor = val; THIS->get_object()->invalidate_bounding_box(); %};
#if ENABLE_MODELINSTANCE_3D_OFFSET