Question on declaring vector of matprops #28918
Answered
by
TheGreatCid
TheGreatCid
asked this question in
Q&A General
-
Check these boxes if you have followed the posting rules.
QuestionHi all, I just want a sanity check regarding the declaration of mat props in a vector. I believe I am doing things correctly, however I am seeing a seg fault during material property declaration. Here is a description of my method, For the class def:
and constructor:
This is just a paired-down example, but I want to double-check that this is the correct way to do this. Thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
TheGreatCid
Oct 24, 2024
Replies: 1 comment 7 replies
-
Hello You need to resize the vector before accessing it at a component Vectors are by default initialized at size 0 |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I figured it out. It was unrelated to how the vector was set up. The value I was using to set the size of the vec was being set to zero and I had not noticed that.