Skip to content

gdpit/godot-geomops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Using GeomOpsParams3D

var params_a := GeomOpsParams3D.new()
params_a.shape     = ...
params_a.transform = ...

var params_b := GeomOpsParams3D.new()
params_b.shape     = ...
params_b.transform = ...

var result := GeomOpsResult3D.new()

if GeomOps3D.closest_to_shape(params_a, params_b, result):
    print(result.point_a)
    print(result.point_b)

if GeomOps3D.closest_to_point(params_a, point, result):
    ...

Using CollisionShape3D

var collision_shape_a: CollisionShape3D = ...
var collision_shape_b: CollisionShape3D = ...

var result := GeomOpsResult3D.new()

if GeomOps3D.node_closest_to_shape(collision_shape_a, collision_shape_b, result):
    print(result.point_a)
    print(result.point_b)

if GeomOps3D.node_closest_to_point(collision_shape_a, point, result):
    ...

Build Instructions

1. Clone repository with submodules

git clone --recurse-submodules https://github.com/gdpit/godot-geomops.git
cd godot-geomops

If you already cloned:

git submodule update --init --recursive

2. Generate extension_api.json

Run this in a terminal using the same Godot version you target:

godot.exe --dump-extension-api

This will generate extension_api.json in the current working directory.

Move extension_api.json into the root of the repository folder godot-geomops/.

3. Create and activate a Python virtual environment (recommended)

python -m venv venv

Activate it:

venv\Scripts\activate

4. Install build dependency

pip install scons

5. Build godot-cpp

cd godot-cpp
scons platform=<platform> custom_api_file=../extension_api.json
cd ..

6. Build the addon

scons platform=<platform>

About

GDExtension for computing closest points between two Shape3D objects, or between a Shape3D and a Vector3 in Godot.

Topics

Resources

License

Stars

Watchers

Forks

Contributors