Spline Tool (曲线工具)

我就是直接移除了所有节点,然后添加了一些新的。
我试过先移除节点,在添加,和添加完了再移除。
只是调用了removeNode,没调用其它函数。
就只是removeNode和addNode

大佬 可以不可以出一个 utils.createMesh自定义的教程

有点麻烦,你可以参考下这两个文件

https://github.com/2youyou2/spline-tool/blob/be99af667ff2ab160dc985ffa9faf2a8a9a5afaa/utils/mesh-processing/fixed-model-mesh.ts

https://github.com/2youyou2/spline-tool/blob/be99af667ff2ab160dc985ffa9faf2a8a9a5afaa/utils/mesh-processing/mesh-utility.ts

1赞

支持了 lightmap 烘焙 (scatter 描绘完后要重开一下编辑器才能烘焙)

大佬能帮看看这个CANNON物理引擎问题吗

@JayceLai 快来接客了

我去。我要mark一下。

有性能测试 吗?

大佬,能不能搞个集成版本啊,从码云上搞下来的不完整呢!!!!!!!!

你下载对应的 submodule 放进去也可以

大佬能不能看看运行时更新节点的问题呢

在运行时,我这么写,大大多数时候,形状是不会更新的。
我用的是Sower模式

upboxs(spline:Spline, points:Vec3[])
{
    if( points.length <= spline.nodes.length)
    {
        for(let i = 0; i < this.path.length; i+=3)
        { 
            spline._nodes[i].position.set(points[i]);
            spline._nodes[i].direction.set(points[i]);
        }
        spline._nodes = spline.nodes.slice(0,points.length)
    }
    else
    {
        let x = spline.nodes.length;
        for(let i = 0 ; i < spline.nodes.length; i++)
        {
            spline._nodes[i].position.set(points[i]);
            spline._nodes[i].direction.set(points[i]);
        }
        for(let i = x; i < points.length; i ++)
        {
            let v  = points[i];
            spline.addNode(v,v);
        }
    }        
}

设置完后调用spline._createCurves();形状就会更新了。

我觉得你这个功能可以加到编辑器上面去:+1:

大佬,使用mesh-tiling,运行时动态创建曲线,帧率掉到了四五帧,这个有办法解决吗?

1赞

大佬运行时更新频率多高呢,是使用的mesh tiling吗?

求问大佬一个问题,我看到代码,mesh-bender在fill的时候,是对模型的x轴进行重复/延展的。

如果我要修改成,比如对模型的z轴,或者y轴进行重复,我要修改哪里呀?感谢!

那位大佬又完整的Demo可以分享下吗,我直接下zip格式老是报错,git有特别慢。

1赞

Cloning into ‘F:/Game/spline-tool-examples/spline-tool-examples/assets/shader-lib’…
warning: templates not found in C:/Program Files/Git/mingw64/share/git-core/templates
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of ‘git@github.com:2youyou2/shader-lib.git’ into submodule path ‘F:/Game/spline-tool-examples/spline-tool-examples/assets/shader-lib’ failed
Failed to clone ‘assets/shader-lib’. Retry scheduled
Cloning into ‘F:/Game/spline-tool-examples/spline-tool-examples/assets/shader-lib’…
warning: templates not found in C:/Program Files/Git/mingw64/share/git-core/templates
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of ‘git@github.com:2youyou2/shader-lib.git’ into submodule path ‘F:/Game/spline-tool-examples/spline-tool-examples/assets/shader-lib’ failed
Failed to clone ‘assets/shader-lib’ a second time, aborting