Core: Use Math namespace for constants
This commit is contained in:
parent
06c71fbf40
commit
94282d88f9
181 changed files with 812 additions and 818 deletions
|
|
@ -1372,7 +1372,7 @@ Collada::Node *Collada::_parse_visual_instance_camera(XMLParser &p_parser) {
|
|||
cam->camera = _uri_to_id(p_parser.get_named_attribute_value_safe("url"));
|
||||
|
||||
if (state.up_axis == Vector3::AXIS_Z) { //collada weirdness
|
||||
cam->post_transform.basis.rotate(Vector3(1, 0, 0), -Math_PI * 0.5);
|
||||
cam->post_transform.basis.rotate(Vector3(1, 0, 0), -Math::PI * 0.5);
|
||||
}
|
||||
|
||||
if (p_parser.is_empty()) { //nothing else to parse...
|
||||
|
|
@ -1393,7 +1393,7 @@ Collada::Node *Collada::_parse_visual_instance_light(XMLParser &p_parser) {
|
|||
cam->light = _uri_to_id(p_parser.get_named_attribute_value_safe("url"));
|
||||
|
||||
if (state.up_axis == Vector3::AXIS_Z) { //collada weirdness
|
||||
cam->post_transform.basis.rotate(Vector3(1, 0, 0), -Math_PI * 0.5);
|
||||
cam->post_transform.basis.rotate(Vector3(1, 0, 0), -Math::PI * 0.5);
|
||||
}
|
||||
|
||||
if (p_parser.is_empty()) { //nothing else to parse...
|
||||
|
|
|
|||
|
|
@ -826,7 +826,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, HashMap<R
|
|||
SeparationRayShape3D *rayShape = memnew(SeparationRayShape3D);
|
||||
rayShape->set_length(1);
|
||||
colshape->set_shape(rayShape);
|
||||
Object::cast_to<Node3D>(sb)->rotate_x(Math_PI / 2);
|
||||
Object::cast_to<Node3D>(sb)->rotate_x(Math::PI / 2);
|
||||
} else if (empty_draw_type == "IMAGE") {
|
||||
WorldBoundaryShape3D *world_boundary_shape = memnew(WorldBoundaryShape3D);
|
||||
colshape->set_shape(world_boundary_shape);
|
||||
|
|
|
|||
|
|
@ -512,7 +512,7 @@ Transform3D ResourceImporterScene::get_collision_shapes_transform(const M &p_opt
|
|||
}
|
||||
|
||||
if (p_options.has(SNAME("primitive/rotation"))) {
|
||||
transform.basis = Basis::from_euler(p_options[SNAME("primitive/rotation")].operator Vector3() * (Math_PI / 180.0));
|
||||
transform.basis = Basis::from_euler(p_options[SNAME("primitive/rotation")].operator Vector3() * (Math::PI / 180.0));
|
||||
}
|
||||
}
|
||||
return transform;
|
||||
|
|
|
|||
|
|
@ -744,8 +744,8 @@ void SceneImportSettingsDialog::open_settings(const String &p_path, const String
|
|||
selected_id = "";
|
||||
selected_type = "";
|
||||
|
||||
cam_rot_x = -Math_PI / 4;
|
||||
cam_rot_y = -Math_PI / 4;
|
||||
cam_rot_x = -Math::PI / 4;
|
||||
cam_rot_y = -Math::PI / 4;
|
||||
cam_zoom = 1;
|
||||
|
||||
{
|
||||
|
|
@ -1204,7 +1204,7 @@ void SceneImportSettingsDialog::_viewport_input(const Ref<InputEvent> &p_input)
|
|||
if (mm.is_valid() && (mm->get_button_mask().has_flag(MouseButtonMask::LEFT))) {
|
||||
(*rot_x) -= mm->get_relative().y * 0.01 * EDSCALE;
|
||||
(*rot_y) -= mm->get_relative().x * 0.01 * EDSCALE;
|
||||
(*rot_x) = CLAMP((*rot_x), -Math_PI / 2, Math_PI / 2);
|
||||
(*rot_x) = CLAMP((*rot_x), -Math::PI / 2, Math::PI / 2);
|
||||
_update_camera();
|
||||
}
|
||||
if (mm.is_valid() && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_CURSOR_SHAPE)) {
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ class SceneImportSettingsDialog : public ConfirmationDialog {
|
|||
TreeItem *mesh_node = nullptr;
|
||||
TreeItem *material_node = nullptr;
|
||||
|
||||
float cam_rot_x = -Math_PI / 4;
|
||||
float cam_rot_y = -Math_PI / 4;
|
||||
float cam_rot_x = -Math::PI / 4;
|
||||
float cam_rot_y = -Math::PI / 4;
|
||||
float cam_zoom = 1;
|
||||
|
||||
HashMap<StringName, Variant> settings;
|
||||
|
|
@ -143,8 +143,8 @@ class SceneImportSettingsDialog : public ConfirmationDialog {
|
|||
TreeItem *scene_node = nullptr;
|
||||
TreeItem *mesh_node = nullptr;
|
||||
|
||||
float cam_rot_x = -Math_PI / 4;
|
||||
float cam_rot_y = -Math_PI / 4;
|
||||
float cam_rot_x = -Math::PI / 4;
|
||||
float cam_rot_y = -Math::PI / 4;
|
||||
float cam_zoom = 1;
|
||||
HashMap<StringName, Variant> settings;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue