Commit ef701ad3 authored by Houkime's avatar Houkime

initial commit

parents
*.import
*~
[submodule "godot_headers"]
path = godot_headers
url = https://github.com/GodotNativeTools/godot_headers
CC := gcc
CCFLAGS := -std=c11 -fPIC -Isrc -I./godot_headers/
LDFLAGS := -rdynamic -shared -pthread -lmodbus
OBJ := src/simple.o
TARGETS := simple/bin/libsimple.so
LIBS :=
.PHONY: all
all: $(TARGETS)
$(OBJ): %.o : %.c
$(CC) -c -o $@ $< $(CCFLAGS)
$(TARGETS): % : $(OBJ)
$(CC) -o $@ $(LIBS) $^ $(CCFLAGS) $(LDFLAGS)
Subproject commit 98ee82599dfe07e17983ad831f5e9ac41068667f
*.import
bin/*.so
\ No newline at end of file
extends Spatial
export var speed = 1.0
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
var mat = $belt/graphics.get_surface_material(0)
mat.set_shader_param("speed",speed)
$StaticBody.constant_linear_velocity.x = speed
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
[gd_scene load_steps=13 format=2]
[ext_resource path="res://outline.tres" type="Material" id=1]
[ext_resource path="res://belt.shader" type="Shader" id=2]
[ext_resource path="res://Conveyor.gd" type="Script" id=3]
[ext_resource path="res://test_bevel.obj" type="ArrayMesh" id=4]
[sub_resource type="CubeMesh" id=1]
[sub_resource type="SpatialMaterial" id=2]
flags_unshaded = true
albedo_color = Color( 0.564706, 0.564706, 0.564706, 1 )
[sub_resource type="ArrayMesh" id=3]
surfaces/0 = {
"aabb": AABB( -1.02887, -1.02887, -1.02887, 2.05773, 2.05774, 2.05774 ),
"array_data": PoolByteArray( 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 0, 0, 0, 0, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 85, 57, 0, 0, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 85, 53, 0, 0, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 0, 60, 0, 0, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 0, 0, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 85, 57, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 85, 53, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 0, 60, 0, 56, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 63, 127, 0, 0, 0, 0, 0, 129, 127, 85, 53, 0, 0, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 191, 129, 0, 0, 0, 0, 0, 127, 127, 0, 0, 0, 56, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 191, 127, 0, 0, 0, 0, 0, 129, 127, 85, 57, 0, 0, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 63, 129, 0, 0, 0, 0, 0, 127, 127, 85, 53, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 63, 127, 0, 0, 0, 0, 0, 129, 127, 85, 53, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 191, 129, 0, 0, 0, 0, 0, 127, 127, 0, 0, 0, 60, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 191, 127, 0, 0, 0, 0, 0, 129, 127, 85, 57, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 63, 129, 0, 0, 0, 0, 0, 127, 127, 85, 53, 0, 60, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 63, 0, 127, 0, 0, 129, 0, 0, 127, 85, 53, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 63, 0, 129, 0, 0, 127, 0, 0, 127, 85, 57, 0, 56, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 63, 0, 127, 0, 0, 129, 0, 0, 127, 85, 57, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 63, 0, 129, 0, 0, 127, 0, 0, 127, 0, 60, 0, 56, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 191, 0, 127, 0, 0, 129, 0, 0, 127, 85, 53, 0, 60, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 191, 0, 129, 0, 0, 127, 0, 0, 127, 85, 57, 0, 60, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 191, 0, 127, 0, 0, 129, 0, 0, 127, 85, 57, 0, 60, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 191, 0, 129, 0, 0, 127, 0, 0, 127, 0, 60, 0, 60 ),
"array_index_data": PoolByteArray( 0, 0, 4, 0, 2, 0, 2, 0, 4, 0, 6, 0, 1, 0, 5, 0, 3, 0, 3, 0, 5, 0, 7, 0, 8, 0, 12, 0, 10, 0, 10, 0, 12, 0, 14, 0, 9, 0, 13, 0, 11, 0, 11, 0, 13, 0, 15, 0, 16, 0, 20, 0, 18, 0, 18, 0, 20, 0, 22, 0, 17, 0, 21, 0, 19, 0, 19, 0, 21, 0, 23, 0 ),
"blend_shape_data": [ ],
"format": 97559,
"index_count": 36,
"primitive": 4,
"skeleton_aabb": [ ],
"vertex_count": 24
}
[sub_resource type="CubeMesh" id=4]
[sub_resource type="ArrayMesh" id=5]
surfaces/0 = {
"aabb": AABB( -1.02887, -1.02887, -1.02887, 2.05773, 2.05774, 2.05774 ),
"array_data": PoolByteArray( 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 0, 0, 0, 0, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 85, 57, 0, 0, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 85, 53, 0, 0, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 0, 60, 0, 0, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 0, 0, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 85, 57, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 85, 53, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 0, 60, 0, 56, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 63, 127, 0, 0, 0, 0, 0, 129, 127, 85, 53, 0, 0, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 191, 129, 0, 0, 0, 0, 0, 127, 127, 0, 0, 0, 56, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 191, 127, 0, 0, 0, 0, 0, 129, 127, 85, 57, 0, 0, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 63, 129, 0, 0, 0, 0, 0, 127, 127, 85, 53, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 63, 127, 0, 0, 0, 0, 0, 129, 127, 85, 53, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 191, 129, 0, 0, 0, 0, 0, 127, 127, 0, 0, 0, 60, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 191, 127, 0, 0, 0, 0, 0, 129, 127, 85, 57, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 63, 129, 0, 0, 0, 0, 0, 127, 127, 85, 53, 0, 60, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 63, 0, 127, 0, 0, 129, 0, 0, 127, 85, 53, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 63, 0, 129, 0, 0, 127, 0, 0, 127, 85, 57, 0, 56, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 63, 0, 127, 0, 0, 129, 0, 0, 127, 85, 57, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 63, 0, 129, 0, 0, 127, 0, 0, 127, 0, 60, 0, 56, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 191, 0, 127, 0, 0, 129, 0, 0, 127, 85, 53, 0, 60, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 191, 0, 129, 0, 0, 127, 0, 0, 127, 85, 57, 0, 60, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 191, 0, 127, 0, 0, 129, 0, 0, 127, 85, 57, 0, 60, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 191, 0, 129, 0, 0, 127, 0, 0, 127, 0, 60, 0, 60 ),
"array_index_data": PoolByteArray( 0, 0, 4, 0, 2, 0, 2, 0, 4, 0, 6, 0, 1, 0, 5, 0, 3, 0, 3, 0, 5, 0, 7, 0, 8, 0, 12, 0, 10, 0, 10, 0, 12, 0, 14, 0, 9, 0, 13, 0, 11, 0, 11, 0, 13, 0, 15, 0, 16, 0, 20, 0, 18, 0, 18, 0, 20, 0, 22, 0, 17, 0, 21, 0, 19, 0, 19, 0, 21, 0, 23, 0 ),
"blend_shape_data": [ ],
"format": 97559,
"index_count": 36,
"primitive": 4,
"skeleton_aabb": [ ],
"vertex_count": 24
}
[sub_resource type="PlaneMesh" id=6]
[sub_resource type="ShaderMaterial" id=7]
shader = ExtResource( 2 )
shader_param/bg_color = null
shader_param/fg_color = Color( 0.976471, 0.917647, 0.0196078, 1 )
shader_param/scale = null
shader_param/speed = 0.1
[sub_resource type="ConvexPolygonShape" id=8]
points = PoolVector3Array( -0.986604, -0.9557, -0.832278, -0.986604, -0.9557, 0.832278, -0.986604, -0.832278, -0.9557, -0.986604, -0.832278, 0.9557, -0.986604, 0.832278, -0.9557, -0.986604, 0.832278, 0.9557, -0.986604, 0.9557, -0.832278, -0.986604, 0.9557, 0.832278, -0.985938, -0.924172, -0.893482, -0.9557, -0.986604, -0.832278, -0.9557, -0.986604, 0.832278, -0.9557, -0.832278, -0.986604, -0.9557, -0.832278, 0.986604, -0.9557, 0.832278, -0.986604, -0.9557, 0.832278, 0.986604, -0.9557, 0.986604, -0.832278, -0.9557, 0.986604, 0.832278, -0.9537, -0.9537, -0.9537, -0.9537, -0.9537, 0.9537, -0.9537, 0.9537, -0.9537, -0.9537, 0.9537, 0.9537, -0.832278, -0.986604, -0.9557, -0.832278, -0.986604, 0.9557, -0.832278, -0.9557, -0.986604, -0.832278, -0.9557, 0.986604, -0.832278, 0.9557, -0.986604, -0.832278, 0.9557, 0.986604, -0.832278, 0.986604, -0.9557, -0.832278, 0.986604, 0.9557, 0.832278, -0.986604, -0.9557, 0.832278, -0.986604, 0.9557, 0.832278, -0.9557, -0.986604, 0.832278, -0.9557, 0.986604, 0.832278, 0.9557, -0.986604, 0.832278, 0.9557, 0.986604, 0.832278, 0.986604, -0.9557, 0.832278, 0.986604, 0.9557, 0.893315, 0.924199, 0.985967, 0.9537, -0.9537, -0.9537, 0.9537, -0.9537, 0.9537, 0.9537, 0.9537, -0.9537, 0.9537, 0.9537, 0.9537, 0.9557, -0.986604, -0.832278, 0.9557, -0.986604, 0.832278, 0.9557, -0.832278, -0.986604, 0.9557, -0.832278, 0.986604, 0.9557, 0.832278, -0.986604, 0.9557, 0.832278, 0.986604, 0.9557, 0.986604, -0.832278, 0.9557, 0.986604, 0.832278, 0.986604, -0.9557, -0.832278, 0.986604, -0.9557, 0.832278, 0.986604, -0.832278, -0.9557, 0.986604, -0.832278, 0.9557, 0.986604, 0.832278, -0.9557, 0.986604, 0.832278, 0.9557, 0.986604, 0.9557, -0.832278, 0.986604, 0.9557, 0.832278 )
[node name="Conveyor" type="Spatial"]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 )
script = ExtResource( 3 )
[node name="base" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 0.8, 0, 0, 0, 1, 0, -0.2, 0 )
mesh = SubResource( 1 )
material/0 = SubResource( 2 )
[node name="MeshInstance" type="MeshInstance" parent="base"]
material_override = ExtResource( 1 )
mesh = SubResource( 3 )
material/0 = null
[node name="belt" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 0.2, 0, 0, 0, 1, 0, 0.8, 0 )
mesh = SubResource( 4 )
material/0 = null
[node name="MeshInstance" type="MeshInstance" parent="belt"]
mesh = SubResource( 5 )
material/0 = ExtResource( 1 )
[node name="graphics" type="MeshInstance" parent="belt"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.02021, 0 )
mesh = SubResource( 6 )
material/0 = SubResource( 7 )
[node name="StaticBody" type="StaticBody" parent="."]
constant_linear_velocity = Vector3( 0.1, 0, 0 )
[node name="test_bevel" type="MeshInstance" parent="StaticBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6, 0 )
visible = false
mesh = ExtResource( 4 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="StaticBody"]
transform = Transform( 1.2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
shape = SubResource( 8 )
extends KinematicBody
var phase = 0.0
var freq = 1.0
var rot_freq = 2.0
var amplitude = 1.0
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func _process(delta):
phase = wrapf(phase + freq*delta,0,2*PI)
translation = Vector3(0,amplitude*sin(phase),0)
rotate_x(freq*delta)
rotate_y(freq*delta)
rotate_z(freq*delta/2.0)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
extends Node
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
extends Node
class_name ModbusServer
var c_backend = load('res://simple.gdns').new()
var hold_register = 17 setget set_holding_register, get_holding_register #single for now
#var coils = [0,0,0,0]
func _init(address, port):
c_backend.start_server(address, port)
func set_holding_register(value):
c_backend.set_holding_register(value)
func get_holding_register():
return c_backend.get_holding_register()
func get_coil():
return c_backend.get_coil()
extends Spatial
class_name ModbusSpatial
export var address = "192.168.56.1"
export var port = 5020
var ms
func _ready():
print("creating sth with " + address + " " + str(port))
ms = ModbusServer.new(address, port)
[gd_scene load_steps=14 format=2]
[ext_resource path="res://SimplePusher.gd" type="Script" id=1]
[ext_resource path="res://Spawner.gd" type="Script" id=2]
[ext_resource path="res://pushermat.tres" type="Material" id=3]
[ext_resource path="res://Sensor.tscn" type="PackedScene" id=4]
[ext_resource path="res://Conveyor.tscn" type="PackedScene" id=5]
[ext_resource path="res://blockshader_ghost.shader" type="Shader" id=6]
[sub_resource type="CubeMesh" id=1]
[sub_resource type="ShaderMaterial" id=2]
shader = ExtResource( 6 )
shader_param/color = Color( 0.227451, 0.521569, 0.521569, 1 )
shader_param/scale = 113.0
[sub_resource type="CubeMesh" id=3]
[sub_resource type="CubeMesh" id=4]
[sub_resource type="SpatialMaterial" id=5]
flags_unshaded = true
albedo_color = Color( 0.207843, 0.207843, 0.207843, 1 )
[sub_resource type="ConvexPolygonShape" id=6]
points = PoolVector3Array( -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1 )
[sub_resource type="CylinderMesh" id=7]
[node name="Pushertest" type="Spatial"]
[node name="Spawner" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0 )
script = ExtResource( 2 )
[node name="MeshInstance" type="MeshInstance" parent="Spawner"]
transform = Transform( 0.48, 0, 0, 0, 0.48, 0, 0, 0, 0.48, 0, 0, 0 )
mesh = SubResource( 1 )
material/0 = SubResource( 2 )
[node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 2.01221, 6.90506 )
far = 8192.0
[node name="Pusher" type="Spatial" parent="."]
transform = Transform( -8.14603e-08, 0, -0.5, 0, 0.5, 0, 0.5, 0, -8.14603e-08, 5, 1, -1 )
script = ExtResource( 1 )
port = 5040
[node name="MeshInstance" type="MeshInstance" parent="Pusher"]
transform = Transform( 0.8, 0, 0, 0, 1, 0, 0, 0, 1, -0.2, 0, 0 )
mesh = SubResource( 3 )
material/0 = ExtResource( 3 )
[node name="PusherHandle" type="Spatial" parent="Pusher"]
[node name="MeshInstance2" type="MeshInstance" parent="Pusher/PusherHandle"]
transform = Transform( 0.2, 0, 0, 0, 1, 0, 0, 0, 1, 0.8, 0, 0 )
mesh = SubResource( 4 )
material/0 = SubResource( 5 )
[node name="KinematicBody" type="KinematicBody" parent="Pusher/PusherHandle"]
[node name="CollisionShape" type="CollisionShape" parent="Pusher/PusherHandle/KinematicBody"]
transform = Transform( 0.2, 0, 0, 0, 1, 0, 0, 0, 1, 0.8, 0, 0 )
shape = SubResource( 6 )
[node name="shaft_handle" type="Spatial" parent="Pusher"]
transform = Transform( -1.31134e-08, -0.1, 0, 0.3, -4.37114e-09, 0, 0, 0, 0.3, 0.6, 0, 0 )
[node name="MeshInstance2" type="MeshInstance" parent="Pusher/shaft_handle"]
transform = Transform( 1, 7.10543e-15, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 )
mesh = SubResource( 7 )
material/0 = null
[node name="Conveyor" parent="." instance=ExtResource( 5 )]
[node name="Conveyor2" parent="." instance=ExtResource( 5 )]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1, 0, 0 )
[node name="Conveyor3" parent="." instance=ExtResource( 5 )]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 2, 0, 0 )
[node name="Conveyor4" parent="." instance=ExtResource( 5 )]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 3, 0, 0 )
[node name="Conveyor5" parent="." instance=ExtResource( 5 )]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 4, 0, 0 )
[node name="Conveyor6" parent="." instance=ExtResource( 5 )]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 5, 0, 0 )
[node name="Conveyor7" parent="." instance=ExtResource( 5 )]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 6, 0, 0 )
[node name="Sensor" parent="." instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 4, 0 )
extends ModbusSpatial
func _physics_process(delta):
ms.hold_register = floor($RayCast.distance*100.0)
This source diff could not be displayed because it is too large. You can view the blob instead.
[gd_scene load_steps=10 format=2]
[ext_resource path="res://Kinematic_Cube.gd" type="Script" id=1]
[ext_resource path="res://distance_readout.gd" type="Script" id=2]
[ext_resource path="res://Sensor.gd" type="Script" id=3]
[ext_resource path="res://Sensor.tscn" type="PackedScene" id=4]
[sub_resource type="CubeMesh" id=2]
[sub_resource type="SpatialMaterial" id=3]
flags_unshaded = true
albedo_color = Color( 0.87451, 1, 0, 1 )
[sub_resource type="ArrayMesh" id=4]
surfaces/0 = {
"aabb": AABB( -1.02887, -1.02887, -1.02887, 2.05773, 2.05774, 2.05774 ),
"array_data": PoolByteArray( 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 0, 0, 0, 0, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 85, 57, 0, 0, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 85, 53, 0, 0, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 0, 60, 0, 0, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 0, 0, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 85, 57, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 63, 0, 0, 127, 0, 127, 0, 0, 127, 85, 53, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 191, 0, 0, 129, 0, 129, 0, 0, 127, 0, 60, 0, 56, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 63, 127, 0, 0, 0, 0, 0, 129, 127, 85, 53, 0, 0, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 191, 129, 0, 0, 0, 0, 0, 127, 127, 0, 0, 0, 56, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 191, 127, 0, 0, 0, 0, 0, 129, 127, 85, 57, 0, 0, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 63, 129, 0, 0, 0, 0, 0, 127, 127, 85, 53, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 63, 127, 0, 0, 0, 0, 0, 129, 127, 85, 53, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 191, 129, 0, 0, 0, 0, 0, 127, 127, 0, 0, 0, 60, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 191, 127, 0, 0, 0, 0, 0, 129, 127, 85, 57, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 63, 129, 0, 0, 0, 0, 0, 127, 127, 85, 53, 0, 60, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 63, 0, 127, 0, 0, 129, 0, 0, 127, 85, 53, 0, 56, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 63, 0, 129, 0, 0, 127, 0, 0, 127, 85, 57, 0, 56, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 63, 0, 127, 0, 0, 129, 0, 0, 127, 85, 57, 0, 56, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 63, 0, 129, 0, 0, 127, 0, 0, 127, 0, 60, 0, 56, 238, 177, 131, 63, 238, 177, 131, 63, 238, 177, 131, 191, 0, 127, 0, 0, 129, 0, 0, 127, 85, 53, 0, 60, 238, 177, 131, 191, 238, 177, 131, 191, 238, 177, 131, 191, 0, 129, 0, 0, 127, 0, 0, 127, 85, 57, 0, 60, 238, 177, 131, 191, 238, 177, 131, 63, 238, 177, 131, 191, 0, 127, 0, 0, 129, 0, 0, 127, 85, 57, 0, 60, 238, 177, 131, 63, 238, 177, 131, 191, 238, 177, 131, 191, 0, 129, 0, 0, 127, 0, 0, 127, 0, 60, 0, 60 ),
"array_index_data": PoolByteArray( 0, 0, 4, 0, 2, 0, 2, 0, 4, 0, 6, 0, 1, 0, 5, 0, 3, 0, 3, 0, 5, 0, 7, 0, 8, 0, 12, 0, 10, 0, 10, 0, 12, 0, 14, 0, 9, 0, 13, 0, 11, 0, 11, 0, 13, 0, 15, 0, 16, 0, 20, 0, 18, 0, 18, 0, 20, 0, 22, 0, 17, 0, 21, 0, 19, 0, 19, 0, 21, 0, 23, 0 ),
"blend_shape_data": [ ],
"format": 97559,
"index_count": 36,
"primitive": 4,
"skeleton_aabb": [ ],
"vertex_count": 24
}
[sub_resource type="SpatialMaterial" id=5]
flags_unshaded = true
[sub_resource type="BoxShape" id=6]
[node name="SensorTest" type="Spatial"]
[node name="Sensor" type="Spatial" parent="." instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0 )
script = ExtResource( 3 )
[node name="test_equilibrium" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 )
[node name="Kinematic_Cube" type="KinematicBody" parent="test_equilibrium"]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -4.76837e-07, -4.76837e-07 )
script = ExtResource( 1 )
[node name="test_cube" type="MeshInstance" parent="test_equilibrium/Kinematic_Cube"]
mesh = SubResource( 2 )
material/0 = SubResource( 3 )
[node name="MeshInstance" type="MeshInstance" parent="test_equilibrium/Kinematic_Cube/test_cube"]
mesh = SubResource( 4 )
material/0 = SubResource( 5 )
[node name="CollisionShape" type="CollisionShape" parent="test_equilibrium/Kinematic_Cube"]
shape = SubResource( 6 )
[node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 0.88643, 0.462863, 0, -0.462863, 0.88643, 0, 4.71983, 6.1721 )
far = 8192.0
[node name="Label" type="Label" parent="."]
margin_right = 40.0
margin_bottom = 14.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
extends ModbusSpatial
var speed = 1;
var max_extension = 1.0;
var extension = 0;
var min_shaft_len = 0.1; # godot does not like zero-lenth things
func _physics_process(delta):
var needs_to_extend = ms.get_coil()
#var needs_to_extend = false
#var just_to_read = ms.get_coil()
#print(needs_to_extend)
if needs_to_extend and extension < max_extension:
extension = clamp($PusherHandle.translation.x/2.0 + speed * delta, 0, max_extension)
$PusherHandle.translation.x = extension * 2
$shaft_handle.scale.y = max(extension, min_shaft_len)
if !needs_to_extend and extension > 0:
extension = clamp($PusherHandle.translation.x/2.0 - speed * delta, 0, max_extension)
$PusherHandle.translation.x = extension * 2
$shaft_handle.scale.y = max(extension, min_shaft_len)
extends Spatial
[gd_scene load_steps=7 format=2]
[ext_resource path="res://Spatial.gd" type="Script" id=1]
[ext_resource path="res://skyshader.tres" type="Material" id=2]
[ext_resource path="res://Pushertest.tscn" type="PackedScene" id=3]
[ext_resource path="res://firewall.gd" type="Script" id=7]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 13.3624, 1, 18.5475 )
[sub_resource type="SphereMesh" id=2]
flip_faces = true
[node name="MAIN" type="Spatial"]
script = ExtResource( 1 )
[node name="Pushertest" parent="." instance=ExtResource( 3 )]
[node name="Area" type="Area" parent="."]
script = ExtResource( 7 )
__meta__ = {
"_edit_lock_": true
}
[node name="CollisionShape" type="CollisionShape" parent="Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -6.34348, 0 )
shape = SubResource( 1 )
[node name="Sky" type="MeshInstance" parent="."]
transform = Transform( 100, 0, 0, 0, 100, 0, 0, 0, 100, 0, 0, 0 )
mesh = SubResource( 2 )
material/0 = ExtResource( 2 )
__meta__ = {
"_edit_lock_": true
}
extends Spatial
export var frequency = 0.3
onready var timer = Timer.new()
var boxscene = preload("res://TestBox.tscn")
func _ready():
timer.wait_time = 1.0/float(frequency)
timer.connect("timeout",self,"spawn")
add_child(timer)
timer.start()
spawn()
func spawn():
var box = boxscene.instance()
add_child(box)
[gd_scene load_steps=4 format=2]
[ext_resource path="res://basic_cube.tscn" type="PackedScene" id=1]
[sub_resource type="PhysicsMaterial" id=1]
rough = true
[sub_resource type="BoxShape" id=2]
[node name="TestCube" type="RigidBody"]
physics_material_override = SubResource( 1 )
can_sleep = false
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 )
shape = SubResource( 2 )
[node name="test_cube" parent="." instance=ExtResource( 1 )]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 )
[gd_scene load_steps=4 format=2]
[ext_resource path="res://blockshader.shader" type="Shader" id=1]
[sub_resource type="CubeMesh" id=1]
[sub_resource type="ShaderMaterial" id=2]
shader = ExtResource( 1 )
shader_param/color = Color( 0.686275, 0.65098, 0.0784314, 1 )
shader_param/scale = 113.0
[node name="test_cube" type="MeshInstance"]
mesh = SubResource( 1 )
material/0 = SubResource( 2 )
shader_type spatial;
render_mode unshaded;
uniform vec4 bg_color: hint_color;
uniform vec4 fg_color: hint_color;
uniform float scale;
uniform float speed;
bool triangle(float x,float y){
// if (x < 0.3) {
// return false;
// }
if (abs(y-0.5)+x-0.5 > 0.5) {
return false;
}
if (abs(y-0.5)+x-0.5 < 0.3) {
return false;
}
return true;
}
void fragment(){
float x = UV.x;
float y = UV.y;
float unity = 1.0;
x -= TIME*speed;
x = x - floor(x);
if (triangle(x,y)){
ALBEDO = fg_color.xyz;
} else{
ALBEDO = bg_color.xyz;
}
}
shader_type spatial;
render_mode unshaded;
uniform vec4 color: hint_color;
uniform float scale;
void fragment()
{
ALBEDO=color.xyz;
if (cos(UV.x*scale/6.)>=0.9||cos(UV.y*scale/9.)>=0.9){
ALBEDO=vec3(1,1,1);
}
}
\ No newline at end of file
shader_type spatial;
render_mode unshaded;
render_mode blend_add;
uniform vec4 color: hint_color;
uniform float scale;
void fragment()
{
float screen_y = mod(SCREEN_UV.y + TIME/30.0, 1.0);
if (mod(screen_y, 1.0/100.0) <= 0.005){
discard;
}
ALBEDO=color.xyz;
if (cos(UV.x*scale/6.)>=0.9||cos(UV.y*scale/9.)>=0.9){
ALBEDO=vec3(1,1,1);
}
}
\ No newline at end of file
extends Label
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func _process(delta):
text = "Distance: " + str($"../Sensor/RayCast".distance)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
extends Area
func _ready():
connect("body_entered",self,"destroy_intruders")
func destroy_intruders(body):
body.queue_free()
[entry]
X11.64="res://bin/libsimple.so"
[dependencies]
X11.64=[ ]
[general]
singleton=false
load_once=false
symbol_prefix="godot_"
reloadable=true
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_sky = SubResource( 1 )
[gd_resource type="SpatialMaterial" format=2]
[resource]
flags_unshaded = true
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ {
"base": "Node",
"class": "ModbusServer",
"language": "GDScript",
"path": "res://Modbus_Server.gd"
}, {
"base": "Reference",
"class": "ModbusServerNative",
"language": "NativeScript",
"path": "res://simple.gdns"
}, {
"base": "Spatial",
"class": "ModbusSpatial",
"language": "GDScript",
"path": "res://Modbus_Spatial.gd"
} ]
_global_script_class_icons={
"ModbusServer": "",
"ModbusServerNative": "",
"ModbusSpatial": ""
}
[application]
run/main_scene="res://Spatial.tscn"
[physics]
3d/physics_engine="GodotPhysics"
[rendering]
environment/default_environment="res://new_environment.tres"
[gd_resource type="SpatialMaterial" format=2]
[resource]
flags_unshaded = true
albedo_color = Color( 0.988235, 0.694118, 0.0745098, 1 )
extends RayCast
export var maxlength = 10.0
var distance = 0
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
cast_to = Vector3(0,-maxlength,0)
func _physics_process(delta):
if !is_colliding():
$intersection.visible = false
$ray_handle.scale = Vector3(0,distance,0)
return
var collision_p = to_local(get_collision_point())
distance = collision_p.length()
$ray_handle.scale = Vector3(1,distance,1)
$intersection.visible = true
$intersection.translation = collision_p
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
[gd_resource type="NativeScript" load_steps=2 format=2]
[ext_resource path="res://libsimple.gdnlib" type="GDNativeLibrary" id=1]
[resource]
class_name = "ModbusServerNative"
library = ExtResource( 1 )
script_class_name = "ModbusServerNative"
[gd_resource type="ShaderMaterial" load_steps=2 format=2]
[sub_resource type="Shader" id=1]
code = "shader_type spatial;
render_mode unshaded;
uniform float thickness;
uniform float step_theta;
uniform float step_phi;
void fragment(){
if (mod(UV.y,step_theta*abs(1.0+sin(TIME/10.0)/2.0)) < thickness) {
ALBEDO=vec3(255,0,255);
} else{
ALBEDO=vec3(0,0,0);
}
}"
[resource]
shader = SubResource( 1 )
shader_param/thickness = 0.01
shader_param/step_theta = 0.056
shader_param/step_phi = null
# Blender MTL File: 'None'
# Material Count: 1
newmtl Material
Ns 323.999994