New 3D path camera node.

This commit is contained in:
Tanasart 2025-01-28 17:51:02 +07:00
parent 3942a6c6e6
commit af2c8a94c4
9 changed files with 103 additions and 5 deletions

View file

@ -2217,6 +2217,7 @@
{"name":"s_node_palette_sort","order":3,"path":"sprites/s_node_palette_sort/s_node_palette_sort.yy",},
{"name":"s_node_particle_effector","order":13,"path":"sprites/s_node_particle_effector/s_node_particle_effector.yy",},
{"name":"s_node_particle","order":12,"path":"sprites/s_node_particle/s_node_particle.yy",},
{"name":"s_node_path_3d_camera","order":28,"path":"sprites/s_node_path_3d_camera/s_node_path_3d_camera.yy",},
{"name":"s_node_path_3d","order":20,"path":"sprites/s_node_path_3d/s_node_path_3d.yy",},
{"name":"s_node_path_anchor","order":1,"path":"sprites/s_node_path_anchor/s_node_path_anchor.yy",},
{"name":"s_node_path_array","order":2,"path":"sprites/s_node_path_array/s_node_path_array.yy",},

View file

@ -1157,6 +1157,7 @@
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Number/Node_Statistic","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Number/Node_To_Number","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Number/Node_Transform_Array","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Path/Node_Path_3D_Camera","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Path/Node_Path_3D","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Path/Node_Path_Anchor","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Path/Node_Path_Array","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
@ -3561,6 +3562,7 @@
{"id":{"name":"s_node_palette","path":"sprites/s_node_palette/s_node_palette.yy",},},
{"id":{"name":"s_node_particle_effector","path":"sprites/s_node_particle_effector/s_node_particle_effector.yy",},},
{"id":{"name":"s_node_particle","path":"sprites/s_node_particle/s_node_particle.yy",},},
{"id":{"name":"s_node_path_3d_camera","path":"sprites/s_node_path_3d_camera/s_node_path_3d_camera.yy",},},
{"id":{"name":"s_node_path_3d","path":"sprites/s_node_path_3d/s_node_path_3d.yy",},},
{"id":{"name":"s_node_path_anchor","path":"sprites/s_node_path_anchor/s_node_path_anchor.yy",},},
{"id":{"name":"s_node_path_array","path":"sprites/s_node_path_array/s_node_path_array.yy",},},

Binary file not shown.

View file

@ -2,7 +2,7 @@
"name":"3D Path Camera",
"tooltip":"Render a 3D path into 2d space",
"baseNode":"Node_Path_3D_Camera",
"spr":"s_node_path_3d",
"spr":"s_node_path_3d_camera",
"pxc_version":118080,
"io":[ "pathnode" ],
}

View file

@ -4,9 +4,9 @@ function Node_Path_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _g
object = new __3dCamera_object();
camera = new __3dCamera();
lookat = new __3dGizmoSphere(0.5, c_ltgray, 1);
lookat = new __3dGizmoSphere(.5, c_ltgray, .5);
lookLine = noone;
lookRad = new __3dGizmoCircleZ(0.5, c_yellow, 0.5);
lookRad = new __3dGizmoCircleZ(.5, c_yellow, .5);
w = 128;
var i = in_d3d;
@ -88,6 +88,12 @@ function Node_Path_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _g
static getToolSettings = function() { return curr_posm == 0? tool_settings : []; }
static drawOverlay3D = function(active, params, _mx, _my, _snx, _sny, _panel) {
if(is_path) {
var _nodeFrom = inputs[in_d3d + 2].value_from.node;
if(struct_has(_nodeFrom, "drawOverlay3D"))
_nodeFrom.drawOverlay3D(false, params, _mx, _my, _snx, _sny, _panel);
}
var preObj = getPreviewObjects();
if(array_empty(preObj)) return;
preObj = preObj[0];
@ -269,7 +275,7 @@ function Node_Path_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _g
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
var bbox = drawGetBbox(xx, yy, _s);
draw_sprite_bbox_uniform(s_node_path_3d, 0, bbox);
draw_sprite_bbox_uniform(s_node_path_3d_camera, 0, bbox);
}
static getPreviewObject = function() { return noone; }

View file

@ -49,7 +49,6 @@ function Node_Path_Trim(_x, _y, _group = noone) : Node(_x, _y, _group) construct
static getBoundary = function(ind = 0) /*=>*/ {return is_path? curr_path.getBoundary(ind) : new BoundingBox( 0, 0, 1, 1 )};
static getPointRatio = function(_rat, ind = 0, out = undefined) {
if(out == undefined) out = new __vec2P(); else { out.x = 0; out.y = 0; }
if(!is_path) return out;
_rat = lerp(curr_range[0], curr_range[1], _rat);

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -0,0 +1,90 @@
{
"$GMSprite":"",
"%Name":"s_node_path_3d_camera",
"bboxMode":0,
"bbox_bottom":61,
"bbox_left":1,
"bbox_right":62,
"bbox_top":2,
"collisionKind":1,
"collisionTolerance":0,
"DynamicTexturePage":false,
"edgeFiltering":false,
"For3D":false,
"frames":[
{"$GMSpriteFrame":"","%Name":"be23148a-414a-41d6-8ace-64a25fbc38b1","name":"be23148a-414a-41d6-8ace-64a25fbc38b1","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
],
"gridX":0,
"gridY":0,
"height":64,
"HTile":false,
"layers":[
{"$GMImageLayer":"","%Name":"3969acaa-d4f5-4634-bd99-4dbe3b79b576","blendMode":0,"displayName":"default","isLocked":false,"name":"3969acaa-d4f5-4634-bd99-4dbe3b79b576","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_node_path_3d_camera",
"nineSlice":null,
"origin":4,
"parent":{
"name":"path",
"path":"folders/nodes/icons/value/path.yy",
},
"preMultiplyAlpha":false,
"resourceType":"GMSprite",
"resourceVersion":"2.0",
"sequence":{
"$GMSequence":"",
"%Name":"s_node_path_3d_camera",
"autoRecord":true,
"backdropHeight":768,
"backdropImageOpacity":0.5,
"backdropImagePath":"",
"backdropWidth":1366,
"backdropXOffset":0.0,
"backdropYOffset":0.0,
"events":{
"$KeyframeStore<MessageEventKeyframe>":"",
"Keyframes":[],
"resourceType":"KeyframeStore<MessageEventKeyframe>",
"resourceVersion":"2.0",
},
"eventStubScript":null,
"eventToFunction":{},
"length":1.0,
"lockOrigin":false,
"moments":{
"$KeyframeStore<MomentsEventKeyframe>":"",
"Keyframes":[],
"resourceType":"KeyframeStore<MomentsEventKeyframe>",
"resourceVersion":"2.0",
},
"name":"s_node_path_3d_camera",
"playback":1,
"playbackSpeed":30.0,
"playbackSpeedType":0,
"resourceType":"GMSequence",
"resourceVersion":"2.0",
"showBackdrop":true,
"showBackdropImage":false,
"timeUnits":1,
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"be23148a-414a-41d6-8ace-64a25fbc38b1","path":"sprites/s_node_path_3d_camera/s_node_path_3d_camera.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"2810fec7-d1dc-4a45-aa34-b7a73f95f41a","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange":null,
"volume":1.0,
"xorigin":32,
"yorigin":32,
},
"swatchColours":null,
"swfPrecision":0.5,
"textureGroupId":{
"name":"Default",
"path":"texturegroups/Default",
},
"type":0,
"VTile":false,
"width":64,
}