DomeFox Updates

This commit is contained in:
Josef 2025-10-31 13:09:03 +01:00
parent 1c98676862
commit cc090bdf47
30 changed files with 298 additions and 89 deletions

View File

@ -161,7 +161,7 @@ namespace Rokojori
return;
}
// RJLog.Log( "Triggering Action", actions[ i ].Name );
// RJLog.Log( _runID, "Triggering Actions Before", i, actions[ i ].Name, HierarchyName.Of( action ) );
Action.Trigger( actions[ i ] );
}
@ -210,6 +210,8 @@ namespace Rokojori
{
return;
}
// this.LogInfo( "Running" );
var run = new ActionSequenceRunner();
run.sequence = this;

View File

@ -68,7 +68,6 @@ namespace Rokojori
}
);
p.Restart();
}
public int IndexOf( GpuParticles3D p )

View File

@ -13,6 +13,9 @@ namespace Rokojori
[Export]
public bool queue = true;
[Export]
public bool disableAllNodes = true;
protected override void _OnTrigger()
{
@ -37,6 +40,12 @@ namespace Rokojori
return;
}
if ( disableAllNodes )
{
target.ForEach<Node>( n => NodeState.Disable( n ) );
NodeState.Disable( target );
}
target.SelfDestroy( queue );
}
}

View File

@ -24,10 +24,10 @@ namespace Rokojori
protected override void _OnTrigger()
{
if ( Engine.IsEditorHint() )
{
return;
}
// if ( Engine.IsEditorHint() )
// {
// return;
// }
if ( particles3D == null )
{
@ -73,7 +73,8 @@ namespace Rokojori
{
DispatchEnd( sequenceID );
}
}
},
this
);
}

View File

@ -10,13 +10,7 @@ point_count = 3
[sub_resource type="Resource" id="Resource_jwnpm"]
script = ExtResource("2_g6huw")
duration = 1.0
durationRandomRange = 0.0
delay = 0.0
delayRandomRange = 0.0
curve = SubResource("Curve_j2uji")
scaleY = 1.0
scaleRandomRange = 0.0
[sub_resource type="Curve" id="Curve_c1l7g"]
_limits = [-1.0, 1.0, 0.0, 1.0]
@ -25,25 +19,17 @@ point_count = 2
[sub_resource type="Resource" id="Resource_qub8t"]
script = ExtResource("2_g6huw")
duration = 1.0
durationRandomRange = 0.0
delay = 0.0
delayRandomRange = 0.0
curve = SubResource("Curve_c1l7g")
scaleY = 30.0
scaleRandomRange = 0.0
[resource]
script = ExtResource("1_gbi52")
shakeAmountCurve = SubResource("Resource_jwnpm")
shakeChangeFPSCurve = SubResource("Resource_qub8t")
timeline = ExtResource("3_pgufg")
smooth = true
smoothingStrength = 0.477
positionShake = Vector3(0.075, 0, 0.075)
globalPosition = false
repeatAndFlipFirstPosition = true
rotationShake = Vector3(0.5, 0.5, 10)
globalRotation = false
scaleShake = Vector3(0.1, 0.1, 0.1)
scaleShakeIsRelative = true

View File

@ -4,7 +4,7 @@ using System.Text;
namespace Rokojori
{
[GlobalClass,Tool, Icon("res://addons/rokojori_action_library/Icons/SelecorFlag.svg") ]
[GlobalClass,Tool]
public partial class AudioFlag:SelectorFlag
{

View File

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="CameraEffect" load_steps=8 format=3 uid="uid://ds6sptirfbytc"]
[ext_resource type="Script" uid="uid://bw7kbgl2vbeoh" path="res://addons/rokojori_action_library/Runtime/VirtualCameras/Effects/CameraEffectTargetAnimationCurve.cs" id="1_m7t4k"]
[ext_resource type="Script" uid="uid://bmcpy4cqv1lmr" path="res://addons/rokojori_action_library/Runtime/VirtualCameras/Effects/CameraEffect.cs" id="2_ahqbp"]
[ext_resource type="Script" uid="uid://bw7kbgl2vbeoh" path="res://addons/rokojori_action_library/Runtime/Cameras/Effects/CameraEffectTargetAnimationCurve.cs" id="1_m7t4k"]
[ext_resource type="Script" uid="uid://bmcpy4cqv1lmr" path="res://addons/rokojori_action_library/Runtime/Cameras/Effects/CameraEffect.cs" id="2_ahqbp"]
[ext_resource type="Resource" uid="uid://h6oi6vkj4c2m" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/RealTime.tres" id="3_iffro"]
[sub_resource type="Curve" id="Curve_62jxv"]
@ -11,12 +11,8 @@ point_count = 8
[sub_resource type="Resource" id="Resource_esvga"]
script = ExtResource("1_m7t4k")
target = 0
flipScaleYRandomly = true
duration = 0.5
durationRandomRange = 0.0
delay = 0.0
delayRandomRange = 0.0
curve = SubResource("Curve_62jxv")
scaleY = 0.05
scaleRandomRange = 0.1
@ -29,11 +25,7 @@ point_count = 9
[sub_resource type="Resource" id="Resource_s8na2"]
script = ExtResource("1_m7t4k")
target = 1
flipScaleYRandomly = false
duration = 0.5
durationRandomRange = 0.0
delay = 0.0
delayRandomRange = 0.0
curve = SubResource("Curve_h7nko")
scaleY = 0.05
scaleRandomRange = 0.1

View File

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="CameraEffect" load_steps=10 format=3 uid="uid://uyuplc6hm25j"]
[ext_resource type="Script" uid="uid://bmcpy4cqv1lmr" path="res://addons/rokojori_action_library/Runtime/VirtualCameras/Effects/CameraEffect.cs" id="1_5l6xm"]
[ext_resource type="Script" uid="uid://bw7kbgl2vbeoh" path="res://addons/rokojori_action_library/Runtime/VirtualCameras/Effects/CameraEffectTargetAnimationCurve.cs" id="1_x21rf"]
[ext_resource type="Script" uid="uid://bmcpy4cqv1lmr" path="res://addons/rokojori_action_library/Runtime/Cameras/Effects/CameraEffect.cs" id="1_5l6xm"]
[ext_resource type="Script" uid="uid://bw7kbgl2vbeoh" path="res://addons/rokojori_action_library/Runtime/Cameras/Effects/CameraEffectTargetAnimationCurve.cs" id="1_x21rf"]
[ext_resource type="Resource" uid="uid://ch5nsa6yafs5l" path="res://addons/rokojori_action_library/Runtime/Time/TimeLines/GameTime.tres" id="3_lfgu3"]
[sub_resource type="Curve" id="Curve_62jxv"]
@ -11,12 +11,8 @@ point_count = 5
[sub_resource type="Resource" id="Resource_esvga"]
script = ExtResource("1_x21rf")
target = 0
flipScaleYRandomly = true
duration = 0.2
durationRandomRange = 0.0
delay = 0.0
delayRandomRange = 0.0
curve = SubResource("Curve_62jxv")
scaleY = 0.1
scaleRandomRange = 0.2
@ -29,11 +25,7 @@ point_count = 6
[sub_resource type="Resource" id="Resource_s8na2"]
script = ExtResource("1_x21rf")
target = 1
flipScaleYRandomly = false
duration = 0.2
durationRandomRange = 0.0
delay = 0.0
delayRandomRange = 0.0
curve = SubResource("Curve_h7nko")
scaleY = 0.1
scaleRandomRange = 0.2
@ -48,12 +40,8 @@ script = ExtResource("1_x21rf")
target = 6
flipScaleYRandomly = true
duration = 0.3
durationRandomRange = 0.0
delay = 0.0
delayRandomRange = 0.0
curve = SubResource("Curve_opp1p")
scaleY = 10.0
scaleRandomRange = 0.0
[resource]
script = ExtResource("1_5l6xm")

View File

@ -39,6 +39,11 @@ namespace Rokojori
return self.DirectionTowards( other ).Length();
}
public static float DistanceTo( this Node3D self, Vector3 position )
{
return self.DirectionTowards( position ).Length();
}
public static Vector3 DirectionTowards( this Node3D self, Node3D other )
{
return ( other.GlobalPosition - self.GlobalPosition );
@ -190,6 +195,33 @@ namespace Rokojori
node.GlobalPosition = gp;
}
public static void SetScaleX( this Node3D node, float x )
{
var gp = node.Scale;
gp.X = x;
node.Scale = gp;
}
public static void SetScaleY( this Node3D node, float y )
{
var gp = node.Scale;
gp.Y = y;
node.Scale = gp;
}
public static void SetScaleZ( this Node3D node, float z )
{
var gp = node.Scale;
gp.Z = z;
node.Scale = gp;
}
public static void SetLocalX( this Node3D node, float x )
{
var gp = node.Position;

View File

@ -0,0 +1,32 @@
using Godot;
using System.Collections.Generic;
using System;
using System.Threading.Tasks;
using System.Reflection;
using Microsoft.VisualBasic;
namespace Rokojori
{
public static class NodeExtensions
{
public static T GetNextSiblingOrChild<T>( this Node node ) where T:Node
{
var index = node.GetIndex();
var p = node.GetParent();
for ( int i = index + 1; i < p.GetChildCount(); i++ )
{
var child = p.GetChild( i );
if ( child != null && child is T t )
{
return t;
}
}
return Nodes.GetAnyChild<T>( node );
}
}
}

View File

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

View File

@ -21,6 +21,8 @@ namespace Rokojori
return GetAnyChild<T>( node );
}
public static T GetSelfOrChildOf<T>( this Node node ) where T:Node
{
if ( node is T t )
@ -749,7 +751,7 @@ namespace Rokojori
public static T GetDirectChild<T>( this Node parent ) where T:Node
{
if ( parent == null )
if ( parent == null || ! Node.IsInstanceValid( parent ) )
{
return null;
}

View File

@ -7,6 +7,7 @@ namespace Rokojori
{
public enum CollisionPhase
{
None,
Entered,
Inside,
Exit
@ -52,12 +53,26 @@ namespace Rokojori
return collisionTypes.IndexOf( collider.collisionType ) != -1;
}
Collider _collider;
CollisionPhase _collisionPhase;
public Collider collider => _collider;
public CollisionPhase collisionPhase => _collisionPhase;
public void Collide( Collider collider, CollisionPhase phase )
{
// this.LogInfo( "Colliding with", phase, HierarchyName.Of( collider ) );
_collider = collider;
_collisionPhase = phase;
_Collide( collider, phase );
if ( phase == CollisionPhase.Entered )
{
// this.LogInfo( "Entered", HierarchyName.Of( collider ) );
if ( onEnteredColliderPose != null )
{
onEnteredColliderPose.CopyGlobalPoseFrom( collider.area );
@ -68,6 +83,8 @@ namespace Rokojori
}
else if ( phase == CollisionPhase.Inside )
{
// this.LogInfo( "Inside", HierarchyName.Of( collider ) );
if ( onInsideColliderPose != null )
{
onInsideColliderPose.CopyGlobalPoseFrom( collider.area );
@ -78,6 +95,8 @@ namespace Rokojori
}
else if ( phase == CollisionPhase.Exit )
{
// this.LogInfo( "Exit", HierarchyName.Of( collider ) );
if ( onExitColliderPose != null )
{
onExitColliderPose.CopyGlobalPoseFrom( collider.area );
@ -86,6 +105,9 @@ namespace Rokojori
Action.Trigger( collider.onExit );
Action.Trigger( onExit );
}
_collider = null;
_collisionPhase = CollisionPhase.None;
}
protected virtual void _Collide( Collider collider, CollisionPhase phase )

View File

@ -23,6 +23,10 @@ namespace Rokojori
[Export]
public Action onExit;
[Export]
public bool activateAlwaysOnInside = false;
Dictionary<Collidable,System.Action> _inside = new Dictionary<Collidable,System.Action>();
public void OnNodeStateChanged()
@ -44,28 +48,69 @@ namespace Rokojori
area.AreaEntered += TriggerOnEnter;
area.BodyEntered += TriggerOnEnter;
area.AreaExited += TriggerOnExited;
area.BodyExited += TriggerOnExited;
area.AreaExited += _TriggerOnExited;
area.BodyExited += _TriggerOnExited;
}
void TriggerOnEnter( Node n )
public void TriggerOnCollisionEnter( Projectile p, KinematicCollision3D collision )
{
if ( ! Math3D.IsValid( area.GlobalPosition ) )
// this.LogInfo( "Collider:", collision.GetCollider( 0 ), "Shape:", collision.GetColliderShape( 0 ) );
_TriggerOnEnter( (Node) collision.GetCollider( 0 ) );
}
public void TriggerOnCollisionExit( Projectile p, KinematicCollision3D collision )
{
// this.LogInfo( "Collider:", collision.GetCollider( 0 ), "Shape:", collision.GetColliderShape( 0 ) );
_TriggerOnExited( (Node) collision.GetCollider( 0 ) );
}
public void TriggerOnEnter( Node3D node3D )
{
// this.LogInfo( "Collider:", collision.GetCollider( 0 ), "Shape:", collision.GetColliderShape( 0 ) );
_TriggerOnEnter( node3D );
}
public void TriggerOnExited( Node3D node3D )
{
// this.LogInfo( HierarchyName.Of( node3D ) );
_TriggerOnExited( node3D );
}
Collidable GetCollidable( Node n )
{
if ( n is Collidable c && c.IsCollidingWith( this ) )
{
return;
}
return c;
}
var collidable = n.Get<Collidable>();
return n.FindDirectChild<Collidable>( c => c.IsCollidingWith( this ) );
if ( collidable == null || ! collidable.IsCollidingWith( this ) )
}
void _TriggerOnEnter( Node n )
{
if ( n == null )
{
return;
}
if ( area != null && ! Math3D.IsValid( area.GlobalPosition ) )
{
return;
}
var collidable = GetCollidable( n );
if ( collidable == null )
{
return;
}
collidable.Collide( this, CollisionPhase.Entered );
if ( onInside == null )
if ( ( ! activateAlwaysOnInside ) && onInside == null )
{
return;
}
@ -87,11 +132,11 @@ namespace Rokojori
}
void TriggerOnExited( Node n )
void _TriggerOnExited( Node n )
{
var collidable = n.Get<Collidable>();
var collidable = GetCollidable( n );
if ( collidable == null || ! collidable.IsCollidingWith( this ) )
if ( collidable == null )
{
return;
}

View File

@ -7,7 +7,7 @@ using System.Drawing;
namespace Rokojori
{
[Tool]
[GlobalClass,Icon("res://addons/rokojori_action_library/Icons/SelectorFlag.svg")]
[GlobalClass]
public partial class CollisionFlag:SelectorFlag
{

View File

@ -19,7 +19,7 @@ namespace Rokojori
public float rayLength = 10;
[Export]
public int maxHits = 100;
public int maxHits = 3;
[Export]
public bool sortByPointerPriority;
@ -38,9 +38,8 @@ namespace Rokojori
public override int NumColliders()
{
return numCollisions;
return collisions == null ? 0 : numCollisions;
}
public override Node GetCollider( int index )
{
@ -85,9 +84,12 @@ namespace Rokojori
}
[Export]
public bool runInEditor = false;
void Update( double delta )
{
if ( Engine.IsEditorHint() )
if ( Engine.IsEditorHint() && ! runInEditor )
{
return;
@ -132,7 +134,7 @@ namespace Rokojori
var excludes = new Array<Rid>();
var from = GlobalPosition;
var to = from + this.GlobalForward() * rayLength;
var to = from + this.GlobalForward().Normalized() * rayLength;
this.to = to;
@ -148,7 +150,7 @@ namespace Rokojori
var collisionData = GetCollisionData( numCollisions );
collisionData.Get( rayParameters, physics );
if ( ! collisionData.hasCollision )
if ( ! collisionData.hasCollision || this.DistanceTo( collisionData.position ) > rayLength )
{
return;
}

View File

@ -120,6 +120,13 @@ namespace Rokojori
SetFromNormalAndCoplanarPoint( normal, a );
}
public static Plane3 CreateFromNormalAndCoplanarPoint( Vector3 normal, Vector3 point )
{
var p = new Plane3();
p.SetFromNormalAndCoplanarPoint( normal, point );
return p;
}
public static Plane3 FromCoplanarPoints( Vector3 a, Vector3 b, Vector3 c )
{
var p = new Plane3();

View File

@ -61,9 +61,7 @@ namespace Rokojori
{
var result = physicsState.IntersectRay( ray );
if ( ! result.ContainsKey( "collider" ) )
if ( ! result.ContainsKey( "collider" ) || result[ "collider" ].As<Node>() == null )
{
hasCollision = false;
return;

View File

@ -0,0 +1,59 @@
using Godot;
using System.Collections;
using System.Collections.Generic;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class Projectile:CharacterBody3D
{
[Export]
public float speed = 0;
[Export]
public bool disableOnCollision = false;
[Export]
public bool disabled = false;
[Export]
public Collider collider;
[Export]
public Action onCollision;
[Export]
public bool runInEditor = false;
public override void _PhysicsProcess( double delta )
{
if ( disabled || ( Engine.IsEditorHint() && ! runInEditor ) )
{
return;
}
var velocity = this.GlobalForward() * speed * (float)delta;
var collision = MoveAndCollide( velocity );
if ( collision == null )
{
return;
}
if ( collider != null)
{
collider.TriggerOnCollisionEnter( this, collision );
}
Action.Trigger( onCollision );
if ( disableOnCollision )
{
disabled = true;
}
}
}
}

View File

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

View File

@ -35,11 +35,11 @@ namespace Rokojori
if ( ta == null )
{
this.LogInfo( "No attributes found..." );
// this.LogInfo( "No attributes found..." );
return;
}
this.LogInfo( "Index", index, "Value:", value, "Channel:", channel );
// this.LogInfo( "Index", index, "Value:", value, "Channel:", channel );
ta.SetChannel( index, value, channel, operatorType );
}
}

View File

@ -20,6 +20,9 @@ namespace Rokojori
[Export]
public bool processSensors = true;
[Export]
public bool autoScan = true;
[Export]
public Node[] autoScanForSensors = [];
@ -135,7 +138,7 @@ namespace Rokojori
hasDevice = true;
this.LogInfo( "Device Type Change:", lastActiveDevice.GetInfo() );
// this.LogInfo( "Device Type Change:", lastActiveDevice.GetInfo() );
if ( confineMouse && DefaultSensorDeviceSelector.IsMouseDevice( lastActiveDevice ) )
{
@ -378,7 +381,9 @@ namespace Rokojori
typeof( Area3D ),
typeof( CharacterBody3D ),
typeof( AudioStreamPlayer3D ),
typeof( ReflectionProbe )
typeof( ReflectionProbe ),
typeof( SensorManager ),
typeof( SensorManagerSetup )
};
@ -495,6 +500,20 @@ namespace Rokojori
Nodes.ForEach<Node>( n, n => AddSensorsFrom( n ) );
}
if ( autoScan )
{
this.ForEachInRoot<Node>(
( n )=>
{
if ( IsIgnoreType( n ) )
{
return;
}
AddSensorsFrom( n );
}
);
}
// if ( autoScanParent )
// {
// Nodes.ForEach<Node>( GetParent(), AddSensorsFrom );

View File

@ -11,6 +11,10 @@ namespace Rokojori
[Export]
public bool initializeOnReady = true;
[Export]
public bool processSensors = true;
[ExportGroup( "Sensor Scanning" )]
[Export]
public Sensor[] sensors = [];
@ -18,7 +22,7 @@ namespace Rokojori
public SensorGroup[] sensorGroups = [];
[Export]
public bool processSensors = true;
public bool autoScan = true;
[Export]
public Node[] autoScanForSensors = [];
@ -26,6 +30,8 @@ namespace Rokojori
[Export]
public bool autoScanParent = true;
[ExportGroup( "Debugging Options")]
[Export]
public bool separateMouseAndKeyboardTracking = false;
@ -50,6 +56,7 @@ namespace Rokojori
sm.sensors = sensors;
sm.sensorGroups = sensorGroups;
sm.processSensors = processSensors;
sm.autoScan = autoScan;
sm.autoScanForSensors = autoScanForSensors;
sm.separateMouseAndKeyboardTracking = separateMouseAndKeyboardTracking;
sm.onActiveDeviceChange = onActiveDeviceChange;

View File

@ -27,6 +27,9 @@ namespace Rokojori
[Export]
public bool autoStart = true;
[Export]
public bool executesInPause = false;
public static float osTime => (float)( Time.GetTicksMsec() / 1000.0 );
public TimeLineRunner runner

View File

@ -56,10 +56,15 @@ namespace Rokojori
public bool inProcess => _inProcess;
bool _paused = false;
public bool paused => _paused;
public override void _Process( double delta )
{
_inProcess = true;
_paused = GetTree().Paused;
UpdateRealTime( delta );
if ( ! Engine.IsEditorHint() && gametimeTimeline != null )

View File

@ -57,7 +57,7 @@ namespace Rokojori
public void UpdateTimeLine( float realtimeDelta )
{
if ( ! playing )
if ( ! playing || ( manager.paused && ! timeLine.executesInPause ))
{
return;
}

View File

@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="TimeLine" load_steps=2 format=3 uid="uid://h6oi6vkj4c2m"]
[ext_resource type="Script" path="res://addons/rokojori_action_library/Runtime/Time/TimeLine.cs" id="1_0ltdh"]
[ext_resource type="Script" uid="uid://fqm54rn8fnnl" path="res://addons/rokojori_action_library/Runtime/Time/TimeLine.cs" id="1_0ltdh"]
[resource]
script = ExtResource("1_0ltdh")
executesInPause = true

View File

@ -4,8 +4,4 @@
[resource]
script = ExtResource("1_xynux")
isLooping = false
loopStart = 0.0
loopEnd = 100000.0
startSpeed = 1.0
autoStart = true
executesInPause = true

View File

@ -57,19 +57,19 @@ namespace Rokojori
if ( iiLib == null )
{
this.LogInfo( "No Input lib!" );
// this.LogInfo( "No Input lib!" );
return;
}
var icons = iiLib.ResolveIcons( inputIcons );
this.LogInfo( "Resolved Icons:\n", inputIcons, "\n>>\n", icons );
// this.LogInfo( "Resolved Icons:\n", inputIcons, "\n>>\n", icons );
if ( deviceFilter != null )
{
var iconsBefore = Lists.From( icons );
icons = Lists.Filter( icons, i => deviceFilter.BelongsToDevice( i ) );
this.LogInfo( "Device Filtered Icons:\n", iconsBefore, "\n>>\n", icons );
// this.LogInfo( "Device Filtered Icons:\n", iconsBefore, "\n>>\n", icons );
}
icons = iiLib.ResolveIcons( icons.ToArray() );
@ -84,7 +84,7 @@ namespace Rokojori
localeText.locale = locale;
localeText.font = iiLib.font;
localeText.fontSize = iiLib.fontSize;
localeText.fontSize = this.fontSize != null ? this.fontSize : iiLib.fontSize;
localeText.Uppercase = upperCase;
localeText.marginLeft = UINumber.EM( 0.25f );
@ -134,11 +134,11 @@ namespace Rokojori
if ( id == null )
{
this.LogInfo( "No definition found >> ", inputIcon );
// this.LogInfo( "No definition found >> ", inputIcon );
return;
}
this.LogInfo( "Definition found >> ", inputIcon );
// this.LogInfo( "Definition found >> ", inputIcon );
var iconRegion = this.CreateChild<UIRegion>();
var elements = id.GetIconElementsForIcon( inputIcon );

View File

@ -9,7 +9,7 @@
[sub_resource type="Resource" id="Resource_wm644"]
script = ExtResource("3_xon8j")
value = 0.5
value = 1.5
unit = "vw"
metadata/_custom_type_script = "uid://cnkyynboxg1qg"