reepblue Posted July 21, 2021 Share Posted July 21, 2021 Is there a way to get the entity's scale value based on the matrix value? I'm currently passing scale modifiers via code but I'd like to see the results in the editor if possible. How would I do this? Examples would be the most helpful! Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted July 21, 2021 Share Posted July 21, 2021 Yes. The magnitude of the first three components in the first three matrix rows are the entity global scale: vec3 scale; scale.x = len(mat[0].xyz); scale.y = len(mat[1].xyz); scale.z = len(mat[2].xyz); 1 Quote 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 More sharing options...
reepblue Posted July 21, 2021 Author Share Posted July 21, 2021 Thanks for the start. The compiler complains about the len() function, so I replaced it with length. I'm getting the desired results with decals, but not with planes despite it using the same code. If I could remove the normal blending with the decals, I wouldn't be making an overlay class. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
reepblue Posted July 21, 2021 Author Share Posted July 21, 2021 I rolled back to my previous solution for many reasons. I would have to check the entity's normal and swap out what scale values to use. I have to create a spawner class anyway which does a calculation to determine the base size from the texture. I would not be able to see the results in the editor anyway. My overlay classes are never intended to resize during runtime. The information was helpful and I hope it's useful to others! Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
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.