-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rapier wins! At least with boxes...
- Loading branch information
0 parents
commit e6fcb71
Showing
35 changed files
with
1,786 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
bin/ | ||
target/ | ||
lib/ | ||
logs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[gd_resource type="NativeScript" load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/3d_batcher/gd_3d_batcher.gdnlib" type="GDNativeLibrary" id=1] | ||
|
||
[resource] | ||
class_name = "BatchedMeshInstance" | ||
library = ExtResource( 1 ) | ||
script_class_name = "BatchedMeshInstance" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[gd_resource type="NativeScript" load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/3d_batcher/gd_3d_batcher.gdnlib" type="GDNativeLibrary" id=1] | ||
|
||
[resource] | ||
resource_name = "BatchedMeshManager" | ||
class_name = "BatchedMeshManager" | ||
library = ExtResource( 1 ) | ||
script_class_name = "BatchedMeshManager" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[resource] | ||
|
||
entry/X11.64="res://addons/3d_batcher/lib/libgd_3d_batcher.so" | ||
dependency/X11.64=[ ] | ||
|
||
[general] | ||
|
||
singleton=false | ||
load_once=true | ||
symbol_prefix="godot_" | ||
reloadable=true | ||
|
||
[entry] | ||
|
||
OSX.64="res://addons/3d_batcher/lib/libgd_3d_batcher.dylib" | ||
Windows.64="res://addons/3d_batcher/lib/gd_3d_batcher.dll" | ||
X11.64="res://addons/3d_batcher/lib/libgd_3d_batcher.so" | ||
|
||
[dependencies] | ||
|
||
OSX.64=[ ] | ||
Windows.64=[ ] | ||
X11.64=[ ] |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[plugin] | ||
|
||
name="3D Batcher" | ||
description="Automatically batch nodes with the same mesh and material." | ||
author="David Hoppenbrouwers" | ||
version="0.1" | ||
script="plugin.gd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
tool | ||
extends EditorPlugin | ||
|
||
|
||
const AUTOLOAD_SCRIPT := "batched_mesh_manager.gdns" | ||
|
||
var autoload = null | ||
|
||
|
||
func _enter_tree() -> void: | ||
autoload = preload(AUTOLOAD_SCRIPT).new() | ||
add_child(autoload) | ||
|
||
|
||
func _exit_tree() -> void: | ||
autoload.queue_free() | ||
autoload = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[gd_resource type="NativeScript" load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/rapier3d/rapier3d.gdnlib" type="GDNativeLibrary" id=1] | ||
|
||
[resource] | ||
class_name = "Box" | ||
library = ExtResource( 1 ) | ||
script_class_name = "Rapier3D_Box" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[general] | ||
|
||
singleton=false | ||
load_once=true | ||
symbol_prefix="gd_rapier3d_" | ||
reloadable=true | ||
|
||
[entry] | ||
|
||
X11.64="res://addons/rapier3d/lib/libgodot_rapier3d.so" | ||
|
||
[dependencies] | ||
|
||
X11.64=[ ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[gd_resource type="NativeScript" load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/rapier3d/rapier3d.gdnlib" type="GDNativeLibrary" id=1] | ||
|
||
[resource] | ||
class_name = "Rapier3D" | ||
library = ExtResource( 1 ) | ||
script_class_name = "Rapier3D" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[gd_resource type="NativeScript" load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/rapier3d/rapier3d.gdnlib" type="GDNativeLibrary" id=1] | ||
|
||
[resource] | ||
class_name = "RigidBody" | ||
library = ExtResource( 1 ) | ||
script_class_name = "Rapier3D_RigidBody" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hard_tabs = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[gd_resource type="NativeScript" load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/rapier3d/rapier3d.gdnlib" type="GDNativeLibrary" id=1] | ||
|
||
[resource] | ||
resource_name = "StaticBody" | ||
class_name = "StaticBody" | ||
library = ExtResource( 1 ) | ||
script_class_name = "Rapier3D_StaticBody" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[gd_scene load_steps=5 format=2] | ||
|
||
[ext_resource path="res://addons/3d_batcher/batched_mesh_instance.gdns" type="Script" id=3] | ||
|
||
[sub_resource type="BoxShape" id=1] | ||
extents = Vector3( 0.5, 0.5, 0.5 ) | ||
|
||
[sub_resource type="SpatialMaterial" id=2] | ||
vertex_color_use_as_albedo = true | ||
|
||
[sub_resource type="CubeMesh" id=3] | ||
material = SubResource( 2 ) | ||
size = Vector3( 1, 1, 1 ) | ||
|
||
[node name="Box" type="RigidBody"] | ||
input_ray_pickable = false | ||
|
||
[node name="Shape" type="CollisionShape" parent="."] | ||
shape = SubResource( 1 ) | ||
|
||
[node name="Mesh" type="Spatial" parent="."] | ||
script = ExtResource( 3 ) | ||
mesh = SubResource( 3 ) | ||
use_color = true | ||
color = Color( 1, 1, 1, 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[gd_scene load_steps=6 format=2] | ||
|
||
[ext_resource path="res://addons/rapier3d/box.gdns" type="Script" id=1] | ||
[ext_resource path="res://addons/rapier3d/rigid_body.gdns" type="Script" id=2] | ||
[ext_resource path="res://addons/3d_batcher/batched_mesh_instance.gdns" type="Script" id=3] | ||
|
||
[sub_resource type="SpatialMaterial" id=2] | ||
vertex_color_use_as_albedo = true | ||
|
||
[sub_resource type="CubeMesh" id=1] | ||
material = SubResource( 2 ) | ||
size = Vector3( 1, 1, 1 ) | ||
|
||
[node name="Box" type="Spatial"] | ||
script = ExtResource( 2 ) | ||
__meta__ = { | ||
"_edit_group_": true | ||
} | ||
|
||
[node name="Shape" type="Spatial" parent="."] | ||
script = ExtResource( 1 ) | ||
extents = Vector3( 0.5, 0.5, 0.5 ) | ||
|
||
[node name="Mesh" type="Spatial" parent="."] | ||
script = ExtResource( 3 ) | ||
mesh = SubResource( 1 ) | ||
use_color = true | ||
color = Color( 1, 1, 1, 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
extends Node | ||
|
||
|
||
export var x := 10 | ||
export var y := 10 | ||
export var z := 10 | ||
export var origin := Vector3.ONE | ||
export var offset := Vector3.ONE | ||
export var box_rapier3d: PackedScene | ||
export var box_godot: PackedScene | ||
export var use_rapier3d := true | ||
export var colors := PoolColorArray([Color.white, Color.red, Color.green, Color.blue, Color.yellow, Color.magenta]) | ||
|
||
|
||
func _ready(): | ||
var i := 0 | ||
for a in x: | ||
for b in y: | ||
for c in z: | ||
var n: Spatial = (box_rapier3d if use_rapier3d else box_godot).instance() | ||
n.get_node("Mesh").color = colors[i % len(colors)] | ||
i += 1 | ||
n.translation = Vector3(a, b, c) * offset + origin | ||
add_child(n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
[gd_scene load_steps=10 format=2] | ||
|
||
[ext_resource path="res://addons/rapier3d/rapier3d.gdns" type="Script" id=1] | ||
[ext_resource path="res://addons/rapier3d/static_body.gdns" type="Script" id=2] | ||
[ext_resource path="res://addons/rapier3d/box.gdns" type="Script" id=3] | ||
[ext_resource path="res://box_rapier3d.tscn" type="PackedScene" id=4] | ||
[ext_resource path="res://boxes.gd" type="Script" id=5] | ||
[ext_resource path="res://box_godot.tscn" type="PackedScene" id=6] | ||
[ext_resource path="res://stats.gd" type="Script" id=7] | ||
|
||
[sub_resource type="CubeMesh" id=1] | ||
size = Vector3( 100, 1, 100 ) | ||
|
||
[sub_resource type="BoxShape" id=2] | ||
extents = Vector3( 50, 0.5, 50 ) | ||
|
||
[node name="Node" type="Node"] | ||
script = ExtResource( 5 ) | ||
x = 16 | ||
y = 16 | ||
z = 16 | ||
box_rapier3d = ExtResource( 4 ) | ||
box_godot = ExtResource( 6 ) | ||
|
||
[node name="Floor Rapier3D" type="Spatial" parent="."] | ||
script = ExtResource( 2 ) | ||
__meta__ = { | ||
"_edit_group_": true | ||
} | ||
|
||
[node name="Shape" type="Spatial" parent="Floor Rapier3D"] | ||
script = ExtResource( 3 ) | ||
extents = Vector3( 50, 0.5, 50 ) | ||
|
||
[node name="MeshInstance" type="MeshInstance" parent="Floor Rapier3D"] | ||
mesh = SubResource( 1 ) | ||
material/0 = null | ||
|
||
[node name="Floor Godot" type="StaticBody" parent="."] | ||
|
||
[node name="Shape" type="CollisionShape" parent="Floor Godot"] | ||
shape = SubResource( 2 ) | ||
|
||
[node name="Rapier" type="Node" parent="."] | ||
script = ExtResource( 1 ) | ||
|
||
[node name="Camera" type="Camera" parent="."] | ||
transform = Transform( 0, -0.5, 0.866025, 0, 0.866025, 0.5, -1, 0, 0, 41, 25, 3 ) | ||
|
||
[node name="DirectionalLight" type="DirectionalLight" parent="."] | ||
transform = Transform( -0.965926, -0.12941, 0.224144, 0, 0.866025, 0.5, -0.258819, 0.482963, -0.836516, 0, 7, -13 ) | ||
shadow_enabled = true | ||
|
||
[node name="Stats" type="Panel" parent="."] | ||
margin_right = 186.0 | ||
margin_bottom = 94.0 | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} | ||
|
||
[node name="Stats" type="Label" parent="Stats"] | ||
process_priority = 10 | ||
margin_right = 120.0 | ||
margin_bottom = 35.0 | ||
script = ExtResource( 7 ) | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[gd_resource type="Environment" load_steps=2 format=2] | ||
|
||
[sub_resource type="ProceduralSky" id=1] | ||
|
||
[resource] | ||
background_mode = 2 | ||
background_sky = SubResource( 1 ) | ||
ambient_light_energy = 0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[preset.0] | ||
|
||
name="Linux/X11" | ||
platform="Linux/X11" | ||
runnable=true | ||
custom_features="" | ||
export_filter="all_resources" | ||
include_filter="" | ||
exclude_filter="" | ||
export_path="bin/rapier_test.x86_64" | ||
patch_list=PoolStringArray( ) | ||
script_export_mode=1 | ||
script_encryption_key="" | ||
|
||
[preset.0.options] | ||
|
||
texture_format/bptc=false | ||
texture_format/s3tc=true | ||
texture_format/etc=false | ||
texture_format/etc2=false | ||
texture_format/no_bptc_fallbacks=true | ||
binary_format/64_bits=true | ||
binary_format/embed_pck=false | ||
custom_template/release="" | ||
custom_template/debug="" |
Empty file.
Oops, something went wrong.