setFoliageVertices
Client-side
Replaces the three corners of a foliage patch and rebuilds the native triangle.
Syntax
bool setFoliageVertices(foliage theFoliage, Vector3 v1, Vector3 v2, Vector3 v3)Arguments
theFoliagefoliageFoliage element.
v1Vector3First corner.
v2Vector3Second corner.
v3Vector3Third corner.
Returns
true when the new triangle was accepted and rebuilt; false for a degenerate or non-finite triangle.
Ownership and lifecycle
A foliage element belongs to the resource that created it and joins its element group, so stopping the resource removes its patches without explicit cleanup. Every setter rebuilds the native triangle atomically and rolls back to the previous state when the new combination is rejected.
Important behavior
- The rebuild is atomic: a rejected triangle leaves the previous vertices, surface and density untouched.
- setElementPosition also works and translates the whole triangle.
OOP aliases
foliage:setVertices(v1, v2, v3)
Where this comes from
SOURCECLuaFoliageDefs.cppClient/mods/deathmatch/logic/luadefs/CLuaFoliageDefs.cpp INTRODUCED / EXTENDED29e4398beRead the commit and why the change was made TEST RESOURCE foliage-test test-resources/foliage-test
RELATED NEON APIS
Read the system guide →