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

@ -651,6 +651,13 @@ register_on_gizmo_rotate_callback(canvas, callback)
CODE:
_3DScene::register_on_gizmo_rotate_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_gizmo_rotate_3D_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_gizmo_rotate_3D_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_gizmo_flatten_callback(canvas, callback)
SV *canvas;
@ -658,6 +665,13 @@ register_on_gizmo_flatten_callback(canvas, callback)
CODE:
_3DScene::register_on_gizmo_flatten_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_gizmo_flatten_3D_callback(canvas, callback)
SV *canvas;
SV *callback;
CODE:
_3DScene::register_on_gizmo_flatten_3D_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
void
register_on_update_geometry_info_callback(canvas, callback)
SV *canvas;

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