This commit is contained in:
Josef 2025-03-25 08:08:51 +01:00
parent a413d6d31e
commit 76a4e8e87d
15 changed files with 199 additions and 23 deletions

View File

@ -1,8 +1,8 @@
[gd_resource type="Resource" script_class="FlashEffect" load_steps=8 format=3 uid="uid://bfxwx0fiejnk3"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_ejko8"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_3i2og"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/Flash/FlashEffect.cs" id="3_65ipm"]
[ext_resource type="Script" uid="uid://dncqth3uf3tb3" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_ejko8"]
[ext_resource type="Script" uid="uid://c5tm02yj1bhhx" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_3i2og"]
[ext_resource type="Script" uid="uid://cupnq55n3nimc" path="res://addons/rokojori_action_library/Runtime/Animation/Flash/FlashEffect.cs" id="3_65ipm"]
[ext_resource type="Resource" uid="uid://ch5nsa6yafs5l" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/GameTime.tres" id="4_nyaof"]
[sub_resource type="Resource" id="Resource_54hj8"]

View File

@ -1,8 +1,8 @@
[gd_resource type="Resource" script_class="FlashEffect" load_steps=8 format=3 uid="uid://drjdsp2qnceql"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_yrhv1"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_cdv3p"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/Flash/FlashEffect.cs" id="3_87ql1"]
[ext_resource type="Script" uid="uid://dncqth3uf3tb3" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_yrhv1"]
[ext_resource type="Script" uid="uid://c5tm02yj1bhhx" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_cdv3p"]
[ext_resource type="Script" uid="uid://cupnq55n3nimc" path="res://addons/rokojori_action_library/Runtime/Animation/Flash/FlashEffect.cs" id="3_87ql1"]
[ext_resource type="Resource" uid="uid://ch5nsa6yafs5l" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/GameTime.tres" id="4_2na64"]
[sub_resource type="Resource" id="Resource_54hj8"]

View File

@ -1,8 +1,8 @@
[gd_resource type="Resource" script_class="FlashEffect" load_steps=8 format=3 uid="uid://d06w8jorebto2"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_c8lnw"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_w323b"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/Flash/FlashEffect.cs" id="3_eqd4c"]
[ext_resource type="Script" uid="uid://dncqth3uf3tb3" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_c8lnw"]
[ext_resource type="Script" uid="uid://c5tm02yj1bhhx" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_w323b"]
[ext_resource type="Script" uid="uid://cupnq55n3nimc" path="res://addons/rokojori_action_library/Runtime/Animation/Flash/FlashEffect.cs" id="3_eqd4c"]
[ext_resource type="Resource" uid="uid://ch5nsa6yafs5l" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/GameTime.tres" id="4_cs6ks"]
[sub_resource type="Resource" id="Resource_ny3sx"]

View File

@ -1,8 +1,8 @@
[gd_resource type="Resource" script_class="FlashEffect" load_steps=8 format=3 uid="uid://cwdnm658q3jta"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_nmdum"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_0sgd7"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/Flash/FlashEffect.cs" id="3_7qcuh"]
[ext_resource type="Script" uid="uid://dncqth3uf3tb3" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_nmdum"]
[ext_resource type="Script" uid="uid://c5tm02yj1bhhx" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_0sgd7"]
[ext_resource type="Script" uid="uid://cupnq55n3nimc" path="res://addons/rokojori_action_library/Runtime/Animation/Flash/FlashEffect.cs" id="3_7qcuh"]
[ext_resource type="Resource" uid="uid://ch5nsa6yafs5l" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/GameTime.tres" id="4_rkq1j"]
[sub_resource type="Resource" id="Resource_54hj8"]

View File

@ -1,8 +1,8 @@
[gd_resource type="Resource" script_class="FlashEffect" load_steps=8 format=3 uid="uid://pok7bfoksfmr"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_pp4qy"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_f6f0o"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/Flash/FlashEffect.cs" id="3_dq1j1"]
[ext_resource type="Script" uid="uid://dncqth3uf3tb3" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_pp4qy"]
[ext_resource type="Script" uid="uid://c5tm02yj1bhhx" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_f6f0o"]
[ext_resource type="Script" uid="uid://cupnq55n3nimc" path="res://addons/rokojori_action_library/Runtime/Animation/Flash/FlashEffect.cs" id="3_dq1j1"]
[ext_resource type="Resource" uid="uid://ch5nsa6yafs5l" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/GameTime.tres" id="4_d6hj6"]
[sub_resource type="Resource" id="Resource_ny3sx"]

View File

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="HighlightEffect" load_steps=7 format=3 uid="uid://dadr1kd14m7g3"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_sk831"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/Highlight/HighlightEffect.cs" id="2_pq63c"]
[ext_resource type="Script" uid="uid://dncqth3uf3tb3" path="res://addons/rokojori_action_library/Runtime/Animation/HDRColor.cs" id="1_sk831"]
[ext_resource type="Script" uid="uid://dkbln8rf5p0pu" path="res://addons/rokojori_action_library/Runtime/Animation/Highlight/HighlightEffect.cs" id="2_pq63c"]
[ext_resource type="Resource" uid="uid://h6oi6vkj4c2m" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/RealTime.tres" id="3_8mahg"]
[sub_resource type="Resource" id="Resource_27v41"]

View File

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="ShakeEffect" load_steps=8 format=3 uid="uid://begmg64jiaoq0"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/Shake/ShakeEffect.cs" id="1_gbi52"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_g6huw"]
[ext_resource type="Script" uid="uid://bec6skfqkb2ci" path="res://addons/rokojori_action_library/Runtime/Animation/Shake/ShakeEffect.cs" id="1_gbi52"]
[ext_resource type="Script" uid="uid://c5tm02yj1bhhx" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_g6huw"]
[ext_resource type="Resource" uid="uid://h6oi6vkj4c2m" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/RealTime.tres" id="3_pgufg"]
[sub_resource type="Curve" id="Curve_j2uji"]
@ -19,7 +19,7 @@ scaleY = 1.0
scaleRandomRange = 0.0
[sub_resource type="Curve" id="Curve_c1l7g"]
min_value = -1.0
_limits = [-1.0, 1.0, 0.0, 1.0]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 1, Vector2(1, 1), 0.0, 0.0, 1, 0]
point_count = 2

View File

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="ShakeEffect" load_steps=8 format=3 uid="uid://c2wbn25rxynk8"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/Shake/ShakeEffect.cs" id="1_68es8"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_wfmv2"]
[ext_resource type="Script" uid="uid://bec6skfqkb2ci" path="res://addons/rokojori_action_library/Runtime/Animation/Shake/ShakeEffect.cs" id="1_68es8"]
[ext_resource type="Script" uid="uid://c5tm02yj1bhhx" path="res://addons/rokojori_action_library/Runtime/Animation/AnimationCurve.cs" id="2_wfmv2"]
[ext_resource type="Resource" uid="uid://h6oi6vkj4c2m" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/RealTime.tres" id="3_h08aw"]
[sub_resource type="Curve" id="Curve_j2uji"]

View File

@ -0,0 +1,79 @@
using System.Collections;
using System.Collections.Generic;
using Godot;
using System;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class ClipMapPlaneMeshType:__PlaneMeshType__
{
[Export]
public float maxCellSize = 100;
[Export]
public float minCellSize = 10;
[Export]
public Curve cellSizeOverDistance = MathX.Curve( 0, 1 );
public override MeshGeometry GetMeshGeometry( float sizeX, float sizeZ )
{
var xUnits = Mathf.Ceil( ( sizeX / 2 ) / maxCellSize ) * 2;
var zUnits = Mathf.Ceil( ( sizeZ / 2 ) / maxCellSize ) * 2;
var mg = new MeshGeometry();
var size = new Vector2( xUnits * maxCellSize, zUnits * maxCellSize );
var offset = size / -2f;
var maxDistance = offset.Length();
this.LogInfo( xUnits, zUnits );
for ( int i = 0; i < xUnits; i++ )
{
for ( int j = 0; j < zUnits; j++ )
{
var c = offset + new Vector2( i * maxCellSize, j * maxCellSize );
var s = c.Length() / maxDistance;
if ( cellSizeOverDistance != null )
{
s = cellSizeOverDistance.Sample( s );
}
s = Mathf.Lerp( minCellSize, maxCellSize, s );
Add( mg, c, s );
}
}
return mg;
}
void Add( MeshGeometry mg, Vector2 center, float cellSize )
{
var numDivisions = Mathf.CeilToInt( maxCellSize / cellSize );
var sectionMG = MeshGeometry.CreateFromUVFunction(
( uv ) =>
{
var pose = new Pose();
return pose;
},
numDivisions, numDivisions
);
mg.Add( sectionMG );
}
}
}

View File

@ -0,0 +1 @@
uid://cglc3w2xqcm1r

View File

@ -0,0 +1,75 @@
using System.Collections;
using System.Collections.Generic;
using Godot;
using System;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class Plane:Node3D
{
[Export]
public float width { get => _width; set { _width = value; UpdateMesh(); } }
float _width = 200;
[Export]
public float height { get => _height; set { _height = value; UpdateMesh(); } }
float _height = 200;
[Export]
public __PlaneMeshType__ type { get => _type; set { _type = value; UpdateMesh(); } }
__PlaneMeshType__ _type;
[Export]
public Material material;
[Export]
public MeshInstance3D outputMesh;
[Export]
public bool initialized
{
get => _initialized;
set { if ( _initialized ) { return; } _initialized = true; UpdateMesh(); }
}
bool _initialized;
void UpdateMesh()
{
if ( ! _initialized )
{
return;
}
if ( _type == null )
{
return;
}
this.LogInfo( "Creating mesh" );
var mg = _type.GetMeshGeometry( width, height );
if ( outputMesh == null )
{
outputMesh = this.CreateChild<MeshInstance3D>();
}
outputMesh.Mesh = mg.GenerateMesh();
if ( material != null )
{
Materials.Set( outputMesh, material );
}
this.LogInfo( material, outputMesh, outputMesh.Mesh );
}
}
}

View File

@ -0,0 +1 @@
uid://cqpri6uy5n2bg

View File

@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using Godot;
using System;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class __PlaneMeshType__:Resource
{
public virtual MeshGeometry GetMeshGeometry( float width, float height )
{
return null;
}
}
}

View File

@ -0,0 +1 @@
uid://b12qi80x6nyic

View File

@ -68,7 +68,7 @@ namespace Rokojori
public void SetHandle( EditorNode3DGizmo gizmo, int id, bool secondary, Camera3D camera, Vector2 point )
{
var xzPlane = new Plane( Vector3.Up, startDragPosition);
var xzPlane = new Godot.Plane( Vector3.Up, startDragPosition );
var cameraDirection = camera.ProjectLocalRayNormal( point );
var intersection = xzPlane.IntersectsRay( camera.GlobalPosition, cameraDirection );