Alienhead Posted Monday at 11:40 AM Posted Monday at 11:40 AM Ability to line pick material on a terrain. Quote Alienhead Components and Software
Josh Posted Monday at 02:06 PM Posted Monday at 02:06 PM You can get the materials that are in use at any terrain point with these commands: https://www.leadwerks.com/learn/Terrain_GetLayers https://www.leadwerks.com/learn/Terrain_GetLayerWeight 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Alienhead Posted Monday at 05:27 PM Author Posted Monday at 05:27 PM Any advice on this GetLayers() command? All I get back is an Read Pixel Out of Bounds error. Also the docs show sending coords x and y on a 3d terrain ? Should I be sending x and z? local tbl = terrain:GetLayers(self.entity:GetPosition().x, self.entity:GetPosition().z) Quote Alienhead Components and Software
Josh Posted Monday at 06:01 PM Posted Monday at 06:01 PM The coordinates are the X and Y coordinate of the terrain, not the world position. The lower-left corner of the terrain is coordinate 0, 0. World position to terrain coordinate is usually something like this: int x = Round( (pos.x - terrain->resolution.x / 2) / terrain->scale.x ); int y = Round( (pos.z - terrain->resolution.y / 2) / terrain->scale.z ); x = Clamp(x, 0, terrain->resolution.x - 1); y = Clamp(y, 0, terrain->resolution.y - 1); 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
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.