Jump to content

error in test code>? sample terrain. says two many arguments fails in vs22.


battlegear2099
 Share

Go to solution Solved by Josh,

Recommended Posts

 

Syntax

  •   //Apply material based on terrain slope
      for (int x = 0; x < terrain->resolution.x; ++x)
      {
          for (int y = 0; y < terrain->resolution.y; ++y)
          {
              float slope = terrain->GetSlope(x, y);
              if (slope > 15.0f)
              {
                  float wt = Min((slope - 15.0f) / 10.0f, 1.0f);
                  terrain->SetMaterial(x, y, rocks, wt); <-----------------?
              }
          }
      }
  •  
  • void SetMaterial(shared_ptr<Material> material).....

 

 

 

 

Screenshot 2023-12-20 223831.png

  • Thanks 1
Link to comment
Share on other sites

Thank you for finding this! There was a change to the API during development and this example was not updated to reflect that. I will fix it tomorrow morning.

Instead, applications should use Terrain::AddLayer:
https://www.ultraengine.com/learn/Terrain_AddLayer?lang=cpp

And Terrain:SetLayerWeight:
https://www.ultraengine.com/learn/Terrain_SetLayerWeight?lang=cpp

  • Like 1

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

np, I am just starting to look at docs and testing your engine , ok I will test it again when you make the change.   also I got a error testing loadModel code or load plugin . it errors with a end of file error on loading textures, I was able to download the textures and save them local and rewrite it for local and it worked.  so might want to test that, not sure if it was just my local firewall or its the file. 

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...