Jump to content

SetScale and SetScalef


AggrorJorn
 Share

Recommended Posts

So I'm just messing around outside the editor. I've taken a look at the example.lua file and I am noticing a different way of scaling and positioning entities.

instead of SetScale(Vec3()), the command SetScalef() is used. I can't find anything about it in the wiki. Whats is so different about it?

 

--edit

Just noticed that the size is different. F probably stands for foot?

Link to comment
Share on other sites

All commands with an f at the end means that they don't take a Vec3 as parameter, but 3 seperate float values.

mesh::SetScale(Vec3(1,2,3))
mesh::SetScalef(1,2,3)

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

f stands for float. It's the same thing, just a different way in passing the parameters. He should have just used the same name. Lua doesn't care if you use the same name with different parameters. It can figure it out.

You have to write the interpretation of the parameters yourself in the Lua interface code. Lua doesn't just choose a function based on the number of parameters, unfortunately.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...