Jam Updates
This commit is contained in:
parent
e5166dd7cf
commit
08dbd8681b
|
@ -7,7 +7,7 @@ namespace Rokojori
|
|||
{
|
||||
[Tool]
|
||||
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg") ]
|
||||
public partial class OnCollision:Node
|
||||
public partial class OnCollision:Node,iNodeState
|
||||
{
|
||||
[Export]
|
||||
public Area3D area;
|
||||
|
@ -28,6 +28,24 @@ namespace Rokojori
|
|||
|
||||
Dictionary<Node,System.Action> _inside = new Dictionary<Node,System.Action>();
|
||||
|
||||
List<Node> _nodes = new List<Node>();
|
||||
|
||||
public List<Node> GetNodesInside()
|
||||
{
|
||||
_nodes = _nodes.Filter( n => n != null && IsInstanceValid( n ) );
|
||||
|
||||
return _nodes;
|
||||
}
|
||||
|
||||
public void OnNodeStateChanged( bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
||||
Node.ProcessModeEnum processMode, bool visible )
|
||||
{
|
||||
if ( ! processEnabled || ! physicsEnabled || Node.ProcessModeEnum.Disabled == processMode )
|
||||
{
|
||||
this.LogInfo( "Clearing nodes" );
|
||||
_nodes.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
|
@ -56,9 +74,15 @@ namespace Rokojori
|
|||
return;
|
||||
}
|
||||
|
||||
if ( ! _nodes.Contains( n ) )
|
||||
{
|
||||
_nodes.Add( n );
|
||||
}
|
||||
|
||||
|
||||
this.LogInfo( "Selecting Enter", area.GlobalPosition, HierarchyName.Of( n ), ( (Node3D)n ).GlobalPosition );
|
||||
|
||||
|
||||
// this.LogInfo( "Selecting Enter", area.GlobalPosition, HierarchyName.Of( n ), ( (Node3D)n ).GlobalPosition );
|
||||
Action.Trigger( onEntered );
|
||||
|
||||
if ( onInside == null )
|
||||
|
@ -81,6 +105,8 @@ namespace Rokojori
|
|||
|
||||
void TriggerOnExited( Node n )
|
||||
{
|
||||
_nodes.Remove( n );
|
||||
|
||||
if ( ! Selector.IsSelecting( selector, n ) )
|
||||
{
|
||||
return;
|
||||
|
@ -88,6 +114,8 @@ namespace Rokojori
|
|||
|
||||
Action.Trigger( onExit );
|
||||
|
||||
|
||||
|
||||
if ( ! _inside.ContainsKey( n ) )
|
||||
{
|
||||
return;
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Rokojori
|
||||
{
|
||||
[Tool][GlobalClass]
|
||||
public partial class RemoveNode : Action
|
||||
{
|
||||
[Export]
|
||||
public Node target;
|
||||
|
||||
protected override void _OnTrigger()
|
||||
{
|
||||
if ( target != null )
|
||||
{
|
||||
target.SelfDestroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
uid://dq5kae8x62gre
|
|
@ -50,8 +50,13 @@ namespace Rokojori
|
|||
|
||||
|
||||
|
||||
// [ExportToolButton( "Initialize")]
|
||||
// public Callable InitializeButton => Callable.From( Initialize );
|
||||
[ExportToolButton( "Initialize")]
|
||||
public Callable InitializeButton => Callable.From( Initialize );
|
||||
|
||||
public override void _Process( double delta )
|
||||
{
|
||||
Engine.MaxFps = _fps;
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
|
|
|
@ -5,6 +5,13 @@ using System;
|
|||
|
||||
namespace Rokojori
|
||||
{
|
||||
public interface iNodeState
|
||||
{
|
||||
public void OnNodeStateChanged( bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
||||
Node.ProcessModeEnum processMode, bool visible );
|
||||
|
||||
}
|
||||
|
||||
public static class NodeState
|
||||
{
|
||||
public static void Configure( Node n, bool processEnabled, bool inputEnabled, bool physicsEnabled, bool signalsEnabled,
|
||||
|
@ -22,6 +29,12 @@ namespace Rokojori
|
|||
|
||||
n.ProcessMode = processMode;
|
||||
|
||||
if ( n is iNodeState ins )
|
||||
{
|
||||
ins.OnNodeStateChanged( processEnabled, inputEnabled, physicsEnabled, signalsEnabled,
|
||||
processMode, visible );
|
||||
}
|
||||
|
||||
|
||||
if ( n is Node3D )
|
||||
{
|
||||
|
|
|
@ -15,6 +15,9 @@ namespace Rokojori
|
|||
[Export]
|
||||
public Sensor button;
|
||||
|
||||
[Export]
|
||||
public Action onInteract;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
SensorManager.Register( this, button );
|
||||
|
|
|
@ -19,6 +19,9 @@ namespace Rokojori
|
|||
[Export]
|
||||
public Pointable pointable;
|
||||
|
||||
[Export]
|
||||
public bool printPointables = false;
|
||||
|
||||
public override void _Process( double delta )
|
||||
{
|
||||
if ( caster == null )
|
||||
|
@ -52,6 +55,11 @@ namespace Rokojori
|
|||
pointable.UpdatePointerState( this, true );
|
||||
Highlight( HighlightActionType.Start, pointable );
|
||||
}
|
||||
|
||||
if ( printPointables )
|
||||
{
|
||||
this.LogInfo( pointable );
|
||||
}
|
||||
}
|
||||
|
||||
void Highlight( HighlightActionType type, Pointable p )
|
||||
|
|
|
@ -91,30 +91,30 @@ vec3 limitDeform( vec3 originalWorldPosition, vec3 deformedWorldPosition )
|
|||
return outputPosition;
|
||||
}
|
||||
|
||||
void vertex()
|
||||
void vertex()
|
||||
{
|
||||
UV = UV * uv1_scale.xy + uv1_offset.xy;
|
||||
|
||||
|
||||
vec3 worldVertex = localToWorld( VERTEX, MODEL_MATRIX ).xyz;
|
||||
vec2 worldUV = worldVertex.xz * hslVariationUVScale;
|
||||
|
||||
|
||||
float hslAmountValue = ( 2.0 * texture( windNoise, mod( worldUV, vec2( 1,1 ) ) ).r - 1.0 );
|
||||
|
||||
|
||||
vec3 albedoHSL = RGBtoHSL( albedo.rgb ) + hslAmountValue * hslVariation.xyz;
|
||||
//albedoHSL = RGBtoHSL( albedo.rgb );
|
||||
//albedoHSL.y *= 1.0;
|
||||
albedoHSL.x = mod( albedoHSL.x, 1 );
|
||||
albedoHSL.x = mod( albedoHSL.x, 1 );
|
||||
albedoHSL = clamp( albedoHSL, vec3( 0,0,0 ), vec3( 1,1,1 ) );
|
||||
albedoColor = mix( albedo.rgb, HSLtoRGB( albedoHSL ), hslVariation.w );
|
||||
|
||||
albedoColor = mix( albedo.rgb, HSLtoRGB( albedoHSL ), hslVariation.w );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ( windEnabled )
|
||||
{
|
||||
{
|
||||
float windAmount = normalizeToRange01( VERTEX.y, windStart, windEnd );
|
||||
float rawWindAmount = windAmount;
|
||||
windAmount = mix( windAmount, windAmount * windAmount, windWeightCurve );
|
||||
windAmount = mix( windAmount, windAmount * windAmount, windWeightCurve );
|
||||
vec2 windUV = TIME * windSpeed + worldVertex.xz * windScale;
|
||||
float angle = texture( windNoise, windUV + windNoiseAngleOffset).r * PI * 2.0;
|
||||
float strength = texture( windNoise, windUV + windNoiseStrengthOffset ).r * windStrength;
|
||||
|
@ -127,10 +127,10 @@ void vertex()
|
|||
|
||||
if ( obstaclesEnabeld )
|
||||
{
|
||||
worldVertex = deform( worldVertex, obstacle1 );
|
||||
worldVertex = deform( worldVertex, obstacle2 );
|
||||
worldVertex = deform( worldVertex, obstacle3 );
|
||||
worldVertex = deform( worldVertex, obstacle4 );
|
||||
worldVertex = deform( worldVertex, obstacle1 );
|
||||
worldVertex = deform( worldVertex, obstacle2 );
|
||||
worldVertex = deform( worldVertex, obstacle3 );
|
||||
worldVertex = deform( worldVertex, obstacle4 );
|
||||
|
||||
worldVertex = limitDeform( originalWorldVertex, worldVertex );
|
||||
}
|
||||
|
@ -138,31 +138,31 @@ void vertex()
|
|||
VERTEX = worldToLocal( worldVertex, MODEL_MATRIX );
|
||||
float minY = min( VERTEX.y, 0 ); // VERTEX.y = mix( VERTEX.y, max( 0, VERTEX.y - strength * windAmount), windHeightCompensation * 2.0f );
|
||||
VERTEX.y = mix( VERTEX.y, max( minY, VERTEX.y - strength * windAmount), windHeightCompensation * 4.0f );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void fragment()
|
||||
void fragment()
|
||||
{
|
||||
vec2 base_uv = UV;
|
||||
|
||||
vec4 albedo_tex = texture(texture_albedo, base_uv);
|
||||
ALBEDO = albedoColor * albedo_tex.rgb;
|
||||
BACKLIGHT = ALBEDO * albedoToBacklight + backlight;
|
||||
|
||||
|
||||
|
||||
|
||||
float metallic_tex = dot(texture(texture_metallic, base_uv), metallic_texture_channel);
|
||||
METALLIC = metallic_tex * metallic;
|
||||
SPECULAR = specular;
|
||||
|
||||
|
||||
vec4 roughness_texture_channel = vec4(1.0, 0.0, 0.0, 0.0);
|
||||
float roughness_tex = dot(texture(texture_roughness, base_uv), roughness_texture_channel);
|
||||
ROUGHNESS = roughness_tex * roughness;
|
||||
|
||||
NORMAL_MAP = texture(texture_normal, base_uv).rgb;
|
||||
NORMAL_MAP_DEPTH = normal_scale;
|
||||
|
||||
|
||||
|
||||
AO = dot(texture(texture_ambient_occlusion, base_uv), ao_texture_channel);
|
||||
AO_LIGHT_AFFECT = ao_light_affect;
|
||||
|
|
|
@ -47,6 +47,7 @@ namespace Rokojori
|
|||
particles.FractDelta = false;
|
||||
|
||||
particles.CustomAabb = Box3.WithSize( 10000 );
|
||||
|
||||
|
||||
processMaterial.positionVariance.Set( renderLayer.renderer.noise );
|
||||
processMaterial.rotationVariance.Set( renderLayer.renderer.noise );
|
||||
|
@ -60,6 +61,8 @@ namespace Rokojori
|
|||
particles.DrawPasses = 1;
|
||||
particles.DrawPass1 = meshInstance.Mesh;
|
||||
|
||||
particles.CastShadow = GeometryInstance3D.ShadowCastingSetting.Off;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue