mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-24 14:06:23 +01:00
1.16rc2 again?
This commit is contained in:
parent
42e362011d
commit
67834398b4
9 changed files with 23 additions and 21 deletions
Binary file not shown.
|
@ -77,6 +77,8 @@ function __3dCamera() constructor {
|
|||
} #endregion
|
||||
|
||||
static setFocusAngle = function(ax, ay, dist) { #region
|
||||
if(ay % 90 == 0) ay += 0.01;
|
||||
|
||||
focus_angle_x = ax;
|
||||
focus_angle_y = ay;
|
||||
focus_dist = dist;
|
||||
|
@ -101,7 +103,7 @@ function __3dCamera() constructor {
|
|||
} #endregion
|
||||
|
||||
static setCameraLookRotate = function() { #region
|
||||
var _fPos = calculate_3d_position(focus.x, focus.y, focus.z, focus_angle_x, focus_angle_y, focus_dist);
|
||||
var _fPos = d3d_PolarToCart(focus.x, focus.y, focus.z, focus_angle_x, focus_angle_y, focus_dist);
|
||||
position.set(_fPos);
|
||||
} #endregion
|
||||
|
||||
|
|
|
@ -42,9 +42,10 @@ function __3dCamera_object() : __3dObject() constructor {
|
|||
}
|
||||
}
|
||||
|
||||
function calculate_3d_position(camFx, camFy, camFz, camAx, camAy, camDist) {
|
||||
function d3d_PolarToCart(camFx, camFy, camFz, camAx, camAy, camDist) {
|
||||
var pos = new __vec3();
|
||||
|
||||
if(camAy % 90 == 0) camAy += 0.01;
|
||||
var radAx = degtorad(camAx);
|
||||
var radAy = degtorad(camAy);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
var d3_view_camera = new __3dCamera();
|
||||
d3_view_camera.setViewSize(2, 2);
|
||||
d3_view_camera.setFocusAngle(135, 45, 8);
|
||||
d3_view_camera.position.set(calculate_3d_position(0, 0, 0, d3_view_camera.focus_angle_x, d3_view_camera.focus_angle_y, d3_view_camera.focus_dist));
|
||||
d3_view_camera.position.set(d3d_PolarToCart(0, 0, 0, d3_view_camera.focus_angle_x, d3_view_camera.focus_angle_y, d3_view_camera.focus_dist));
|
||||
|
||||
d3_view_camera.projection = CAMERA_PROJECTION.orthograph;
|
||||
d3_view_camera.setMatrix();
|
||||
|
|
|
@ -23,7 +23,7 @@ function dynaSurf_3d() : dynaSurf() constructor {
|
|||
#region view
|
||||
var _pos, _blend = 1;
|
||||
|
||||
_pos = calculate_3d_position(camTarget.x, camTarget.y, camTarget.z, _rot, camera_ay, camera.focus_dist);
|
||||
_pos = d3d_PolarToCart(camTarget.x, camTarget.y, camTarget.z, _rot, camera_ay, camera.focus_dist);
|
||||
|
||||
camera.position.set(_pos);
|
||||
camera.focus.set(camTarget);
|
||||
|
|
|
@ -55,7 +55,7 @@ function Node_3D_Camera_Set(_x, _y, _group = noone) : Node_3D_Camera(_x, _y, _gr
|
|||
var _col = _data[in_cam + 2];
|
||||
var _int = _data[in_cam + 3];
|
||||
|
||||
var pos = calculate_3d_position(0, 0, 0, _han, _van, 4)
|
||||
var pos = d3d_PolarToCart(0, 0, 0, _han, _van, 4)
|
||||
light_key.transform.position.set(pos.x, pos.y, pos.z);
|
||||
var _rot = new __rot3().lookAt(light_key.transform.position, new __vec3());
|
||||
light_key.transform.rotation.FromEuler(_rot.x, _rot.y, _rot.z);
|
||||
|
@ -68,7 +68,7 @@ function Node_3D_Camera_Set(_x, _y, _group = noone) : Node_3D_Camera(_x, _y, _gr
|
|||
var _col = _data[in_cam + 6];
|
||||
var _int = _data[in_cam + 7];
|
||||
|
||||
var pos = calculate_3d_position(0, 0, 0, _han, _van, 4)
|
||||
var pos = d3d_PolarToCart(0, 0, 0, _han, _van, 4)
|
||||
light_fill.transform.position.set(pos.x, pos.y, pos.z);
|
||||
var _rot = new __rot3().lookAt(light_fill.transform.position, new __vec3());
|
||||
light_fill.transform.rotation.FromEuler(_rot.x, _rot.y, _rot.z);
|
||||
|
|
|
@ -1231,7 +1231,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
badgeInspect = lerp_float(badgeInspect, inspecting, 2);
|
||||
|
||||
if(badgePreview > 0) {
|
||||
draw_sprite_ext(THEME.node_state, 0, xx, yy, badgePreview, badgePreview, 0, c_white, 1);
|
||||
draw_sprite_ext(THEME.node_state, is_3D? 3 : 0, xx, yy, badgePreview, badgePreview, 0, c_white, 1);
|
||||
xx -= 28 * badgePreview;
|
||||
}
|
||||
|
||||
|
|
|
@ -2071,15 +2071,15 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
if(type == VALUE_TYPE.action) {
|
||||
var tx = x;
|
||||
draw_set_text(f_p1, fa_center, fa_center, _draw_cc);
|
||||
draw_text(tx, y - (line_get_height() + 16) / 2, name);
|
||||
draw_text(round(tx), round(y - (line_get_height() + 16) / 2), name);
|
||||
} else if(connect_type == JUNCTION_CONNECT.input) {
|
||||
var tx = x - 12 * _s;
|
||||
draw_set_halign(fa_right);
|
||||
draw_text(tx, y, name);
|
||||
draw_text(round(tx), round(y), name);
|
||||
} else {
|
||||
var tx = x + 12 * _s;
|
||||
draw_set_halign(fa_left);
|
||||
draw_text(tx, y, name);
|
||||
draw_text(round(tx), round(y), name);
|
||||
}
|
||||
} #endregion
|
||||
|
||||
|
|
|
@ -614,18 +614,17 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
}
|
||||
|
||||
var _node = getNodePreview();
|
||||
if(_node)
|
||||
title = _node.renamed? _node.display_name : _node.name;
|
||||
if(_node) title = _node.renamed? _node.display_name : _node.name;
|
||||
|
||||
if(splitView == 0 && tileMode == 0 && is_surface(preview_surface[0])) {
|
||||
if(splitView == 0 && tileMode == 0) {
|
||||
var node = preview_node[0];
|
||||
node.previewing = 1;
|
||||
var aa = node.preview_alpha;
|
||||
if(is_surface(preview_surface[0])) {
|
||||
node.previewing = 1;
|
||||
var aa = node.preview_alpha;
|
||||
|
||||
if(PROJECT.onion_skin.enabled) {
|
||||
drawOnionSkin(node, psx, psy, ss);
|
||||
} else
|
||||
draw_surface_ext_safe(preview_surface[0], psx, psy, ss, ss, 0, c_white, aa);
|
||||
if(PROJECT.onion_skin.enabled) drawOnionSkin(node, psx, psy, ss);
|
||||
else draw_surface_ext_safe(preview_surface[0], psx, psy, ss, ss, 0, c_white, aa);
|
||||
}
|
||||
}
|
||||
|
||||
switch(splitView) { #region draw surfaces
|
||||
|
@ -752,7 +751,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
function draw3D() { #region
|
||||
var _prev_node = getNodePreview();
|
||||
if(_prev_node == noone) return;
|
||||
if(!_prev_node.is_3D) return
|
||||
if(!_prev_node.is_3D) return;
|
||||
|
||||
_prev_node.previewing = 1;
|
||||
|
||||
|
@ -763,7 +762,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
var _pos, targ, _blend = 1;
|
||||
|
||||
targ = d3_camTarget;
|
||||
_pos = calculate_3d_position(targ.x, targ.y, targ.z, d3_view_camera.focus_angle_x, d3_view_camera.focus_angle_y, d3_view_camera.focus_dist);
|
||||
_pos = d3d_PolarToCart(targ.x, targ.y, targ.z, d3_view_camera.focus_angle_x, d3_view_camera.focus_angle_y, d3_view_camera.focus_dist);
|
||||
|
||||
if(d3_active_transition == 1) {
|
||||
var _up = new __vec3(0, 0, -1);
|
||||
|
|
Loading…
Reference in a new issue