Community Forum

description to splitShape-Functions

Forum Overview >> Farming Simulator 15

CategoryFarming Simulator 15
Created17.08.2015 17:51


Thomas H. (Patar) 17.08.2015 17:54
Hey guys,

i thought there once was an description of the new SplitShape-Functions in the scripting reference, but I couldn`t find it anymore.

Can someone explain me how the functions eg. "getSplitShapePlaneExtents" or "splitShape" work?

If I use "getSplitShapePlaneExtends", how to know what is aboveLenght and what belowLength?

regards, Thomas

Emil Drefers (giants.edrefers) 18.08.2015 08:07
Hi,

please have a look at the scripts and compare the loaded values with the ones in the i3d file of the chainsaw, woodCrusher, woodHarvester or StumpCutter.

e.g. (woodcrusher.lua, line 223 and following)
...
local lenBelow, lenAbove = getSplitShapePlaneExtents(id, x,y,z, nx,ny,nz);

id: is the id of the split shape
x,y,z: is the origin (maybe space point, unsure about the correct english word) of a plane which is used to cut through the split shape and by this get the length of the split shape to both of the planes' sides
nx,ny.nz: defines the orientation of the plane

The function splitShape works similar to that, except that it uses some more arguments.
Namely a vector (yx,yy,yz) to define the rectangle (not a plane anymore) which is used to cut the split shape into two pieces.
Two arguments two define how large the 'cutting rectangle' should be.
Two arguments to define the callback parameters.

Hope that makes it a bit more clearer.

Cheers,
Emil



Thomas H. (Patar) 29.08.2015 13:52
Thank you! Helped a lot and works fine ;-)

But one question is left. You say "rectangle", sure that you don`t mean "cuboid"? (sorry, I`m not english too)
Because I think rectangle and plane is the same 2D-Object.

regards

Emil Drefers (giants.edrefers) 31.08.2015 08:04
Hi,

yes and no :)

a rectangle is a plane but only limited in space ... a rectangle has a start and an end, where as a plane is infinite in its size ;)

Cheers,
Emil


Note: Log in to post. Create a new account here.