mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Core: Use Math
namespace for constants
This commit is contained in:
parent
06c71fbf40
commit
94282d88f9
181 changed files with 812 additions and 818 deletions
|
@ -186,8 +186,8 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh
|
|||
Vector3 ofs = aabb.get_center();
|
||||
aabb.position -= ofs;
|
||||
Transform3D xform;
|
||||
xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math_PI / 6);
|
||||
xform.basis = Basis().rotated(Vector3(1, 0, 0), Math_PI / 6) * xform.basis;
|
||||
xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math::PI / 6);
|
||||
xform.basis = Basis().rotated(Vector3(1, 0, 0), Math::PI / 6) * xform.basis;
|
||||
AABB rot_aabb = xform.xform(aabb);
|
||||
float m = MAX(rot_aabb.size.x, rot_aabb.size.y) * 0.5;
|
||||
if (m == 0) {
|
||||
|
@ -282,8 +282,8 @@ void EditorInterface::make_scene_preview(const String &p_path, Node *p_scene, in
|
|||
Vector3 center = scene_aabb.get_center();
|
||||
float camera_size = scene_aabb.get_longest_axis_size();
|
||||
|
||||
const float cam_rot_x = -Math_PI / 4;
|
||||
const float cam_rot_y = -Math_PI / 4;
|
||||
const float cam_rot_x = -Math::PI / 4;
|
||||
const float cam_rot_y = -Math::PI / 4;
|
||||
|
||||
camera->set_orthogonal(camera_size * 2.0, 0.0001, camera_size * 2.0);
|
||||
|
||||
|
@ -295,8 +295,8 @@ void EditorInterface::make_scene_preview(const String &p_path, Node *p_scene, in
|
|||
camera->set_transform(xf);
|
||||
|
||||
Transform3D xform;
|
||||
xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math_PI / 6);
|
||||
xform.basis = Basis().rotated(Vector3(1, 0, 0), Math_PI / 6) * xform.basis;
|
||||
xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math::PI / 6);
|
||||
xform.basis = Basis().rotated(Vector3(1, 0, 0), Math::PI / 6) * xform.basis;
|
||||
|
||||
light->set_transform(xform * Transform3D().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0)));
|
||||
light2->set_transform(xform * Transform3D().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue